You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1246 lines
2.9 MiB

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{
/***/ "./node_modules/chart.js/dist/Chart.js":
/*!*********************************************!*\
!*** ./node_modules/chart.js/dist/Chart.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/*!\n * Chart.js v2.9.4\n * https://www.chartjs.org\n * (c) 2020 Chart.js Contributors\n * Released under the MIT License\n */\n(function (global, factory) {\n true ? module.exports = factory(function() { try { return __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"); } catch(e) { } }()) :\nundefined;\n}(this, (function (moment) { 'use strict';\n\nmoment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nfunction getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}\n\nvar colorName = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\n\nvar conversions = createCommonjsModule(function (module) {\n/* MIT license */\n\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in colorName) {\n\tif (colorName.hasOwnProperty(key)) {\n\t\treverseKeywords[colorName[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in colorName) {\n\t\tif (colorName.hasOwnProperty(keyword)) {\n\t\t\tvar value = colorName[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn colorName[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n});\nvar conversions_1 = conversions.rgb;\nvar conversions_2 = conversions.hsl;\nvar conversions_3 = conversions.hsv;\nvar conversions_4 = conversions.hwb;\nvar conversions_5 = conversions.cmyk;\nvar conversions_6 = conversions.xyz;\nvar conversions_7 = conversions.lab;\nvar conversions_8 = conversions.lch;\nvar conversions_9 = conversions.hex;\nvar conversions_10 = conversions.keyword;\nvar conversions_11 = conversions.ansi16;\nvar conversions_12 = conversions.ansi256;\nvar conversions_13 = conversions.hcg;\nvar conversions_14 = conversions.apple;\nvar conversions_15 = conversions.gray;\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nvar route = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nvar colorConvert = convert;\n\nvar colorName$1 = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\n\n/* MIT license */\n\n\nvar colorString = {\n getRgba: getRgba,\n getHsla: getHsla,\n getRgb: getRgb,\n getHsl: getHsl,\n getHwb: getHwb,\n getAlpha: getAlpha,\n\n hexString: hexString,\n rgbString: rgbString,\n rgbaString: rgbaString,\n percentString: percentString,\n percentaString: percentaString,\n hslString: hslString,\n hslaString: hslaString,\n hwbString: hwbString,\n keyword: keyword\n};\n\nfunction getRgba(string) {\n if (!string) {\n return;\n }\n var abbr = /^#([a-fA-F0-9]{3,4})$/i,\n hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n keyword = /(\\w+)/;\n\n var rgb = [0, 0, 0],\n a = 1,\n match = string.match(abbr),\n hexAlpha = \"\";\n if (match) {\n match = match[1];\n hexAlpha = match[3];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i] + match[i], 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(hex)) {\n hexAlpha = match[2];\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(rgba)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i + 1]);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(per)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(keyword)) {\n if (match[1] == \"transparent\") {\n return [0, 0, 0, 0];\n }\n rgb = colorName$1[match[1]];\n if (!rgb) {\n return;\n }\n }\n\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = scale(rgb[i], 0, 255);\n }\n if (!a && a != 0) {\n a = 1;\n }\n else {\n a = scale(a, 0, 1);\n }\n rgb[3] = a;\n return rgb;\n}\n\nfunction getHsla(string) {\n if (!string) {\n return;\n }\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hsl);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n s = scale(parseFloat(match[2]), 0, 100),\n l = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, s, l, a];\n }\n}\n\nfunction getHwb(string) {\n if (!string) {\n return;\n }\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hwb);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n w = scale(parseFloat(match[2]), 0, 100),\n b = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, w, b, a];\n }\n}\n\nfunction getRgb(string) {\n var rgba = getRgba(string);\n return rgba && rgba.slice(0, 3);\n}\n\nfunction getHsl(string) {\n var hsla = getHsla(string);\n return hsla && hsla.slice(0, 3);\n}\n\nfunction getAlpha(string) {\n var vals = getRgba(string);\n if (vals) {\n return vals[3];\n }\n else if (vals = getHsla(string)) {\n return vals[3];\n }\n else if (vals = getHwb(string)) {\n return vals[3];\n }\n}\n\n// generators\nfunction hexString(rgba, a) {\n var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];\n return \"#\" + hexDouble(rgba[0]) \n + hexDouble(rgba[1])\n + hexDouble(rgba[2])\n + (\n (a >= 0 && a < 1)\n ? hexDouble(Math.round(a * 255))\n : \"\"\n );\n}\n\nfunction rgbString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return rgbaString(rgba, alpha);\n }\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\n}\n\nfunction rgbaString(rgba, alpha) {\n if (alpha === undefined) {\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\n }\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\n + \", \" + alpha + \")\";\n}\n\nfunction percentString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return percentaString(rgba, alpha);\n }\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\n}\n\nfunction percentaString(rgba, alpha) {\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\n}\n\nfunction hslString(hsla, alpha) {\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\n return hslaString(hsla, alpha);\n }\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\n}\n\nfunction hslaString(hsla, alpha) {\n if (alpha === undefined) {\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\n }\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\n + alpha + \")\";\n}\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\nfunction hwbString(hwb, alpha) {\n if (alpha === undefined) {\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\n }\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\n}\n\nfunction keyword(rgb) {\n return reverseNames[rgb.slice(0, 3)];\n}\n\n// helpers\nfunction scale(num, min, max) {\n return Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n var str = num.toString(16).toUpperCase();\n return (str.length < 2) ? \"0\" + str : str;\n}\n\n\n//create a list of reverse color names\nvar reverseNames = {};\nfor (var name in colorName$1) {\n reverseNames[colorName$1[name]] = name;\n}\n\n/* MIT license */\n\n\n\nvar Color = function (obj) {\n\tif (obj instanceof Color) {\n\t\treturn obj;\n\t}\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj);\n\t}\n\n\tthis.valid = false;\n\tthis.values = {\n\t\trgb: [0, 0, 0],\n\t\thsl: [0, 0, 0],\n\t\thsv: [0, 0, 0],\n\t\thwb: [0, 0, 0],\n\t\tcmyk: [0, 0, 0, 0],\n\t\talpha: 1\n\t};\n\n\t// parse Color() argument\n\tvar vals;\n\tif (typeof obj === 'string') {\n\t\tvals = colorString.getRgba(obj);\n\t\tif (vals) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals = colorString.getHsla(obj)) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals = colorString.getHwb(obj)) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t}\n\t} else if (typeof obj === 'object') {\n\t\tvals = obj;\n\t\tif (vals.r !== undefined || vals.red !== undefined) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals.l !== undefined || vals.lightness !== undefined) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals.v !== undefined || vals.value !== undefined) {\n\t\t\tthis.setValues('hsv', vals);\n\t\t} else if (vals.w !== undefined || vals.whiteness !== undefined) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t} else if (vals.c !== undefined || vals.cyan !== undefined) {\n\t\t\tthis.setValues('cmyk', vals);\n\t\t}\n\t}\n};\n\nColor.prototype = {\n\tisValid: function () {\n\t\treturn this.valid;\n\t},\n\trgb: function () {\n\t\treturn this.setSpace('rgb', arguments);\n\t},\n\thsl: function () {\n\t\treturn this.setSpace('hsl', arguments);\n\t},\n\thsv: function () {\n\t\treturn this.setSpace('hsv', arguments);\n\t},\n\thwb: function () {\n\t\treturn this.setSpace('hwb', arguments);\n\t},\n\tcmyk: function () {\n\t\treturn this.setSpace('cmyk', arguments);\n\t},\n\n\trgbArray: function () {\n\t\treturn this.values.rgb;\n\t},\n\thslArray: function () {\n\t\treturn this.values.hsl;\n\t},\n\thsvArray: function () {\n\t\treturn this.values.hsv;\n\t},\n\thwbArray: function () {\n\t\tvar values = this.values;\n\t\tif (values.alpha !== 1) {\n\t\t\treturn values.hwb.concat([values.alpha]);\n\t\t}\n\t\treturn values.hwb;\n\t},\n\tcmykArray: function () {\n\t\treturn this.values.cmyk;\n\t},\n\trgbaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.rgb.concat([values.alpha]);\n\t},\n\thslaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.hsl.concat([values.alpha]);\n\t},\n\talpha: function (val) {\n\t\tif (val === undefined) {\n\t\t\treturn this.values.alpha;\n\t\t}\n\t\tthis.setValues('alpha', val);\n\t\treturn this;\n\t},\n\n\tred: function (val) {\n\t\treturn this.setChannel('rgb', 0, val);\n\t},\n\tgreen: function (val) {\n\t\treturn this.setChannel('rgb', 1, val);\n\t},\n\tblue: function (val) {\n\t\treturn this.setChannel('rgb', 2, val);\n\t},\n\thue: function (val) {\n\t\tif (val) {\n\t\t\tval %= 360;\n\t\t\tval = val < 0 ? 360 + val : val;\n\t\t}\n\t\treturn this.setChannel('hsl', 0, val);\n\t},\n\tsaturation: function (val) {\n\t\treturn this.setChannel('hsl', 1, val);\n\t},\n\tlightness: function (val) {\n\t\treturn this.setChannel('hsl', 2, val);\n\t},\n\tsaturationv: function (val) {\n\t\treturn this.setChannel('hsv', 1, val);\n\t},\n\twhiteness: function (val) {\n\t\treturn this.setChannel('hwb', 1, val);\n\t},\n\tblackness: function (val) {\n\t\treturn this.setChannel('hwb', 2, val);\n\t},\n\tvalue: function (val) {\n\t\treturn this.setChannel('hsv', 2, val);\n\t},\n\tcyan: function (val) {\n\t\treturn this.setChannel('cmyk', 0, val);\n\t},\n\tmagenta: function (val) {\n\t\treturn this.setChannel('cmyk', 1, val);\n\t},\n\tyellow: function (val) {\n\t\treturn this.setChannel('cmyk', 2, val);\n\t},\n\tblack: function (val) {\n\t\treturn this.setChannel('cmyk', 3, val);\n\t},\n\n\thexString: function () {\n\t\treturn colorString.hexString(this.values.rgb);\n\t},\n\trgbString: function () {\n\t\treturn colorString.rgbString(this.values.rgb, this.values.alpha);\n\t},\n\trgbaString: function () {\n\t\treturn colorString.rgbaString(this.values.rgb, this.values.alpha);\n\t},\n\tpercentString: function () {\n\t\treturn colorString.percentString(this.values.rgb, this.values.alpha);\n\t},\n\thslString: function () {\n\t\treturn colorString.hslString(this.values.hsl, this.values.alpha);\n\t},\n\thslaString: function () {\n\t\treturn colorString.hslaString(this.values.hsl, this.values.alpha);\n\t},\n\thwbString: function () {\n\t\treturn colorString.hwbString(this.values.hwb, this.values.alpha);\n\t},\n\tkeyword: function () {\n\t\treturn colorString.keyword(this.values.rgb, this.values.alpha);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.values.rgb;\n\t\treturn (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.values.rgb;\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tdark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.values.rgb;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tlight: function () {\n\t\treturn !this.dark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = [];\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb[i] = 255 - this.values.rgb[i];\n\t\t}\n\t\tthis.setValues('rgb', rgb);\n\t\treturn this;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] += hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] -= hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] += hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] -= hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[1] += hwb[1] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[2] += hwb[2] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tgreyscale: function () {\n\t\tvar rgb = this.values.rgb;\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\tthis.setValues('rgb', [val, val, val]);\n\t\treturn this;\n\t},\n\n\tclearer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha - (alpha * ratio));\n\t\treturn this;\n\t},\n\n\topaquer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha + (alpha * ratio));\n\t\treturn this;\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.values.hsl;\n\t\tvar hue = (hsl[0] + degrees) % 360;\n\t\thsl[0] = hue < 0 ? 360 + hue : hue;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\t/**\n\t * Ported from sass implementation in C\n\t * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t */\n\tmix: function (mixinColor, weight) {\n\t\tvar color1 = this;\n\t\tvar color2 = mixinColor;\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn this\n\t\t\t.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue()\n\t\t\t)\n\t\t\t.alpha(color1.alpha() * p + color2.alpha() * (1 - p));\n\t},\n\n\ttoJSON: function () {\n\t\treturn this.rgb();\n\t},\n\n\tclone: function () {\n\t\t// NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\n\t\t// making the final build way to big to embed in Chart.js. So let's do it manually,\n\t\t// assuming that values to clone are 1 dimension arrays containing only numbers,\n\t\t// except 'alpha' which is a number.\n\t\tvar result = new Color();\n\t\tvar source = this.values;\n\t\tvar target = result.values;\n\t\tvar value, type;\n\n\t\tfor (var prop in source) {\n\t\t\tif (source.hasOwnProperty(prop)) {\n\t\t\t\tvalue = source[prop];\n\t\t\t\ttype = ({}).toString.call(value);\n\t\t\t\tif (type === '[object Array]') {\n\t\t\t\t\ttarget[prop] = value.slice(0);\n\t\t\t\t} else if (type === '[object Number]') {\n\t\t\t\t\ttarget[prop] = value;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error('unexpected color value:', value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n};\n\nColor.prototype.spaces = {\n\trgb: ['red', 'green', 'blue'],\n\thsl: ['hue', 'saturation', 'lightness'],\n\thsv: ['hue', 'saturation', 'value'],\n\thwb: ['hue', 'whiteness', 'blackness'],\n\tcmyk: ['cyan', 'magenta', 'yellow', 'black']\n};\n\nColor.prototype.maxes = {\n\trgb: [255, 255, 255],\n\thsl: [360, 100, 100],\n\thsv: [360, 100, 100],\n\thwb: [360, 100, 100],\n\tcmyk: [100, 100, 100, 100]\n};\n\nColor.prototype.getValues = function (space) {\n\tvar values = this.values;\n\tvar vals = {};\n\n\tfor (var i = 0; i < space.length; i++) {\n\t\tvals[space.charAt(i)] = values[space][i];\n\t}\n\n\tif (values.alpha !== 1) {\n\t\tvals.a = values.alpha;\n\t}\n\n\t// {r: 255, g: 255, b: 255, a: 0.4}\n\treturn vals;\n};\n\nColor.prototype.setValues = function (space, vals) {\n\tvar values = this.values;\n\tvar spaces = this.spaces;\n\tvar maxes = this.maxes;\n\tvar alpha = 1;\n\tvar i;\n\n\tthis.valid = true;\n\n\tif (space === 'alpha') {\n\t\talpha = vals;\n\t} else if (vals.length) {\n\t\t// [10, 10, 10]\n\t\tvalues[space] = vals.slice(0, space.length);\n\t\talpha = vals[space.length];\n\t} else if (vals[space.charAt(0)] !== undefined) {\n\t\t// {r: 10, g: 10, b: 10}\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[space.charAt(i)];\n\t\t}\n\n\t\talpha = vals.a;\n\t} else if (vals[spaces[space][0]] !== undefined) {\n\t\t// {red: 10, green: 10, blue: 10}\n\t\tvar chans = spaces[space];\n\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[chans[i]];\n\t\t}\n\n\t\talpha = vals.alpha;\n\t}\n\n\tvalues.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\n\n\tif (space === 'alpha') {\n\t\treturn false;\n\t}\n\n\tvar capped;\n\n\t// cap values of the space prior converting all values\n\tfor (i = 0; i < space.length; i++) {\n\t\tcapped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\n\t\tvalues[space][i] = Math.round(capped);\n\t}\n\n\t// convert to all the other color spaces\n\tfor (var sname in spaces) {\n\t\tif (sname !== space) {\n\t\t\tvalues[sname] = colorConvert[space][sname](values[space]);\n\t\t}\n\t}\n\n\treturn true;\n};\n\nColor.prototype.setSpace = function (space, args) {\n\tvar vals = args[0];\n\n\tif (vals === undefined) {\n\t\t// color.rgb()\n\t\treturn this.getValues(space);\n\t}\n\n\t// color.rgb(10, 10, 10)\n\tif (typeof vals === 'number') {\n\t\tvals = Array.prototype.slice.call(args);\n\t}\n\n\tthis.setValues(space, vals);\n\treturn this;\n};\n\nColor.prototype.setChannel = function (space, index, val) {\n\tvar svalues = this.values[space];\n\tif (val === undefined) {\n\t\t// color.red()\n\t\treturn svalues[index];\n\t} else if (val === svalues[index]) {\n\t\t// color.red(color.red())\n\t\treturn this;\n\t}\n\n\t// color.red(100)\n\tsvalues[index] = val;\n\tthis.setValues(space, svalues);\n\n\treturn this;\n};\n\nif (typeof window !== 'undefined') {\n\twindow.Color = Color;\n}\n\nvar chartjsColor = Color;\n\nfunction isValidKey(key) {\r\n\treturn ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\r\n}\r\n\r\n/**\r\n * @namespace Chart.helpers\r\n */\r\nvar helpers = {\r\n\t/**\r\n\t * An empty function that can be used, for example, for optional callback.\r\n\t */\r\n\tnoop: function() {},\r\n\r\n\t/**\r\n\t * Returns a unique id, sequentially generated from a global variable.\r\n\t * @returns {number}\r\n\t * @function\r\n\t */\r\n\tuid: (function() {\r\n\t\tvar id = 0;\r\n\t\treturn function() {\r\n\t\t\treturn id++;\r\n\t\t};\r\n\t}()),\r\n\r\n\t/**\r\n\t * Returns true if `value` is neither null nor undefined, else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisNullOrUndef: function(value) {\r\n\t\treturn value === null || typeof value === 'undefined';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an array (including typed arrays), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @function\r\n\t */\r\n\tisArray: function(value) {\r\n\t\tif (Array.isArray && Array.isArray(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar type = Object.prototype.toString.call(value);\r\n\t\tif (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an object (excluding null), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisObject: function(value) {\r\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is a finite number, else returns false\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t */\r\n\tisFinite: function(value) {\r\n\t\treturn (typeof value === 'number' || value instanceof Number) && isFinite(value);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns `value` if defined, else returns `defaultValue`.\r\n\t * @param {*} value - The value to return if defined.\r\n\t * @param {*} defaultValue - The value to return if `value` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueOrDefault: function(value, defaultValue) {\r\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns value at the given `index` in array if defined, else returns `defaultValue`.\r\n\t * @param {Array} value - The array to lookup for value at `index`.\r\n\t * @param {number} index - The index in `value` to lookup for value.\r\n\t * @param {*} defaultValue - The value to return if `value[index]` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueAtIndexOrDefault: function(value, index, defaultValue) {\r\n\t\treturn helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\r\n\t},\r\n\r\n\t/**\r\n\t * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\r\n\t * value returned by `fn`. If `fn` is not a function, this method returns undefined.\r\n\t * @param {function} fn - The function to call.\r\n\t * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @returns {*}\r\n\t */\r\n\tcallback: function(fn, args, thisArg) {\r\n\t\tif (fn && typeof fn.call === 'function') {\r\n\t\t\treturn fn.apply(thisArg, args);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Note(SB) for performance sake, this method should only be used when loopable type\r\n\t * is unknown or in none intensive code (not called often and small loopable). Else\r\n\t * it's preferable to use a regular for() loop and save extra function calls.\r\n\t * @param {object|Array} loopable - The object or array to be iterated.\r\n\t * @param {function} fn - The function to call for each item.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @param {boolean} [reverse] - If true, iterates backward on the loopable.\r\n\t */\r\n\teach: function(loopable, fn, thisArg, reverse) {\r\n\t\tvar i, len, keys;\r\n\t\tif (helpers.isArray(loopable)) {\r\n\t\t\tlen = loopable.length;\r\n\t\t\tif (reverse) {\r\n\t\t\t\tfor (i = len - 1; i >= 0; i--) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (helpers.isObject(loopable)) {\r\n\t\t\tkeys = Object.keys(loopable);\r\n\t\t\tlen = keys.length;\r\n\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\tfn.call(thisArg, loopable[keys[i]], keys[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\r\n\t * @see https://stackoverflow.com/a/14853974\r\n\t * @param {Array} a0 - The array to compare\r\n\t * @param {Array} a1 - The array to compare\r\n\t * @returns {boolean}\r\n\t */\r\n\tarrayEquals: function(a0, a1) {\r\n\t\tvar i, ilen, v0, v1;\r\n\r\n\t\tif (!a0 || !a1 || a0.length !== a1.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = a0.length; i < ilen; ++i) {\r\n\t\t\tv0 = a0[i];\r\n\t\t\tv1 = a1[i];\r\n\r\n\t\t\tif (v0 instanceof Array && v1 instanceof Array) {\r\n\t\t\t\tif (!helpers.arrayEquals(v0, v1)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (v0 !== v1) {\r\n\t\t\t\t// NOTE: two different object instances will never be equal: {x:20} != {x:20}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a deep copy of `source` without keeping references on objects and arrays.\r\n\t * @param {*} source - The value to clone.\r\n\t * @returns {*}\r\n\t */\r\n\tclone: function(source) {\r\n\t\tif (helpers.isArray(source)) {\r\n\t\t\treturn source.map(helpers.clone);\r\n\t\t}\r\n\r\n\t\tif (helpers.isObject(source)) {\r\n\t\t\tvar target = Object.create(source);\r\n\t\t\tvar keys = Object.keys(source);\r\n\t\t\tvar klen = keys.length;\r\n\t\t\tvar k = 0;\r\n\r\n\t\t\tfor (; k < klen; ++k) {\r\n\t\t\t\ttarget[keys[k]] = helpers.clone(source[keys[k]]);\r\n\t\t\t}\r\n\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\treturn source;\r\n\t},\r\n\r\n\t/**\r\n\t * The default merger when Chart.helpers.merge is called without merger option.\r\n\t * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\r\n\t * @private\r\n\t */\r\n\t_merger: function(key, target, source, options) {\r\n\t\tif (!isValidKey(key)) {\r\n\t\t\t// We want to ensure we do not copy prototypes over\r\n\t\t\t// as this can pollute global namespaces\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.merge(tval, sval, options);\r\n\t\t} else {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Merges source[key] in target[key] only if target[key] is undefined.\r\n\t * @private\r\n\t */\r\n\t_mergerIf: function(key, target, source) {\r\n\t\tif (!isValidKey(key)) {\r\n\t\t\t// We want to ensure we do not copy prototypes over\r\n\t\t\t// as this can pollute global namespaces\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.mergeIf(tval, sval);\r\n\t\t} else if (!target.hasOwnProperty(key)) {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` with the given `options`.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @param {object} [options] - Merging options:\r\n\t * @param {function} [options.merger] - The merge method (key, target, source, options)\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmerge: function(target, source, options) {\r\n\t\tvar sources = helpers.isArray(source) ? source : [source];\r\n\t\tvar ilen = sources.length;\r\n\t\tvar merge, i, keys, klen, k;\r\n\r\n\t\tif (!helpers.isObject(target)) {\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\toptions = options || {};\r\n\t\tmerge = options.merger || helpers._merger;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tsource = sources[i];\r\n\t\t\tif (!helpers.isObject(source)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tkeys = Object.keys(source);\r\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\r\n\t\t\t\tmerge(keys[k], target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` *only* if not defined in target.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmergeIf: function(target, source) {\r\n\t\treturn helpers.merge(target, source, {merger: helpers._mergerIf});\r\n\t},\r\n\r\n\t/**\r\n\t * Applies the contents of two or more objects together into the first object.\r\n\t * @param {object} target - The target object in which all objects are merged into.\r\n\t * @param {object} arg1 - Object containing additional properties to merge in target.\r\n\t * @param {object} argN - Additional objects containing properties to merge in target.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\textend: Object.assign || function(target) {\r\n\t\treturn helpers.merge(target, [].slice.call(arguments, 1), {\r\n\t\t\tmerger: function(key, dst, src) {\r\n\t\t\t\tdst[key] = src[key];\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Basic javascript inheritance based on the model created in Backbone.js\r\n\t */\r\n\tinherits: function(extensions) {\r\n\t\tvar me = this;\r\n\t\tvar ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\r\n\t\t\treturn me.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tvar Surrogate = function() {\r\n\t\t\tthis.constructor = ChartElement;\r\n\t\t};\r\n\r\n\t\tSurrogate.prototype = me.prototype;\r\n\t\tChartElement.prototype = new Surrogate();\r\n\t\tChartElement.extend = helpers.inherits;\r\n\r\n\t\tif (extensions) {\r\n\t\t\thelpers.extend(ChartElement.prototype, extensions);\r\n\t\t}\r\n\r\n\t\tChartElement.__super__ = me.prototype;\r\n\t\treturn ChartElement;\r\n\t},\r\n\r\n\t_deprecated: function(scope, value, previous, current) {\r\n\t\tif (value !== undefined) {\r\n\t\t\tconsole.warn(scope + ': \"' + previous +\r\n\t\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar helpers_core = helpers;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.callback instead.\r\n * @function Chart.helpers.callCallback\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.callCallback = helpers.callback;\r\n\r\n/**\r\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\r\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\r\n * @function Chart.helpers.indexOf\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.indexOf = function(array, item, fromIndex) {\r\n\treturn Array.prototype.indexOf.call(array, item, fromIndex);\r\n};\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\r\n * @function Chart.helpers.getValueOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueOrDefault = helpers.valueOrDefault;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\r\n * @function Chart.helpers.getValueAtIndexOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n/**\r\n * Easing functions adapted from Robert Penner's easing equations.\r\n * @namespace Chart.helpers.easingEffects\r\n * @see http://www.robertpenner.com/easing/\r\n */\r\nvar effects = {\r\n\tlinear: function(t) {\r\n\t\treturn t;\r\n\t},\r\n\r\n\teaseInQuad: function(t) {\r\n\t\treturn t * t;\r\n\t},\r\n\r\n\teaseOutQuad: function(t) {\r\n\t\treturn -t * (t - 2);\r\n\t},\r\n\r\n\teaseInOutQuad: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((--t) * (t - 2) - 1);\r\n\t},\r\n\r\n\teaseInCubic: function(t) {\r\n\t\treturn t * t * t;\r\n\t},\r\n\r\n\teaseOutCubic: function(t) {\r\n\t\treturn (t = t - 1) * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutCubic: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t + 2);\r\n\t},\r\n\r\n\teaseInQuart: function(t) {\r\n\t\treturn t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuart: function(t) {\r\n\t\treturn -((t = t - 1) * t * t * t - 1);\r\n\t},\r\n\r\n\teaseInOutQuart: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((t -= 2) * t * t * t - 2);\r\n\t},\r\n\r\n\teaseInQuint: function(t) {\r\n\t\treturn t * t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuint: function(t) {\r\n\t\treturn (t = t - 1) * t * t * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutQuint: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\r\n\t},\r\n\r\n\teaseInSine: function(t) {\r\n\t\treturn -Math.cos(t * (Math.PI / 2)) + 1;\r\n\t},\r\n\r\n\teaseOutSine: function(t) {\r\n\t\treturn Math.sin(t * (Math.PI / 2));\r\n\t},\r\n\r\n\teaseInOutSine: function(t) {\r\n\t\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\r\n\t},\r\n\r\n\teaseInExpo: function(t) {\r\n\t\treturn (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\r\n\t},\r\n\r\n\teaseOutExpo: function(t) {\r\n\t\treturn (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\r\n\t},\r\n\r\n\teaseInOutExpo: function(t) {\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * Math.pow(2, 10 * (t - 1));\r\n\t\t}\r\n\t\treturn 0.5 * (-Math.pow(2, -10 * --t) + 2);\r\n\t},\r\n\r\n\teaseInCirc: function(t) {\r\n\t\tif (t >= 1) {\r\n\t\t\treturn t;\r\n\t\t}\r\n\t\treturn -(Math.sqrt(1 - t * t) - 1);\r\n\t},\r\n\r\n\teaseOutCirc: function(t) {\r\n\t\treturn Math.sqrt(1 - (t = t - 1) * t);\r\n\t},\r\n\r\n\teaseInOutCirc: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn -0.5 * (Math.sqrt(1 - t * t) - 1);\r\n\t\t}\r\n\t\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\r\n\t},\r\n\r\n\teaseInElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t},\r\n\r\n\teaseOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\r\n\t},\r\n\r\n\teaseInOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((t /= 0.5) === 2) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.45;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\tif (t < 1) {\r\n\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n\t},\r\n\teaseInBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn t * t * ((s + 1) * t - s);\r\n\t},\r\n\r\n\teaseOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn (t = t - 1) * t * ((s + 1) * t + s) + 1;\r\n\t},\r\n\r\n\teaseInOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\r\n\t},\r\n\r\n\teaseInBounce: function(t) {\r\n\t\treturn 1 - effects.easeOutBounce(1 - t);\r\n\t},\r\n\r\n\teaseOutBounce: function(t) {\r\n\t\tif (t < (1 / 2.75)) {\r\n\t\t\treturn 7.5625 * t * t;\r\n\t\t}\r\n\t\tif (t < (2 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\r\n\t\t}\r\n\t\tif (t < (2.5 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\r\n\t\t}\r\n\t\treturn 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\r\n\t},\r\n\r\n\teaseInOutBounce: function(t) {\r\n\t\tif (t < 0.5) {\r\n\t\t\treturn effects.easeInBounce(t * 2) * 0.5;\r\n\t\t}\r\n\t\treturn effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\r\n\t}\r\n};\r\n\r\nvar helpers_easing = {\r\n\teffects: effects\r\n};\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\r\n * @function Chart.helpers.easingEffects\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.easingEffects = effects;\n\nvar PI = Math.PI;\r\nvar RAD_PER_DEG = PI / 180;\r\nvar DOUBLE_PI = PI * 2;\r\nvar HALF_PI = PI / 2;\r\nvar QUARTER_PI = PI / 4;\r\nvar TWO_THIRDS_PI = PI * 2 / 3;\r\n\r\n/**\r\n * @namespace Chart.helpers.canvas\r\n */\r\nvar exports$1 = {\r\n\t/**\r\n\t * Clears the entire canvas associated to the given `chart`.\r\n\t * @param {Chart} chart - The chart for which to clear the canvas.\r\n\t */\r\n\tclear: function(chart) {\r\n\t\tchart.ctx.clearRect(0, 0, chart.width, chart.height);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\r\n\t * given size (width, height) and the same `radius` for all corners.\r\n\t * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\r\n\t * @param {number} x - The x axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} y - The y axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} width - The rectangle's width.\r\n\t * @param {number} height - The rectangle's height.\r\n\t * @param {number} radius - The rounded amount (in pixels) for the four corners.\r\n\t * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\r\n\t */\r\n\troundedRect: function(ctx, x, y, width, height, radius) {\r\n\t\tif (radius) {\r\n\t\t\tvar r = Math.min(radius, height / 2, width / 2);\r\n\t\t\tvar left = x + r;\r\n\t\t\tvar top = y + r;\r\n\t\t\tvar right = x + width - r;\r\n\t\t\tvar bottom = y + height - r;\r\n\r\n\t\t\tctx.moveTo(x, top);\r\n\t\t\tif (left < right && top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, -HALF_PI);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, 0);\r\n\t\t\t\tctx.arc(right, bottom, r, 0, HALF_PI);\r\n\t\t\t\tctx.arc(left, bottom, r, HALF_PI, PI);\r\n\t\t\t} else if (left < right) {\r\n\t\t\t\tctx.moveTo(left, y);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, HALF_PI);\r\n\t\t\t\tctx.arc(left, top, r, HALF_PI, PI + HALF_PI);\r\n\t\t\t} else if (top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, 0);\r\n\t\t\t\tctx.arc(left, bottom, r, 0, PI);\r\n\t\t\t} else {\r\n\t\t\t\tctx.arc(left, top, r, -PI, PI);\r\n\t\t\t}\r\n\t\t\tctx.closePath();\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t} else {\r\n\t\t\tctx.rect(x, y, width, height);\r\n\t\t}\r\n\t},\r\n\r\n\tdrawPoint: function(ctx, style, radius, x, y, rotation) {\r\n\t\tvar type, xOffset, yOffset, size, cornerRadius;\r\n\t\tvar rad = (rotation || 0) * RAD_PER_DEG;\r\n\r\n\t\tif (style && typeof style === 'object') {\r\n\t\t\ttype = style.toString();\r\n\t\t\tif (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.translate(x, y);\r\n\t\t\t\tctx.rotate(rad);\r\n\t\t\t\tctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\r\n\t\t\t\tctx.restore();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isNaN(radius) || radius <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\r\n\t\tswitch (style) {\r\n\t\t// Default includes circle\r\n\t\tdefault:\r\n\t\t\tctx.arc(x, y, radius, 0, DOUBLE_PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'triangle':\r\n\t\t\tctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rectRounded':\r\n\t\t\t// NOTE: the rounded rect implementation changed to use `arc` instead of\r\n\t\t\t// `quadraticCurveTo` since it generates better results when rect is\r\n\t\t\t// almost a circle. 0.516 (instead of 0.5) produces results with visually\r\n\t\t\t// closer proportion to the previous impl and it is inscribed in the\r\n\t\t\t// circle with `radius`. For more details, see the following PRs:\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5597\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5858\r\n\t\t\tcornerRadius = radius * 0.516;\r\n\t\t\tsize = radius - cornerRadius;\r\n\t\t\txOffset = Math.cos(rad + QUARTER_PI) * size;\r\n\t\t\tyOffset = Math.sin(rad + QUARTER_PI) * size;\r\n\t\t\tctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\r\n\t\t\tctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\r\n\t\t\tctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\r\n\t\t\tctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rect':\r\n\t\t\tif (!rotation) {\r\n\t\t\t\tsize = Math.SQRT1_2 * radius;\r\n\t\t\t\tctx.rect(x - size, y - size, 2 * size, 2 * size);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'rectRot':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'crossRot':\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'cross':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'star':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'line':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'dash':\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t\tctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tctx.fill();\r\n\t\tctx.stroke();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the point is inside the rectangle\r\n\t * @param {object} point - The point to test\r\n\t * @param {object} area - The rectangle\r\n\t * @returns {boolean}\r\n\t * @private\r\n\t */\r\n\t_isPointInArea: function(point, area) {\r\n\t\tvar epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\r\n\r\n\t\treturn point.x > area.left - epsilon && point.x < area.right + epsilon &&\r\n\t\t\tpoint.y > area.top - epsilon && point.y < area.bottom + epsilon;\r\n\t},\r\n\r\n\tclipArea: function(ctx, area) {\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\r\n\t\tctx.clip();\r\n\t},\r\n\r\n\tunclipArea: function(ctx) {\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\tlineTo: function(ctx, previous, target, flip) {\r\n\t\tvar stepped = target.steppedLine;\r\n\t\tif (stepped) {\r\n\t\t\tif (stepped === 'middle') {\r\n\t\t\t\tvar midpoint = (previous.x + target.x) / 2.0;\r\n\t\t\t\tctx.lineTo(midpoint, flip ? target.y : previous.y);\r\n\t\t\t\tctx.lineTo(midpoint, flip ? previous.y : target.y);\r\n\t\t\t} else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) {\r\n\t\t\t\tctx.lineTo(previous.x, target.y);\r\n\t\t\t} else {\r\n\t\t\t\tctx.lineTo(target.x, previous.y);\r\n\t\t\t}\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!target.tension) {\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.bezierCurveTo(\r\n\t\t\tflip ? previous.controlPointPreviousX : previous.controlPointNextX,\r\n\t\t\tflip ? previous.controlPointPreviousY : previous.controlPointNextY,\r\n\t\t\tflip ? target.controlPointNextX : target.controlPointPreviousX,\r\n\t\t\tflip ? target.controlPointNextY : target.controlPointPreviousY,\r\n\t\t\ttarget.x,\r\n\t\t\ttarget.y);\r\n\t}\r\n};\r\n\r\nvar helpers_canvas = exports$1;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\r\n * @namespace Chart.helpers.clear\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.clear = exports$1.clear;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\r\n * @namespace Chart.helpers.drawRoundedRectangle\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.drawRoundedRectangle = function(ctx) {\r\n\tctx.beginPath();\r\n\texports$1.roundedRect.apply(exports$1, arguments);\r\n};\n\nvar defaults = {\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_set: function(scope, values) {\r\n\t\treturn helpers_core.merge(this[scope] || (this[scope] = {}), values);\r\n\t}\r\n};\r\n\r\n// TODO(v3): remove 'global' from namespace. all default are global and\r\n// there's inconsistency around which options are under 'global'\r\ndefaults._set('global', {\r\n\tdefaultColor: 'rgba(0,0,0,0.1)',\r\n\tdefaultFontColor: '#666',\r\n\tdefaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\r\n\tdefaultFontSize: 12,\r\n\tdefaultFontStyle: 'normal',\r\n\tdefaultLineHeight: 1.2,\r\n\tshowLines: true\r\n});\r\n\r\nvar core_defaults = defaults;\n\nvar valueOrDefault = helpers_core.valueOrDefault;\r\n\r\n/**\r\n * Converts the given font object into a CSS font string.\r\n * @param {object} font - A font object.\r\n * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\r\n * @private\r\n */\r\nfunction toFontString(font) {\r\n\tif (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (font.style ? font.style + ' ' : '')\r\n\t\t+ (font.weight ? font.weight + ' ' : '')\r\n\t\t+ font.size + 'px '\r\n\t\t+ font.family;\r\n}\r\n\r\n/**\r\n * @alias Chart.helpers.options\r\n * @namespace\r\n */\r\nvar helpers_options = {\r\n\t/**\r\n\t * Converts the given line height `value` in pixels for a specific font `size`.\r\n\t * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\r\n\t * @param {number} size - The font size (in pixels) used to resolve relative `value`.\r\n\t * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid).\r\n\t * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoLineHeight: function(value, size) {\r\n\t\tvar matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\r\n\t\tif (!matches || matches[1] === 'normal') {\r\n\t\t\treturn size * 1.2;\r\n\t\t}\r\n\r\n\t\tvalue = +matches[2];\r\n\r\n\t\tswitch (matches[3]) {\r\n\t\tcase 'px':\r\n\t\t\treturn value;\r\n\t\tcase '%':\r\n\t\t\tvalue /= 100;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn size * value;\r\n\t},\r\n\r\n\t/**\r\n\t * Converts the given value into a padding object with pre-computed width/height.\r\n\t * @param {number|object} value - If a number, set the value to all TRBL component,\r\n\t * else, if and object, use defined properties and sets undefined ones to 0.\r\n\t * @returns {object} The padding values (top, right, bottom, left, width, height)\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoPadding: function(value) {\r\n\t\tvar t, r, b, l;\r\n\r\n\t\tif (helpers_core.isObject(value)) {\r\n\t\t\tt = +value.top || 0;\r\n\t\t\tr = +value.right || 0;\r\n\t\t\tb = +value.bottom || 0;\r\n\t\t\tl = +value.left || 0;\r\n\t\t} else {\r\n\t\t\tt = r = b = l = +value || 0;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttop: t,\r\n\t\t\tright: r,\r\n\t\t\tbottom: b,\r\n\t\t\tleft: l,\r\n\t\t\theight: t + b,\r\n\t\t\twidth: l + r\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Parses font options and returns the font object.\r\n\t * @param {object} options - A object that contains font options to be parsed.\r\n\t * @return {object} The font object.\r\n\t * @todo Support font.* options and renamed to toFont().\r\n\t * @private\r\n\t */\r\n\t_parseFont: function(options) {\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\r\n\t\tvar font = {\r\n\t\t\tfamily: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),\r\n\t\t\tlineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size),\r\n\t\t\tsize: size,\r\n\t\t\tstyle: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle),\r\n\t\t\tweight: null,\r\n\t\t\tstring: ''\r\n\t\t};\r\n\r\n\t\tfont.string = toFontString(font);\r\n\t\treturn font;\r\n\t},\r\n\r\n\t/**\r\n\t * Evaluates the given `inputs` sequentially and returns the first defined value.\r\n\t * @param {Array} inputs - An array of values, falling back to the last value.\r\n\t * @param {object} [context] - If defined and the current value is a function, the value\r\n\t * is called with `context` as first argument and the result becomes the new input.\r\n\t * @param {number} [index] - If defined and the current value is an array, the value\r\n\t * at `index` become the new input.\r\n\t * @param {object} [info] - object to return information about resolution in\r\n\t * @param {boolean} [info.cacheable] - Will be set to `false` if option is not cacheable.\r\n\t * @since 2.7.0\r\n\t */\r\n\tresolve: function(inputs, context, index, info) {\r\n\t\tvar cacheable = true;\r\n\t\tvar i, ilen, value;\r\n\r\n\t\tfor (i = 0, ilen = inputs.length; i < ilen; ++i) {\r\n\t\t\tvalue = inputs[i];\r\n\t\t\tif (value === undefined) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (context !== undefined && typeof value === 'function') {\r\n\t\t\t\tvalue = value(context);\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (index !== undefined && helpers_core.isArray(value)) {\r\n\t\t\t\tvalue = value[index];\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tif (info && !cacheable) {\r\n\t\t\t\t\tinfo.cacheable = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\n\n/**\r\n * @alias Chart.helpers.math\r\n * @namespace\r\n */\r\nvar exports$2 = {\r\n\t/**\r\n\t * Returns an array of factors sorted from 1 to sqrt(value)\r\n\t * @private\r\n\t */\r\n\t_factorize: function(value) {\r\n\t\tvar result = [];\r\n\t\tvar sqrt = Math.sqrt(value);\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 1; i < sqrt; i++) {\r\n\t\t\tif (value % i === 0) {\r\n\t\t\t\tresult.push(i);\r\n\t\t\t\tresult.push(value / i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (sqrt === (sqrt | 0)) { // if value is a square number\r\n\t\t\tresult.push(sqrt);\r\n\t\t}\r\n\r\n\t\tresult.sort(function(a, b) {\r\n\t\t\treturn a - b;\r\n\t\t}).pop();\r\n\t\treturn result;\r\n\t},\r\n\r\n\tlog10: Math.log10 || function(x) {\r\n\t\tvar exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.\r\n\t\t// Check for whole powers of 10,\r\n\t\t// which due to floating point rounding error should be corrected.\r\n\t\tvar powerOf10 = Math.round(exponent);\r\n\t\tvar isPowerOf10 = x === Math.pow(10, powerOf10);\r\n\r\n\t\treturn isPowerOf10 ? powerOf10 : exponent;\r\n\t}\r\n};\r\n\r\nvar helpers_math = exports$2;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.math.log10 instead.\r\n * @namespace Chart.helpers.log10\r\n * @deprecated since version 2.9.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.log10 = exports$2.log10;\n\nvar getRtlAdapter = function(rectX, width) {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn rectX + rectX + width - x;\r\n\t\t},\r\n\t\tsetWidth: function(w) {\r\n\t\t\twidth = w;\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\tif (align === 'center') {\r\n\t\t\t\treturn align;\r\n\t\t\t}\r\n\t\t\treturn align === 'right' ? 'left' : 'right';\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x - value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, itemWidth) {\r\n\t\t\treturn x - itemWidth;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getLtrAdapter = function() {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn x;\r\n\t\t},\r\n\t\tsetWidth: function(w) { // eslint-disable-line no-unused-vars\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\treturn align;\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x + value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars\r\n\t\t\treturn x;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getAdapter = function(rtl, rectX, width) {\r\n\treturn rtl ? getRtlAdapter(rectX, width) : getLtrAdapter();\r\n};\r\n\r\nvar overrideTextDirection = function(ctx, direction) {\r\n\tvar style, original;\r\n\tif (direction === 'ltr' || direction === 'rtl') {\r\n\t\tstyle = ctx.canvas.style;\r\n\t\toriginal = [\r\n\t\t\tstyle.getPropertyValue('direction'),\r\n\t\t\tstyle.getPropertyPriority('direction'),\r\n\t\t];\r\n\r\n\t\tstyle.setProperty('direction', direction, 'important');\r\n\t\tctx.prevTextDirection = original;\r\n\t}\r\n};\r\n\r\nvar restoreTextDirection = function(ctx) {\r\n\tvar original = ctx.prevTextDirection;\r\n\tif (original !== undefined) {\r\n\t\tdelete ctx.prevTextDirection;\r\n\t\tctx.canvas.style.setProperty('direction', original[0], original[1]);\r\n\t}\r\n};\r\n\r\nvar helpers_rtl = {\r\n\tgetRtlAdapter: getAdapter,\r\n\toverrideTextDirection: overrideTextDirection,\r\n\trestoreTextDirection: restoreTextDirection,\r\n};\n\nvar helpers$1 = helpers_core;\r\nvar easing = helpers_easing;\r\nvar canvas = helpers_canvas;\r\nvar options = helpers_options;\r\nvar math = helpers_math;\r\nvar rtl = helpers_rtl;\nhelpers$1.easing = easing;\nhelpers$1.canvas = canvas;\nhelpers$1.options = options;\nhelpers$1.math = math;\nhelpers$1.rtl = rtl;\n\nfunction interpolate(start, view, model, ease) {\r\n\tvar keys = Object.keys(model);\r\n\tvar i, ilen, key, actual, origin, target, type, c0, c1;\r\n\r\n\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\tkey = keys[i];\r\n\r\n\t\ttarget = model[key];\r\n\r\n\t\t// if a value is added to the model after pivot() has been called, the view\r\n\t\t// doesn't contain it, so let's initialize the view to the target value.\r\n\t\tif (!view.hasOwnProperty(key)) {\r\n\t\t\tview[key] = target;\r\n\t\t}\r\n\r\n\t\tactual = view[key];\r\n\r\n\t\tif (actual === target || key[0] === '_') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!start.hasOwnProperty(key)) {\r\n\t\t\tstart[key] = actual;\r\n\t\t}\r\n\r\n\t\torigin = start[key];\r\n\r\n\t\ttype = typeof target;\r\n\r\n\t\tif (type === typeof origin) {\r\n\t\t\tif (type === 'string') {\r\n\t\t\t\tc0 = chartjsColor(origin);\r\n\t\t\t\tif (c0.valid) {\r\n\t\t\t\t\tc1 = chartjsColor(target);\r\n\t\t\t\t\tif (c1.valid) {\r\n\t\t\t\t\t\tview[key] = c1.mix(c0, ease).rgbString();\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) {\r\n\t\t\t\tview[key] = origin + (target - origin) * ease;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tview[key] = target;\r\n\t}\r\n}\r\n\r\nvar Element = function(configuration) {\r\n\thelpers$1.extend(this, configuration);\r\n\tthis.initialize.apply(this, arguments);\r\n};\r\n\r\nhelpers$1.extend(Element.prototype, {\r\n\t_type: undefined,\r\n\r\n\tinitialize: function() {\r\n\t\tthis.hidden = false;\r\n\t},\r\n\r\n\tpivot: function() {\r\n\t\tvar me = this;\r\n\t\tif (!me._view) {\r\n\t\t\tme._view = helpers$1.extend({}, me._model);\r\n\t\t}\r\n\t\tme._start = {};\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttransition: function(ease) {\r\n\t\tvar me = this;\r\n\t\tvar model = me._model;\r\n\t\tvar start = me._start;\r\n\t\tvar view = me._view;\r\n\r\n\t\t// No animation -> No Transition\r\n\t\tif (!model || ease === 1) {\r\n\t\t\tme._view = helpers$1.extend({}, model);\r\n\t\t\tme._start = null;\r\n\t\t\treturn me;\r\n\t\t}\r\n\r\n\t\tif (!view) {\r\n\t\t\tview = me._view = {};\r\n\t\t}\r\n\r\n\t\tif (!start) {\r\n\t\t\tstart = me._start = {};\r\n\t\t}\r\n\r\n\t\tinterpolate(start, view, model, ease);\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\treturn {\r\n\t\t\tx: this._model.x,\r\n\t\t\ty: this._model.y\r\n\t\t};\r\n\t},\r\n\r\n\thasValue: function() {\r\n\t\treturn helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y);\r\n\t}\r\n});\r\n\r\nElement.extend = helpers$1.inherits;\r\n\r\nvar core_element = Element;\n\nvar exports$3 = core_element.extend({\r\n\tchart: null, // the animation associated chart instance\r\n\tcurrentStep: 0, // the current animation step\r\n\tnumSteps: 60, // default number of steps\r\n\teasing: '', // the easing to use for this animation\r\n\trender: null, // render function used by the animation service\r\n\r\n\tonAnimationProgress: null, // user specified callback to fire on each step of the animation\r\n\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\r\n});\r\n\r\nvar core_animation = exports$3;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation instead\r\n * @prop Chart.Animation#animationObject\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'animationObject', {\r\n\tget: function() {\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation#chart instead\r\n * @prop Chart.Animation#chartInstance\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'chartInstance', {\r\n\tget: function() {\r\n\t\treturn this.chart;\r\n\t},\r\n\tset: function(value) {\r\n\t\tthis.chart = value;\r\n\t}\r\n});\n\ncore_defaults._set('global', {\r\n\tanimation: {\r\n\t\tduration: 1000,\r\n\t\teasing: 'easeOutQuart',\r\n\t\tonProgress: helpers$1.noop,\r\n\t\tonComplete: helpers$1.noop\r\n\t}\r\n});\r\n\r\nvar core_animations = {\r\n\tanimations: [],\r\n\trequest: null,\r\n\r\n\t/**\r\n\t * @param {Chart} chart - The chart to animate.\r\n\t * @param {Chart.Animation} animation - The animation that we will animate.\r\n\t * @param {number} duration - The animation duration in ms.\r\n\t * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\r\n\t */\r\n\taddAnimation: function(chart, animation, duration, lazy) {\r\n\t\tvar animations = this.animations;\r\n\t\tvar i, ilen;\r\n\r\n\t\tanimation.chart = chart;\r\n\t\tanimation.startTime = Date.now();\r\n\t\tanimation.duration = duration;\r\n\r\n\t\tif (!lazy) {\r\n\t\t\tchart.animating = true;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = animations.length; i < ilen; ++i) {\r\n\t\t\tif (animations[i].chart === chart) {\r\n\t\t\t\tanimations[i] = animation;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tanimations.push(animation);\r\n\r\n\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\r\n\t\tif (animations.length === 1) {\r\n\t\t\tthis.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\tcancelAnimation: function(chart) {\r\n\t\tvar index = helpers$1.findIndex(this.animations, function(animation) {\r\n\t\t\treturn animation.chart === chart;\r\n\t\t});\r\n\r\n\t\tif (index !== -1) {\r\n\t\t\tthis.animations.splice(index, 1);\r\n\t\t\tchart.animating = false;\r\n\t\t}\r\n\t},\r\n\r\n\trequestAnimationFrame: function() {\r\n\t\tvar me = this;\r\n\t\tif (me.request === null) {\r\n\t\t\t// Skip animation frame requests until the active one is executed.\r\n\t\t\t// This can happen when processing mouse events, e.g. 'mousemove'\r\n\t\t\t// and 'mouseout' events will trigger multiple renders.\r\n\t\t\tme.request = helpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tme.request = null;\r\n\t\t\t\tme.startDigest();\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tstartDigest: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tme.advance();\r\n\r\n\t\t// Do we have more stuff to animate?\r\n\t\tif (me.animations.length > 0) {\r\n\t\t\tme.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tadvance: function() {\r\n\t\tvar animations = this.animations;\r\n\t\tvar animation, chart, numSteps, nextStep;\r\n\t\tvar i = 0;\r\n\r\n\t\t// 1 animation per chart, so we are looping charts here\r\n\t\twhile (i < animations.length) {\r\n\t\t\tanimation = animations[i];\r\n\t\t\tchart = animation.chart;\r\n\t\t\tnumSteps = animation.numSteps;\r\n\r\n\t\t\t// Make sure that currentStep starts at 1\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/6104\r\n\t\t\tnextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1;\r\n\t\t\tanimation.currentStep = Math.min(nextStep, numSteps);\r\n\r\n\t\t\thelpers$1.callback(animation.render, [chart, animation], chart);\r\n\t\t\thelpers$1.callback(animation.onAnimationProgress, [animation], chart);\r\n\r\n\t\t\tif (animation.currentStep >= numSteps) {\r\n\t\t\t\thelpers$1.callback(animation.onAnimationComplete, [animation], chart);\r\n\t\t\t\tchart.animating = false;\r\n\t\t\t\tanimations.splice(i, 1);\r\n\t\t\t} else {\r\n\t\t\t\t++i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\n\nvar resolve = helpers$1.options.resolve;\r\n\r\nvar arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\r\n\r\n/**\r\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\r\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\r\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\r\n */\r\nfunction listenArrayEvents(array, listener) {\r\n\tif (array._chartjs) {\r\n\t\tarray._chartjs.listeners.push(listener);\r\n\t\treturn;\r\n\t}\r\n\r\n\tObject.defineProperty(array, '_chartjs', {\r\n\t\tconfigurable: true,\r\n\t\tenumerable: false,\r\n\t\tvalue: {\r\n\t\t\tlisteners: [listener]\r\n\t\t}\r\n\t});\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\r\n\t\tvar base = array[key];\r\n\r\n\t\tObject.defineProperty(array, key, {\r\n\t\t\tconfigurable: true,\r\n\t\t\tenumerable: false,\r\n\t\t\tvalue: function() {\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\t\t\tvar res = base.apply(this, args);\r\n\r\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\r\n\t\t\t\t\tif (typeof object[method] === 'function') {\r\n\t\t\t\t\t\tobject[method].apply(object, args);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}\r\n\r\n/**\r\n * Removes the given array event listener and cleanup extra attached properties (such as\r\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\r\n */\r\nfunction unlistenArrayEvents(array, listener) {\r\n\tvar stub = array._chartjs;\r\n\tif (!stub) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar listeners = stub.listeners;\r\n\tvar index = listeners.indexOf(listener);\r\n\tif (index !== -1) {\r\n\t\tlisteners.splice(index, 1);\r\n\t}\r\n\r\n\tif (listeners.length > 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tdelete array[key];\r\n\t});\r\n\r\n\tdelete array._chartjs;\r\n}\r\n\r\n// Base class for all dataset controllers (line, bar, etc)\r\nvar DatasetController = function(chart, datasetIndex) {\r\n\tthis.initialize(chart, datasetIndex);\r\n};\r\n\r\nhelpers$1.extend(DatasetController.prototype, {\r\n\r\n\t/**\r\n\t * Element type used to generate a meta dataset (e.g. Chart.element.Line).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdatasetElementType: null,\r\n\r\n\t/**\r\n\t * Element type used to generate a meta data (e.g. Chart.element.Point).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdataElementType: null,\r\n\r\n\t/**\r\n\t * Dataset element option keys to be resolved in _resolveDatasetElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth'\r\n\t],\r\n\r\n\t/**\r\n\t * Data element option keys to be resolved in _resolveDataElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'pointStyle'\r\n\t],\r\n\r\n\tinitialize: function(chart, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tme.chart = chart;\r\n\t\tme.index = datasetIndex;\r\n\t\tme.linkScales();\r\n\t\tme.addElements();\r\n\t\tme._type = me.getMeta().type;\r\n\t},\r\n\r\n\tupdateIndex: function(datasetIndex) {\r\n\t\tthis.index = datasetIndex;\r\n\t},\r\n\r\n\tlinkScales: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar chart = me.chart;\r\n\t\tvar scales = chart.scales;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scalesOpts = chart.options.scales;\r\n\r\n\t\tif (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) {\r\n\t\t\tmeta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id;\r\n\t\t}\r\n\t\tif (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) {\r\n\t\t\tmeta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id;\r\n\t\t}\r\n\t},\r\n\r\n\tgetDataset: function() {\r\n\t\treturn this.chart.data.datasets[this.index];\r\n\t},\r\n\r\n\tgetMeta: function() {\r\n\t\treturn this.chart.getDatasetMeta(this.index);\r\n\t},\r\n\r\n\tgetScaleForId: function(scaleID) {\r\n\t\treturn this.chart.scales[scaleID];\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScale: function() {\r\n\t\treturn this.getScaleForId(this._getValueScaleId());\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScale: function() {\r\n\t\treturn this.getScaleForId(this._getIndexScaleId());\r\n\t},\r\n\r\n\treset: function() {\r\n\t\tthis._update(true);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tdestroy: function() {\r\n\t\tif (this._data) {\r\n\t\t\tunlistenArrayEvents(this._data, this);\r\n\t\t}\r\n\t},\r\n\r\n\tcreateMetaDataset: function() {\r\n\t\tvar me = this;\r\n\t\tvar type = me.datasetElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index\r\n\t\t});\r\n\t},\r\n\r\n\tcreateMetaData: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar type = me.dataElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index\r\n\t\t});\r\n\t},\r\n\r\n\taddElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data || [];\r\n\t\tvar metaData = meta.data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = data.length; i < ilen; ++i) {\r\n\t\t\tmetaData[i] = metaData[i] || me.createMetaData(i);\r\n\t\t}\r\n\r\n\t\tmeta.dataset = meta.dataset || me.createMetaDataset();\r\n\t},\r\n\r\n\taddElementAndReset: function(index) {\r\n\t\tvar element = this.createMetaData(index);\r\n\t\tthis.getMeta().data.splice(index, 0, element);\r\n\t\tthis.updateElement(element, index, true);\r\n\t},\r\n\r\n\tbuildOrUpdateElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar data = dataset.data || (dataset.data = []);\r\n\r\n\t\t// In order to correctly handle data addition/deletion animation (an thus simulate\r\n\t\t// real-time charts), we need to monitor these data modifications and synchronize\r\n\t\t// the internal meta data accordingly.\r\n\t\tif (me._data !== data) {\r\n\t\t\tif (me._data) {\r\n\t\t\t\t// This case happens when the user replaced the data array instance.\r\n\t\t\t\tunlistenArrayEvents(me._data, me);\r\n\t\t\t}\r\n\r\n\t\t\tif (data && Object.isExtensible(data)) {\r\n\t\t\t\tlistenArrayEvents(data, me);\r\n\t\t\t}\r\n\t\t\tme._data = data;\r\n\t\t}\r\n\r\n\t\t// Re-sync meta data in case the user replaced the data array or if we missed\r\n\t\t// any updates and so make sure that we handle number of datapoints changing.\r\n\t\tme.resyncElements();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the merged user-supplied and default dataset-level options\r\n\t * @private\r\n\t */\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tme._config = helpers$1.merge(Object.create(null), [\r\n\t\t\tme.chart.options.datasets[me._type],\r\n\t\t\tme.getDataset(),\r\n\t\t], {\r\n\t\t\tmerger: function(key, target, source) {\r\n\t\t\t\tif (key !== '_meta' && key !== 'data') {\r\n\t\t\t\t\thelpers$1._merger(key, target, source);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_update: function(reset) {\r\n\t\tvar me = this;\r\n\t\tme._configure();\r\n\t\tme._cachedDataOpts = null;\r\n\t\tme.update(reset);\r\n\t},\r\n\r\n\tupdate: helpers$1.noop,\r\n\r\n\ttransition: function(easingValue) {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].transition(easingValue);\r\n\t\t}\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.transition(easingValue);\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.draw();\r\n\t\t}\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].draw();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a set of predefined style properties that should be used to represent the dataset\r\n\t * or the data if the index is specified\r\n\t * @param {number} index - data index\r\n\t * @return {IStyleInterface} style object\r\n\t */\r\n\tgetStyle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = meta.dataset;\r\n\t\tvar style;\r\n\r\n\t\tme._configure();\r\n\t\tif (dataset && index === undefined) {\r\n\t\t\tstyle = me._resolveDatasetElementOptions(dataset || {});\r\n\t\t} else {\r\n\t\t\tindex = index || 0;\r\n\t\t\tstyle = me._resolveDataElementOptions(meta.data[index] || {}, index);\r\n\t\t}\r\n\r\n\t\tif (style.fill === false || style.fill === null) {\r\n\t\t\tstyle.backgroundColor = style.borderColor;\r\n\t\t}\r\n\r\n\t\treturn style;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element, hover) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = chart.options.elements[me.datasetElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._datasetElementOptions;\r\n\t\tvar values = {};\r\n\t\tvar i, ilen, key, readKey;\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index,\r\n\t\t\thover: hover\r\n\t\t};\r\n\r\n\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\tkey = elementOptions[i];\r\n\t\t\treadKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;\r\n\t\t\tvalues[key] = resolve([\r\n\t\t\t\tcustom[readKey],\r\n\t\t\t\tdatasetOpts[readKey],\r\n\t\t\t\toptions[readKey]\r\n\t\t\t], context);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(element, index) {\r\n\t\tvar me = this;\r\n\t\tvar custom = element && element.custom;\r\n\t\tvar cached = me._cachedDataOpts;\r\n\t\tif (cached && !custom) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar options = chart.options.elements[me.dataElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._dataElementOptions;\r\n\t\tvar values = {};\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// `resolve` sets cacheable to `false` if any option is indexed or scripted\r\n\t\tvar info = {cacheable: !custom};\r\n\r\n\t\tvar keys, i, ilen, key;\r\n\r\n\t\tcustom = custom || {};\r\n\r\n\t\tif (helpers$1.isArray(elementOptions)) {\r\n\t\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\t\tkey = elementOptions[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tkeys = Object.keys(elementOptions);\r\n\t\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\t\tkey = keys[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[elementOptions[key]],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (info.cacheable) {\r\n\t\t\tme._cachedDataOpts = Object.freeze(values);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tremoveHoverStyle: function(element) {\r\n\t\thelpers$1.merge(element._model, element.$previousStyle || {});\r\n\t\tdelete element.$previousStyle;\r\n\t},\r\n\r\n\tsetHoverStyle: function(element) {\r\n\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\r\n\t\tvar index = element._index;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar model = element._model;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\telement.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index);\r\n\t\tmodel.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index);\r\n\t\tmodel.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_removeDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\r\n\t\tif (element) {\r\n\t\t\tthis.removeHoverStyle(element);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_setDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\t\tvar prev = {};\r\n\t\tvar i, ilen, key, keys, hoverOptions, model;\r\n\r\n\t\tif (!element) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodel = element._model;\r\n\t\thoverOptions = this._resolveDatasetElementOptions(element, true);\r\n\r\n\t\tkeys = Object.keys(hoverOptions);\r\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\tkey = keys[i];\r\n\t\t\tprev[key] = model[key];\r\n\t\t\tmodel[key] = hoverOptions[key];\r\n\t\t}\r\n\r\n\t\telement.$previousStyle = prev;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tresyncElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data;\r\n\t\tvar numMeta = meta.data.length;\r\n\t\tvar numData = data.length;\r\n\r\n\t\tif (numData < numMeta) {\r\n\t\t\tmeta.data.splice(numData, numMeta - numData);\r\n\t\t} else if (numData > numMeta) {\r\n\t\t\tme.insertElements(numMeta, numData - numMeta);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tinsertElements: function(start, count) {\r\n\t\tfor (var i = 0; i < count; ++i) {\r\n\t\t\tthis.addElementAndReset(start + i);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPush: function() {\r\n\t\tvar count = arguments.length;\r\n\t\tthis.insertElements(this.getDataset().data.length - count, count);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPop: function() {\r\n\t\tthis.getMeta().data.pop();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataShift: function() {\r\n\t\tthis.getMeta().data.shift();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataSplice: function(start, count) {\r\n\t\tthis.getMeta().data.splice(start, count);\r\n\t\tthis.insertElements(start, arguments.length - 2);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataUnshift: function() {\r\n\t\tthis.insertElements(0, arguments.length);\r\n\t}\r\n});\r\n\r\nDatasetController.extend = helpers$1.inherits;\r\n\r\nvar core_datasetController = DatasetController;\n\nvar TAU = Math.PI * 2;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tarc: {\r\n\t\t\tbackgroundColor: core_defaults.global.defaultColor,\r\n\t\t\tborderColor: '#fff',\r\n\t\t\tborderWidth: 2,\r\n\t\t\tborderAlign: 'center'\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction clipArc(ctx, arc) {\r\n\tvar startAngle = arc.startAngle;\r\n\tvar endAngle = arc.endAngle;\r\n\tvar pixelMargin = arc.pixelMargin;\r\n\tvar angleMargin = pixelMargin / arc.outerRadius;\r\n\tvar x = arc.x;\r\n\tvar y = arc.y;\r\n\r\n\t// Draw an inner border by cliping the arc and drawing a double-width border\r\n\t// Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\r\n\tctx.beginPath();\r\n\tctx.arc(x, y, arc.outerRadius, startAngle - angleMargin, endAngle + angleMargin);\r\n\tif (arc.innerRadius > pixelMargin) {\r\n\t\tangleMargin = pixelMargin / arc.innerRadius;\r\n\t\tctx.arc(x, y, arc.innerRadius - pixelMargin, endAngle + angleMargin, startAngle - angleMargin, true);\r\n\t} else {\r\n\t\tctx.arc(x, y, pixelMargin, endAngle + Math.PI / 2, startAngle - Math.PI / 2);\r\n\t}\r\n\tctx.closePath();\r\n\tctx.clip();\r\n}\r\n\r\nfunction drawFullCircleBorders(ctx, vm, arc, inner) {\r\n\tvar endAngle = arc.endAngle;\r\n\tvar i;\r\n\r\n\tif (inner) {\r\n\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\tclipArc(ctx, arc);\r\n\t\tarc.endAngle = endAngle;\r\n\t\tif (arc.endAngle === arc.startAngle && arc.fullCircles) {\r\n\t\t\tarc.endAngle += TAU;\r\n\t\t\tarc.fullCircles--;\r\n\t\t}\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.startAngle + TAU, arc.startAngle, true);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.startAngle + TAU);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n}\r\n\r\nfunction drawBorder(ctx, vm, arc) {\r\n\tvar inner = vm.borderAlign === 'inner';\r\n\r\n\tif (inner) {\r\n\t\tctx.lineWidth = vm.borderWidth * 2;\r\n\t\tctx.lineJoin = 'round';\r\n\t} else {\r\n\t\tctx.lineWidth = vm.borderWidth;\r\n\t\tctx.lineJoin = 'bevel';\r\n\t}\r\n\r\n\tif (arc.fullCircles) {\r\n\t\tdrawFullCircleBorders(ctx, vm, arc, inner);\r\n\t}\r\n\r\n\tif (inner) {\r\n\t\tclipArc(ctx, arc);\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.endAngle);\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\tctx.closePath();\r\n\tctx.stroke();\r\n}\r\n\r\nvar element_arc = core_element.extend({\r\n\t_type: 'arc',\r\n\r\n\tinLabelRange: function(mouseX) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\treturn (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tinRange: function(chartX, chartY) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\tvar pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY});\r\n\t\t\tvar angle = pointRelativePosition.angle;\r\n\t\t\tvar distance = pointRelativePosition.distance;\r\n\r\n\t\t\t// Sanitise angle range\r\n\t\t\tvar startAngle = vm.startAngle;\r\n\t\t\tvar endAngle = vm.endAngle;\r\n\t\t\twhile (endAngle < startAngle) {\r\n\t\t\t\tendAngle += TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle > endAngle) {\r\n\t\t\t\tangle -= TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle < startAngle) {\r\n\t\t\t\tangle += TAU;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if within the range of the open/close angle\r\n\t\t\tvar betweenAngles = (angle >= startAngle && angle <= endAngle);\r\n\t\t\tvar withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\r\n\r\n\t\t\treturn (betweenAngles && withinRadius);\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar halfAngle = (vm.startAngle + vm.endAngle) / 2;\r\n\t\tvar halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\r\n\t\treturn {\r\n\t\t\tx: vm.x + Math.cos(halfAngle) * halfRadius,\r\n\t\t\ty: vm.y + Math.sin(halfAngle) * halfRadius\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\r\n\t\tvar rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\r\n\r\n\t\treturn {\r\n\t\t\tx: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\r\n\t\t\ty: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;\r\n\t\tvar arc = {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tinnerRadius: vm.innerRadius,\r\n\t\t\touterRadius: Math.max(vm.outerRadius - pixelMargin, 0),\r\n\t\t\tpixelMargin: pixelMargin,\r\n\t\t\tstartAngle: vm.startAngle,\r\n\t\t\tendAngle: vm.endAngle,\r\n\t\t\tfullCircles: Math.floor(vm.circumference / TAU)\r\n\t\t};\r\n\t\tvar i;\r\n\r\n\t\tctx.save();\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.strokeStyle = vm.borderColor;\r\n\r\n\t\tif (arc.fullCircles) {\r\n\t\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\t\tctx.closePath();\r\n\t\t\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\t\t\tctx.fill();\r\n\t\t\t}\r\n\t\t\tarc.endAngle = arc.startAngle + vm.circumference % TAU;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\tctx.closePath();\r\n\t\tctx.fill();\r\n\r\n\t\tif (vm.borderWidth) {\r\n\t\t\tdrawBorder(ctx, vm, arc);\r\n\t\t}\r\n\r\n\t\tctx.restore();\r\n\t}\r\n});\n\nvar valueOrDefault$1 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tline: {\r\n\t\t\ttension: 0.4,\r\n\t\t\tbackgroundColor: defaultColor,\r\n\t\t\tborderWidth: 3,\r\n\t\t\tborderColor: defaultColor,\r\n\t\t\tborderCapStyle: 'butt',\r\n\t\t\tborderDash: [],\r\n\t\t\tborderDashOffset: 0.0,\r\n\t\t\tborderJoinStyle: 'miter',\r\n\t\t\tcapBezierPoints: true,\r\n\t\t\tfill: true, // do we fill in the area between the line and its base axis\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar element_line = core_element.extend({\r\n\t_type: 'line',\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar vm = me._view;\r\n\t\tvar ctx = me._chart.ctx;\r\n\t\tvar spanGaps = vm.spanGaps;\r\n\t\tvar points = me._children.slice(); // clone array\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar globalOptionLineElements = globalDefaults.elements.line;\r\n\t\tvar lastDrawnIndex = -1;\r\n\t\tvar closePath = me._loop;\r\n\t\tvar index, previous, currentVM;\r\n\r\n\t\tif (!points.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (me._loop) {\r\n\t\t\tfor (index = 0; index < points.length; ++index) {\r\n\t\t\t\tprevious = helpers$1.previousItem(points, index);\r\n\t\t\t\t// If the line has an open path, shift the point array\r\n\t\t\t\tif (!points[index]._view.skip && previous._view.skip) {\r\n\t\t\t\t\tpoints = points.slice(index).concat(points.slice(0, index));\r\n\t\t\t\t\tclosePath = spanGaps;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// If the line has a close path, add the first point again\r\n\t\t\tif (closePath) {\r\n\t\t\t\tpoints.push(points[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\r\n\t\t// Stroke Line Options\r\n\t\tctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\r\n\r\n\t\t// IE 9 and 10 do not support line dash\r\n\t\tif (ctx.setLineDash) {\r\n\t\t\tctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\r\n\t\t}\r\n\r\n\t\tctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset);\r\n\t\tctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\r\n\t\tctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth);\r\n\t\tctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\r\n\r\n\t\t// Stroke Line\r\n\t\tctx.beginPath();\r\n\r\n\t\t// First point moves to it's starting position no matter what\r\n\t\tcurrentVM = points[0]._view;\r\n\t\tif (!currentVM.skip) {\r\n\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\tlastDrawnIndex = 0;\r\n\t\t}\r\n\r\n\t\tfor (index = 1; index < points.length; ++index) {\r\n\t\t\tcurrentVM = points[index]._view;\r\n\t\t\tprevious = lastDrawnIndex === -1 ? helpers$1.previousItem(points, index) : points[lastDrawnIndex];\r\n\r\n\t\t\tif (!currentVM.skip) {\r\n\t\t\t\tif ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\r\n\t\t\t\t\t// There was a gap and this is the first point after the gap\r\n\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Line to next point\r\n\t\t\t\t\thelpers$1.canvas.lineTo(ctx, previous._view, currentVM);\r\n\t\t\t\t}\r\n\t\t\t\tlastDrawnIndex = index;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (closePath) {\r\n\t\t\tctx.closePath();\r\n\t\t}\r\n\r\n\t\tctx.stroke();\r\n\t\tctx.restore();\r\n\t}\r\n});\n\nvar valueOrDefault$2 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor$1 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tpoint: {\r\n\t\t\tradius: 3,\r\n\t\t\tpointStyle: 'circle',\r\n\t\t\tbackgroundColor: defaultColor$1,\r\n\t\t\tborderColor: defaultColor$1,\r\n\t\t\tborderWidth: 1,\r\n\t\t\t// Hover\r\n\t\t\thitRadius: 1,\r\n\t\t\thoverRadius: 4,\r\n\t\t\thoverBorderWidth: 1\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction xRange(mouseX) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nfunction yRange(mouseY) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nvar element_point = core_element.extend({\r\n\t_type: 'point',\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\r\n\t},\r\n\r\n\tinLabelRange: xRange,\r\n\tinXRange: xRange,\r\n\tinYRange: yRange,\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\treturn Math.PI * Math.pow(this._view.radius, 2);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tpadding: vm.radius + vm.borderWidth\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function(chartArea) {\r\n\t\tvar vm = this._view;\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar pointStyle = vm.pointStyle;\r\n\t\tvar rotation = vm.rotation;\r\n\t\tvar radius = vm.radius;\r\n\t\tvar x = vm.x;\r\n\t\tvar y = vm.y;\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow\r\n\r\n\t\tif (vm.skip) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Clipping for Points.\r\n\t\tif (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) {\r\n\t\t\tctx.strokeStyle = vm.borderColor || defaultColor;\r\n\t\t\tctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth);\r\n\t\t\tctx.fillStyle = vm.backgroundColor || defaultColor;\r\n\t\t\thelpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation);\r\n\t\t}\r\n\t}\r\n});\n\nvar defaultColor$2 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tbackgroundColor: defaultColor$2,\r\n\t\t\tborderColor: defaultColor$2,\r\n\t\t\tborderSkipped: 'bottom',\r\n\t\t\tborderWidth: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction isVertical(vm) {\r\n\treturn vm && vm.width !== undefined;\r\n}\r\n\r\n/**\r\n * Helper function to get the bounds of the bar regardless of the orientation\r\n * @param bar {Chart.Element.Rectangle} the bar\r\n * @return {Bounds} bounds of the bar\r\n * @private\r\n */\r\nfunction getBarBounds(vm) {\r\n\tvar x1, x2, y1, y2, half;\r\n\r\n\tif (isVertical(vm)) {\r\n\t\thalf = vm.width / 2;\r\n\t\tx1 = vm.x - half;\r\n\t\tx2 = vm.x + half;\r\n\t\ty1 = Math.min(vm.y, vm.base);\r\n\t\ty2 = Math.max(vm.y, vm.base);\r\n\t} else {\r\n\t\thalf = vm.height / 2;\r\n\t\tx1 = Math.min(vm.x, vm.base);\r\n\t\tx2 = Math.max(vm.x, vm.base);\r\n\t\ty1 = vm.y - half;\r\n\t\ty2 = vm.y + half;\r\n\t}\r\n\r\n\treturn {\r\n\t\tleft: x1,\r\n\t\ttop: y1,\r\n\t\tright: x2,\r\n\t\tbottom: y2\r\n\t};\r\n}\r\n\r\nfunction swap(orig, v1, v2) {\r\n\treturn orig === v1 ? v2 : orig === v2 ? v1 : orig;\r\n}\r\n\r\nfunction parseBorderSkipped(vm) {\r\n\tvar edge = vm.borderSkipped;\r\n\tvar res = {};\r\n\r\n\tif (!edge) {\r\n\t\treturn res;\r\n\t}\r\n\r\n\tif (vm.horizontal) {\r\n\t\tif (vm.base > vm.x) {\r\n\t\t\tedge = swap(edge, 'left', 'right');\r\n\t\t}\r\n\t} else if (vm.base < vm.y) {\r\n\t\tedge = swap(edge, 'bottom', 'top');\r\n\t}\r\n\r\n\tres[edge] = true;\r\n\treturn res;\r\n}\r\n\r\nfunction parseBorderWidth(vm, maxW, maxH) {\r\n\tvar value = vm.borderWidth;\r\n\tvar skip = parseBorderSkipped(vm);\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = +value.top || 0;\r\n\t\tr = +value.right || 0;\r\n\t\tb = +value.bottom || 0;\r\n\t\tl = +value.left || 0;\r\n\t} else {\r\n\t\tt = r = b = l = +value || 0;\r\n\t}\r\n\r\n\treturn {\r\n\t\tt: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t,\r\n\t\tr: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r,\r\n\t\tb: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b,\r\n\t\tl: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l\r\n\t};\r\n}\r\n\r\nfunction boundingRects(vm) {\r\n\tvar bounds = getBarBounds(vm);\r\n\tvar width = bounds.right - bounds.left;\r\n\tvar height = bounds.bottom - bounds.top;\r\n\tvar border = parseBorderWidth(vm, width / 2, height / 2);\r\n\r\n\treturn {\r\n\t\touter: {\r\n\t\t\tx: bounds.left,\r\n\t\t\ty: bounds.top,\r\n\t\t\tw: width,\r\n\t\t\th: height\r\n\t\t},\r\n\t\tinner: {\r\n\t\t\tx: bounds.left + border.l,\r\n\t\t\ty: bounds.top + border.t,\r\n\t\t\tw: width - border.l - border.r,\r\n\t\t\th: height - border.t - border.b\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction inRange(vm, x, y) {\r\n\tvar skipX = x === null;\r\n\tvar skipY = y === null;\r\n\tvar bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm);\r\n\r\n\treturn bounds\r\n\t\t&& (skipX || x >= bounds.left && x <= bounds.right)\r\n\t\t&& (skipY || y >= bounds.top && y <= bounds.bottom);\r\n}\r\n\r\nvar element_rectangle = core_element.extend({\r\n\t_type: 'rectangle',\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar rects = boundingRects(vm);\r\n\t\tvar outer = rects.outer;\r\n\t\tvar inner = rects.inner;\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.fillRect(outer.x, outer.y, outer.w, outer.h);\r\n\r\n\t\tif (outer.w === inner.w && outer.h === inner.h) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(outer.x, outer.y, outer.w, outer.h);\r\n\t\tctx.clip();\r\n\t\tctx.fillStyle = vm.borderColor;\r\n\t\tctx.rect(inner.x, inner.y, inner.w, inner.h);\r\n\t\tctx.fill('evenodd');\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\theight: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm.base - vm.y;\r\n\t},\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\treturn inRange(this._view, mouseX, mouseY);\r\n\t},\r\n\r\n\tinLabelRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn isVertical(vm)\r\n\t\t\t? inRange(vm, mouseX, null)\r\n\t\t\t: inRange(vm, null, mouseY);\r\n\t},\r\n\r\n\tinXRange: function(mouseX) {\r\n\t\treturn inRange(this._view, mouseX, null);\r\n\t},\r\n\r\n\tinYRange: function(mouseY) {\r\n\t\treturn inRange(this._view, null, mouseY);\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar x, y;\r\n\t\tif (isVertical(vm)) {\r\n\t\t\tx = vm.x;\r\n\t\t\ty = (vm.y + vm.base) / 2;\r\n\t\t} else {\r\n\t\t\tx = (vm.x + vm.base) / 2;\r\n\t\t\ty = vm.y;\r\n\t\t}\r\n\r\n\t\treturn {x: x, y: y};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\r\n\t\treturn isVertical(vm)\r\n\t\t\t? vm.width * Math.abs(vm.y - vm.base)\r\n\t\t\t: vm.height * Math.abs(vm.x - vm.base);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t}\r\n});\n\nvar elements = {};\r\nvar Arc = element_arc;\r\nvar Line = element_line;\r\nvar Point = element_point;\r\nvar Rectangle = element_rectangle;\nelements.Arc = Arc;\nelements.Line = Line;\nelements.Point = Point;\nelements.Rectangle = Rectangle;\n\nvar deprecated = helpers$1._deprecated;\r\nvar valueOrDefault$3 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('bar', {\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tbar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\r\n * @private\r\n */\r\nfunction computeMinSampleSize(scale, pixels) {\r\n\tvar min = scale._length;\r\n\tvar prev, curr, i, ilen;\r\n\r\n\tfor (i = 1, ilen = pixels.length; i < ilen; ++i) {\r\n\t\tmin = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));\r\n\t}\r\n\r\n\tfor (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) {\r\n\t\tcurr = scale.getPixelForTick(i);\r\n\t\tmin = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min;\r\n\t\tprev = curr;\r\n\t}\r\n\r\n\treturn min;\r\n}\r\n\r\n/**\r\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\r\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\r\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\r\n * @private\r\n */\r\nfunction computeFitCategoryTraits(index, ruler, options) {\r\n\tvar thickness = options.barThickness;\r\n\tvar count = ruler.stackCount;\r\n\tvar curr = ruler.pixels[index];\r\n\tvar min = helpers$1.isNullOrUndef(thickness)\r\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\r\n\t\t: -1;\r\n\tvar size, ratio;\r\n\r\n\tif (helpers$1.isNullOrUndef(thickness)) {\r\n\t\tsize = min * options.categoryPercentage;\r\n\t\tratio = options.barPercentage;\r\n\t} else {\r\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\r\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\r\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\r\n\t\tsize = thickness * count;\r\n\t\tratio = 1;\r\n\t}\r\n\r\n\treturn {\r\n\t\tchunk: size / count,\r\n\t\tratio: ratio,\r\n\t\tstart: curr - (size / 2)\r\n\t};\r\n}\r\n\r\n/**\r\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\r\n * percentage options are 1), based on the previous and following categories. This mode\r\n * generates bars with different widths when data are not evenly spaced.\r\n * @private\r\n */\r\nfunction computeFlexCategoryTraits(index, ruler, options) {\r\n\tvar pixels = ruler.pixels;\r\n\tvar curr = pixels[index];\r\n\tvar prev = index > 0 ? pixels[index - 1] : null;\r\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\r\n\tvar percent = options.categoryPercentage;\r\n\tvar start, size;\r\n\r\n\tif (prev === null) {\r\n\t\t// first data: its size is double based on the next point or,\r\n\t\t// if it's also the last data, we use the scale size.\r\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\r\n\t}\r\n\r\n\tif (next === null) {\r\n\t\t// last data: its size is also double based on the previous point.\r\n\t\tnext = curr + curr - prev;\r\n\t}\r\n\r\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\r\n\tsize = Math.abs(next - prev) / 2 * percent;\r\n\r\n\treturn {\r\n\t\tchunk: size / ruler.stackCount,\r\n\t\tratio: options.barPercentage,\r\n\t\tstart: start\r\n\t};\r\n}\r\n\r\nvar controller_bar = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Rectangle,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderSkipped',\r\n\t\t'borderWidth',\r\n\t\t'barPercentage',\r\n\t\t'barThickness',\r\n\t\t'categoryPercentage',\r\n\t\t'maxBarThickness',\r\n\t\t'minBarLength'\r\n\t],\r\n\r\n\tinitialize: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta, scaleOpts;\r\n\r\n\t\tcore_datasetController.prototype.initialize.apply(me, arguments);\r\n\r\n\t\tmeta = me.getMeta();\r\n\t\tmeta.stack = me.getDataset().stack;\r\n\t\tmeta.bar = true;\r\n\r\n\t\tscaleOpts = me._getIndexScale().options;\r\n\t\tdeprecated('bar chart', scaleOpts.barPercentage, 'scales.[x/y]Axes.barPercentage', 'dataset.barPercentage');\r\n\t\tdeprecated('bar chart', scaleOpts.barThickness, 'scales.[x/y]Axes.barThickness', 'dataset.barThickness');\r\n\t\tdeprecated('bar chart', scaleOpts.categoryPercentage, 'scales.[x/y]Axes.categoryPercentage', 'dataset.categoryPercentage');\r\n\t\tdeprecated('bar chart', me._getValueScale().options.minBarLength, 'scales.[x/y]Axes.minBarLength', 'dataset.minBarLength');\r\n\t\tdeprecated('bar chart', scaleOpts.maxBarThickness, 'scales.[x/y]Axes.maxBarThickness', 'dataset.maxBarThickness');\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._ruler = me.getRuler();\r\n\r\n\t\tfor (i = 0, ilen = rects.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(rects[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(rectangle, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar options = me._resolveDataElementOptions(rectangle, index);\r\n\r\n\t\trectangle._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\trectangle._yScale = me.getScaleForId(meta.yAxisID);\r\n\t\trectangle._datasetIndex = me.index;\r\n\t\trectangle._index = index;\r\n\t\trectangle._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderSkipped: options.borderSkipped,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\tdatasetLabel: dataset.label,\r\n\t\t\tlabel: me.chart.data.labels[index]\r\n\t\t};\r\n\r\n\t\tif (helpers$1.isArray(dataset.data[index])) {\r\n\t\t\trectangle._model.borderSkipped = null;\r\n\t\t}\r\n\r\n\t\tme._updateElementGeometry(rectangle, index, reset, options);\r\n\r\n\t\trectangle.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateElementGeometry: function(rectangle, index, reset, options) {\r\n\t\tvar me = this;\r\n\t\tvar model = rectangle._model;\r\n\t\tvar vscale = me._getValueScale();\r\n\t\tvar base = vscale.getBasePixel();\r\n\t\tvar horizontal = vscale.isHorizontal();\r\n\t\tvar ruler = me._ruler || me.getRuler();\r\n\t\tvar vpixels = me.calculateBarValuePixels(me.index, index, options);\r\n\t\tvar ipixels = me.calculateBarIndexPixels(me.index, index, ruler, options);\r\n\r\n\t\tmodel.horizontal = horizontal;\r\n\t\tmodel.base = reset ? base : vpixels.base;\r\n\t\tmodel.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\r\n\t\tmodel.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\r\n\t\tmodel.height = horizontal ? ipixels.size : undefined;\r\n\t\tmodel.width = horizontal ? undefined : ipixels.size;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stacks based on groups and bar visibility.\r\n\t * @param {number} [last] - The dataset index\r\n\t * @returns {string[]} The list of stack IDs\r\n\t * @private\r\n\t */\r\n\t_getStacks: function(last) {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar stacks = [];\r\n\t\tvar i, meta;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tmeta = metasets[i];\r\n\t\t\t// stacked | meta.stack\r\n\t\t\t// | found | not found | undefined\r\n\t\t\t// false | x | x | x\r\n\t\t\t// true | | x |\r\n\t\t\t// undefined | | x | x\r\n\t\t\tif (stacked === false || stacks.indexOf(meta.stack) === -1 ||\r\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\r\n\t\t\t\tstacks.push(meta.stack);\r\n\t\t\t}\r\n\t\t\tif (meta.index === last) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn stacks;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the effective number of stacks based on groups and bar visibility.\r\n\t * @private\r\n\t */\r\n\tgetStackCount: function() {\r\n\t\treturn this._getStacks().length;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\r\n\t * @param {number} [datasetIndex] - The dataset index\r\n\t * @param {string} [name] - The stack name to find\r\n\t * @returns {number} The stack index\r\n\t * @private\r\n\t */\r\n\tgetStackIndex: function(datasetIndex, name) {\r\n\t\tvar stacks = this._getStacks(datasetIndex);\r\n\t\tvar index = (name !== undefined)\r\n\t\t\t? stacks.indexOf(name)\r\n\t\t\t: -1; // indexOf returns -1 if element is not present\r\n\r\n\t\treturn (index === -1)\r\n\t\t\t? stacks.length - 1\r\n\t\t\t: index;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tgetRuler: function() {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar pixels = [];\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\r\n\t\t\tpixels.push(scale.getPixelForValue(null, i, me.index));\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tpixels: pixels,\r\n\t\t\tstart: scale._startPixel,\r\n\t\t\tend: scale._endPixel,\r\n\t\t\tstackCount: me.getStackCount(),\r\n\t\t\tscale: scale\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Note: pixel values are not clamped to the scale area.\r\n\t * @private\r\n\t */\r\n\tcalculateBarValuePixels: function(datasetIndex, index, options) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar isHorizontal = scale.isHorizontal();\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar value = scale._parseValue(datasets[datasetIndex].data[index]);\r\n\t\tvar minBarLength = options.minBarLength;\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar stack = me.getMeta().stack;\r\n\t\tvar start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max;\r\n\t\tvar length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar i, imeta, ivalue, base, head, size, stackLength;\r\n\r\n\t\tif (stacked || (stacked === undefined && stack !== undefined)) {\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\timeta = metasets[i];\r\n\r\n\t\t\t\tif (imeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (imeta.stack === stack) {\r\n\t\t\t\t\tstackLength = scale._parseValue(datasets[imeta.index].data[index]);\r\n\t\t\t\t\tivalue = stackLength.start === undefined ? stackLength.end : stackLength.min >= 0 && stackLength.max >= 0 ? stackLength.max : stackLength.min;\r\n\r\n\t\t\t\t\tif ((value.min < 0 && ivalue < 0) || (value.max >= 0 && ivalue > 0)) {\r\n\t\t\t\t\t\tstart += ivalue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbase = scale.getPixelForValue(start);\r\n\t\thead = scale.getPixelForValue(start + length);\r\n\t\tsize = head - base;\r\n\r\n\t\tif (minBarLength !== undefined && Math.abs(size) < minBarLength) {\r\n\t\t\tsize = minBarLength;\r\n\t\t\tif (length >= 0 && !isHorizontal || length < 0 && isHorizontal) {\r\n\t\t\t\thead = base - minBarLength;\r\n\t\t\t} else {\r\n\t\t\t\thead = base + minBarLength;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tsize: size,\r\n\t\t\tbase: base,\r\n\t\t\thead: head,\r\n\t\t\tcenter: head + size / 2\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tcalculateBarIndexPixels: function(datasetIndex, index, ruler, options) {\r\n\t\tvar me = this;\r\n\t\tvar range = options.barThickness === 'flex'\r\n\t\t\t? computeFlexCategoryTraits(index, ruler, options)\r\n\t\t\t: computeFitCategoryTraits(index, ruler, options);\r\n\r\n\t\tvar stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);\r\n\t\tvar center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\r\n\t\tvar size = Math.min(\r\n\t\t\tvalueOrDefault$3(options.maxBarThickness, Infinity),\r\n\t\t\trange.chunk * range.ratio);\r\n\r\n\t\treturn {\r\n\t\t\tbase: center - size / 2,\r\n\t\t\thead: center + size / 2,\r\n\t\t\tcenter: center,\r\n\t\t\tsize: size\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar ilen = rects.length;\r\n\t\tvar i = 0;\r\n\r\n\t\thelpers$1.canvas.clipArea(chart.ctx, chart.chartArea);\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tvar val = scale._parseValue(dataset.data[i]);\r\n\t\t\tif (!isNaN(val.min) && !isNaN(val.max)) {\r\n\t\t\t\trects[i].draw();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar values = helpers$1.extend({}, core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments));\r\n\t\tvar indexOpts = me._getIndexScale().options;\r\n\t\tvar valueOpts = me._getValueScale().options;\r\n\r\n\t\tvalues.barPercentage = valueOrDefault$3(indexOpts.barPercentage, values.barPercentage);\r\n\t\tvalues.barThickness = valueOrDefault$3(indexOpts.barThickness, values.barThickness);\r\n\t\tvalues.categoryPercentage = valueOrDefault$3(indexOpts.categoryPercentage, values.categoryPercentage);\r\n\t\tvalues.maxBarThickness = valueOrDefault$3(indexOpts.maxBarThickness, values.maxBarThickness);\r\n\t\tvalues.minBarLength = valueOrDefault$3(valueOpts.minBarLength, values.minBarLength);\r\n\r\n\t\treturn values;\r\n\t}\r\n\r\n});\n\nvar valueOrDefault$4 = helpers$1.valueOrDefault;\r\nvar resolve$1 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('bubble', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear', // bubble should probably use a linear scale by default\r\n\t\t\tposition: 'bottom',\r\n\t\t\tid: 'x-axis-0' // need an ID so datasets can reference the scale\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\t// Title doesn't make sense for scatter since we format the data as a point\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\r\n\t\t\t\tvar dataPoint = data.datasets[item.datasetIndex].data[item.index];\r\n\t\t\t\treturn datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_bubble = core_datasetController.extend({\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t\t'hoverRadius',\r\n\t\t'hitRadius',\r\n\t\t'pointStyle',\r\n\t\t'rotation'\r\n\t],\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data;\r\n\r\n\t\t// Update Points\r\n\t\thelpers$1.each(points, function(point, index) {\r\n\t\t\tme.updateElement(point, index, reset);\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar data = me.getDataset().data[index];\r\n\t\tvar dsIndex = me.index;\r\n\r\n\t\tvar x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\r\n\t\tvar y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\r\n\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = dsIndex;\r\n\t\tpoint._index = index;\r\n\t\tpoint._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\thitRadius: options.hitRadius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tradius: reset ? 0 : options.radius,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t};\r\n\r\n\t\tpoint.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = options.radius + options.hoverRadius;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(point, index) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar data = dataset.data[index] || {};\r\n\t\tvar values = core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments);\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// In case values were cached (and thus frozen), we need to clone the values\r\n\t\tif (me._cachedDataOpts === values) {\r\n\t\t\tvalues = helpers$1.extend({}, values);\r\n\t\t}\r\n\r\n\t\t// Custom radius resolution\r\n\t\tvalues.radius = resolve$1([\r\n\t\t\tcustom.radius,\r\n\t\t\tdata.r,\r\n\t\t\tme._config.radius,\r\n\t\t\tchart.options.elements.point.radius\r\n\t\t], context, index);\r\n\r\n\t\treturn values;\r\n\t}\r\n});\n\nvar valueOrDefault$5 = helpers$1.valueOrDefault;\r\n\r\nvar PI$1 = Math.PI;\r\nvar DOUBLE_PI$1 = PI$1 * 2;\r\nvar HALF_PI$1 = PI$1 / 2;\r\n\r\ncore_defaults._set('doughnut', {\r\n\tanimation: {\r\n\t\t// Boolean - Whether we animate the rotation of the Doughnut\r\n\t\tanimateRotate: true,\r\n\t\t// Boolean - Whether we animate scaling the Doughnut from the centre\r\n\t\tanimateScale: false\r\n\t},\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t// toggle visibility of index if exists\r\n\t\t\t\tif (meta.data[index]) {\r\n\t\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// The percentage of the chart that we cut out of the middle.\r\n\tcutoutPercentage: 50,\r\n\r\n\t// The rotation of the chart, where the first data arc begins.\r\n\trotation: -HALF_PI$1,\r\n\r\n\t// The total circumference of the chart.\r\n\tcircumference: DOUBLE_PI$1,\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(tooltipItem, data) {\r\n\t\t\t\tvar dataLabel = data.labels[tooltipItem.index];\r\n\t\t\t\tvar value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\r\n\r\n\t\t\t\tif (helpers$1.isArray(dataLabel)) {\r\n\t\t\t\t\t// show value on first line of multiline label\r\n\t\t\t\t\t// need to clone because we are changing the value\r\n\t\t\t\t\tdataLabel = dataLabel.slice();\r\n\t\t\t\t\tdataLabel[0] += value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdataLabel += value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn dataLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_doughnut = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t// Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\r\n\tgetRingIndex: function(datasetIndex) {\r\n\t\tvar ringIndex = 0;\r\n\r\n\t\tfor (var j = 0; j < datasetIndex; ++j) {\r\n\t\t\tif (this.chart.isDatasetVisible(j)) {\r\n\t\t\t\t++ringIndex;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringIndex;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar ratioX = 1;\r\n\t\tvar ratioY = 1;\r\n\t\tvar offsetX = 0;\r\n\t\tvar offsetY = 0;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar arcs = meta.data;\r\n\t\tvar cutout = opts.cutoutPercentage / 100 || 0;\r\n\t\tvar circumference = opts.circumference;\r\n\t\tvar chartWeight = me._getRingWeight(me.index);\r\n\t\tvar maxWidth, maxHeight, i, ilen;\r\n\r\n\t\t// If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\r\n\t\tif (circumference < DOUBLE_PI$1) {\r\n\t\t\tvar startAngle = opts.rotation % DOUBLE_PI$1;\r\n\t\t\tstartAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0;\r\n\t\t\tvar endAngle = startAngle + circumference;\r\n\t\t\tvar startX = Math.cos(startAngle);\r\n\t\t\tvar startY = Math.sin(startAngle);\r\n\t\t\tvar endX = Math.cos(endAngle);\r\n\t\t\tvar endY = Math.sin(endAngle);\r\n\t\t\tvar contains0 = (startAngle <= 0 && endAngle >= 0) || endAngle >= DOUBLE_PI$1;\r\n\t\t\tvar contains90 = (startAngle <= HALF_PI$1 && endAngle >= HALF_PI$1) || endAngle >= DOUBLE_PI$1 + HALF_PI$1;\r\n\t\t\tvar contains180 = startAngle === -PI$1 || endAngle >= PI$1;\r\n\t\t\tvar contains270 = (startAngle <= -HALF_PI$1 && endAngle >= -HALF_PI$1) || endAngle >= PI$1 + HALF_PI$1;\r\n\t\t\tvar minX = contains180 ? -1 : Math.min(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar minY = contains270 ? -1 : Math.min(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tvar maxX = contains0 ? 1 : Math.max(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar maxY = contains90 ? 1 : Math.max(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tratioX = (maxX - minX) / 2;\r\n\t\t\tratioY = (maxY - minY) / 2;\r\n\t\t\toffsetX = -(maxX + minX) / 2;\r\n\t\t\toffsetY = -(maxY + minY) / 2;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t}\r\n\r\n\t\tchart.borderWidth = me.getMaxBorderWidth();\r\n\t\tmaxWidth = (chartArea.right - chartArea.left - chart.borderWidth) / ratioX;\r\n\t\tmaxHeight = (chartArea.bottom - chartArea.top - chart.borderWidth) / ratioY;\r\n\t\tchart.outerRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\r\n\t\tchart.innerRadius = Math.max(chart.outerRadius * cutout, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1);\r\n\t\tchart.offsetX = offsetX * chart.outerRadius;\r\n\t\tchart.offsetY = offsetY * chart.outerRadius;\r\n\r\n\t\tmeta.total = me.calculateTotal();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index);\r\n\t\tme.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0);\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar centerX = (chartArea.left + chartArea.right) / 2;\r\n\t\tvar centerY = (chartArea.top + chartArea.bottom) / 2;\r\n\t\tvar startAngle = opts.rotation; // non reset case handled later\r\n\t\tvar endAngle = opts.rotation; // non reset case handled later\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / DOUBLE_PI$1);\r\n\t\tvar innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\r\n\t\tvar outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX + chart.offsetX,\r\n\t\t\t\ty: centerY + chart.offsetY,\r\n\t\t\t\tstartAngle: startAngle,\r\n\t\t\t\tendAngle: endAngle,\r\n\t\t\t\tcircumference: circumference,\r\n\t\t\t\touterRadius: outerRadius,\r\n\t\t\t\tinnerRadius: innerRadius,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar model = arc._model;\r\n\r\n\t\t// Set correct angles if not resetting\r\n\t\tif (!reset || !animationOpts.animateRotate) {\r\n\t\t\tif (index === 0) {\r\n\t\t\t\tmodel.startAngle = opts.rotation;\r\n\t\t\t} else {\r\n\t\t\t\tmodel.startAngle = me.getMeta().data[index - 1]._model.endAngle;\r\n\t\t\t}\r\n\r\n\t\t\tmodel.endAngle = model.startAngle + model.circumference;\r\n\t\t}\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcalculateTotal: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar total = 0;\r\n\t\tvar value;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tvalue = dataset.data[index];\r\n\t\t\tif (!isNaN(value) && !element.hidden) {\r\n\t\t\t\ttotal += Math.abs(value);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/* if (total === 0) {\r\n\t\t\ttotal = NaN;\r\n\t\t}*/\r\n\r\n\t\treturn total;\r\n\t},\r\n\r\n\tcalculateCircumference: function(value) {\r\n\t\tvar total = this.getMeta().total;\r\n\t\tif (total > 0 && !isNaN(value)) {\r\n\t\t\treturn DOUBLE_PI$1 * (Math.abs(value) / total);\r\n\t\t}\r\n\t\treturn 0;\r\n\t},\r\n\r\n\t// gets the max border or hover width to properly scale pie charts\r\n\tgetMaxBorderWidth: function(arcs) {\r\n\t\tvar me = this;\r\n\t\tvar max = 0;\r\n\t\tvar chart = me.chart;\r\n\t\tvar i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;\r\n\r\n\t\tif (!arcs) {\r\n\t\t\t// Find the outmost visible dataset\r\n\t\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\r\n\t\t\t\tif (chart.isDatasetVisible(i)) {\r\n\t\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t\tarcs = meta.data;\r\n\t\t\t\t\tif (i !== me.index) {\r\n\t\t\t\t\t\tcontroller = meta.controller;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!arcs) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarc = arcs[i];\r\n\t\t\tif (controller) {\r\n\t\t\t\tcontroller._configure();\r\n\t\t\t\toptions = controller._resolveDataElementOptions(arc, i);\r\n\t\t\t} else {\r\n\t\t\t\toptions = arc._options;\r\n\t\t\t}\r\n\t\t\tif (options.borderAlign !== 'inner') {\r\n\t\t\t\tborderWidth = options.borderWidth;\r\n\t\t\t\thoverWidth = options.hoverBorderWidth;\r\n\r\n\t\t\t\tmax = borderWidth > max ? borderWidth : max;\r\n\t\t\t\tmax = hoverWidth > max ? hoverWidth : max;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\r\n\t * @private\r\n\t */\r\n\t_getRingWeightOffset: function(datasetIndex) {\r\n\t\tvar ringWeightOffset = 0;\r\n\r\n\t\tfor (var i = 0; i < datasetIndex; ++i) {\r\n\t\t\tif (this.chart.isDatasetVisible(i)) {\r\n\t\t\t\tringWeightOffset += this._getRingWeight(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringWeightOffset;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getRingWeight: function(dataSetIndex) {\r\n\t\treturn Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight, 1), 0);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the sum of all visibile data set weights. This value can be 0.\r\n\t * @private\r\n\t */\r\n\t_getVisibleDatasetWeightTotal: function() {\r\n\t\treturn this._getRingWeightOffset(this.chart.data.datasets.length);\r\n\t}\r\n});\n\ncore_defaults._set('horizontalBar', {\r\n\thover: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tposition: 'left',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}]\r\n\t},\r\n\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tborderSkipped: 'left'\r\n\t\t}\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\thorizontalBar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_horizontalBar = controller_bar.extend({\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t}\r\n});\n\nvar valueOrDefault$6 = helpers$1.valueOrDefault;\r\nvar resolve$2 = helpers$1.options.resolve;\r\nvar isPointInArea = helpers$1.canvas._isPointInArea;\r\n\r\ncore_defaults._set('line', {\r\n\tshowLines: true,\r\n\tspanGaps: false,\r\n\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tid: 'x-axis-0'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\nfunction scaleClip(scale, halfBorderWidth) {\r\n\tvar tickOpts = scale && scale.options.ticks || {};\r\n\tvar reverse = tickOpts.reverse;\r\n\tvar min = tickOpts.min === undefined ? halfBorderWidth : 0;\r\n\tvar max = tickOpts.max === undefined ? halfBorderWidth : 0;\r\n\treturn {\r\n\t\tstart: reverse ? max : min,\r\n\t\tend: reverse ? min : max\r\n\t};\r\n}\r\n\r\nfunction defaultClip(xScale, yScale, borderWidth) {\r\n\tvar halfBorderWidth = borderWidth / 2;\r\n\tvar x = scaleClip(xScale, halfBorderWidth);\r\n\tvar y = scaleClip(yScale, halfBorderWidth);\r\n\r\n\treturn {\r\n\t\ttop: y.end,\r\n\t\tright: x.end,\r\n\t\tbottom: y.start,\r\n\t\tleft: x.start\r\n\t};\r\n}\r\n\r\nfunction toClip(value) {\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = value.top;\r\n\t\tr = value.right;\r\n\t\tb = value.bottom;\r\n\t\tl = value.left;\r\n\t} else {\r\n\t\tt = r = b = l = value;\r\n\t}\r\n\r\n\treturn {\r\n\t\ttop: t,\r\n\t\tright: r,\r\n\t\tbottom: b,\r\n\t\tleft: l\r\n\t};\r\n}\r\n\r\n\r\nvar controller_line = core_datasetController.extend({\r\n\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth',\r\n\t\t'cubicInterpolationMode',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar options = me.chart.options;\r\n\t\tvar config = me._config;\r\n\t\tvar showLine = me._showLine = valueOrDefault$6(config.showLine, options.showLines);\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tme._yScale = me.getScaleForId(meta.yAxisID);\r\n\r\n\t\t// Update Line\r\n\t\tif (showLine) {\r\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\t\tconfig.lineTension = config.tension;\r\n\t\t\t}\r\n\r\n\t\t\t// Utility\r\n\t\t\tline._scale = me._yScale;\r\n\t\t\tline._datasetIndex = me.index;\r\n\t\t\t// Data\r\n\t\t\tline._children = points;\r\n\t\t\t// Model\r\n\t\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\t\tline.pivot();\r\n\t\t}\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\tif (showLine && line._model.tension !== 0) {\r\n\t\t\tme.updateBezierControlPoints();\r\n\t\t}\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar datasetIndex = me.index;\r\n\t\tvar value = dataset.data[index];\r\n\t\tvar xScale = me._xScale;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar x, y;\r\n\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\r\n\t\tx = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\r\n\t\ty = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\r\n\r\n\t\t// Utility\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = datasetIndex;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0),\r\n\t\t\tsteppedLine: lineModel ? lineModel.steppedLine : false,\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element) {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = me.chart.options;\r\n\t\tvar lineOptions = options.elements.line;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\t// The default behavior of lines is to break at null values, according\r\n\t\t// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\r\n\t\t// This option gives lines the ability to span gaps\r\n\t\tvalues.spanGaps = valueOrDefault$6(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$6(config.lineTension, lineOptions.tension);\r\n\t\tvalues.steppedLine = resolve$2([custom.steppedLine, config.steppedLine, lineOptions.stepped]);\r\n\t\tvalues.clip = toClip(valueOrDefault$6(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth)));\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tcalculatePointY: function(value, index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar sumPos = 0;\r\n\t\tvar sumNeg = 0;\r\n\t\tvar i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen;\r\n\r\n\t\tif (yScale.options.stacked) {\r\n\t\t\trightValue = +yScale.getRightValue(value);\r\n\t\t\tmetasets = chart._getSortedVisibleDatasetMetas();\r\n\t\t\tilen = metasets.length;\r\n\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\tdsMeta = metasets[i];\r\n\t\t\t\tif (dsMeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tds = chart.data.datasets[dsMeta.index];\r\n\t\t\t\tif (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id) {\r\n\t\t\t\t\tstackedRightValue = +yScale.getRightValue(ds.data[index]);\r\n\t\t\t\t\tif (stackedRightValue < 0) {\r\n\t\t\t\t\t\tsumNeg += stackedRightValue || 0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsumPos += stackedRightValue || 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (rightValue < 0) {\r\n\t\t\t\treturn yScale.getPixelForValue(sumNeg + rightValue);\r\n\t\t\t}\r\n\t\t\treturn yScale.getPixelForValue(sumPos + rightValue);\r\n\t\t}\r\n\t\treturn yScale.getPixelForValue(value);\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (lineModel.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tif (lineModel.cubicInterpolationMode === 'monotone') {\r\n\t\t\thelpers$1.splineCurveMonotone(points);\r\n\t\t} else {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\t\thelpers$1.previousItem(points, i)._model,\r\n\t\t\t\t\tmodel,\r\n\t\t\t\t\thelpers$1.nextItem(points, i)._model,\r\n\t\t\t\t\tlineModel.tension\r\n\t\t\t\t);\r\n\t\t\t\tmodel.controlPointPreviousX = controlPoints.previous.x;\r\n\t\t\t\tmodel.controlPointPreviousY = controlPoints.previous.y;\r\n\t\t\t\tmodel.controlPointNextX = controlPoints.next.x;\r\n\t\t\t\tmodel.controlPointNextY = controlPoints.next.y;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (chart.options.elements.line.capBezierPoints) {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tif (isPointInArea(model, area)) {\r\n\t\t\t\t\tif (i > 0 && isPointInArea(points[i - 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data || [];\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar canvas = chart.canvas;\r\n\t\tvar i = 0;\r\n\t\tvar ilen = points.length;\r\n\t\tvar clip;\r\n\r\n\t\tif (me._showLine) {\r\n\t\t\tclip = meta.dataset._model.clip;\r\n\r\n\t\t\thelpers$1.canvas.clipArea(chart.ctx, {\r\n\t\t\t\tleft: clip.left === false ? 0 : area.left - clip.left,\r\n\t\t\t\tright: clip.right === false ? canvas.width : area.right + clip.right,\r\n\t\t\t\ttop: clip.top === false ? 0 : area.top - clip.top,\r\n\t\t\t\tbottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom\r\n\t\t\t});\r\n\r\n\t\t\tmeta.dataset.draw();\r\n\r\n\t\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t\t}\r\n\r\n\t\t// Draw the points\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tpoints[i].draw(area);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$6(options.hoverRadius, options.radius);\r\n\t},\r\n});\n\nvar resolve$3 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('polarArea', {\r\n\tscale: {\r\n\t\ttype: 'radialLinear',\r\n\t\tangleLines: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tgridLines: {\r\n\t\t\tcircular: true\r\n\t\t},\r\n\t\tpointLabels: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tticks: {\r\n\t\t\tbeginAtZero: true\r\n\t\t}\r\n\t},\r\n\r\n\t// Boolean - Whether to animate the rotation of the chart\r\n\tanimation: {\r\n\t\tanimateRotate: true,\r\n\t\tanimateScale: true\r\n\t},\r\n\r\n\tstartAngle: -0.5 * Math.PI,\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\treturn data.labels[item.index] + ': ' + item.yLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_polarArea = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar start = me.chart.options.startAngle || 0;\r\n\t\tvar starts = me._starts = [];\r\n\t\tvar angles = me._angles = [];\r\n\t\tvar arcs = meta.data;\r\n\t\tvar i, ilen, angle;\r\n\r\n\t\tme._updateRadius();\r\n\r\n\t\tmeta.count = me.countVisibleElements();\r\n\r\n\t\tfor (i = 0, ilen = dataset.data.length; i < ilen; i++) {\r\n\t\t\tstarts[i] = start;\r\n\t\t\tangle = me._computeAngle(i);\r\n\t\t\tangles[i] = angle;\r\n\t\t\tstart += angle;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateRadius: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\r\n\r\n\t\tchart.outerRadius = Math.max(minSize / 2, 0);\r\n\t\tchart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\r\n\t\tme.innerRadius = me.outerRadius - chart.radiusLength;\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar scale = chart.scale;\r\n\t\tvar labels = chart.data.labels;\r\n\r\n\t\tvar centerX = scale.xCenter;\r\n\t\tvar centerY = scale.yCenter;\r\n\r\n\t\t// var negHalfPI = -0.5 * Math.PI;\r\n\t\tvar datasetStartAngle = opts.startAngle;\r\n\t\tvar distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar startAngle = me._starts[index];\r\n\t\tvar endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]);\r\n\r\n\t\tvar resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\t\t\t_scale: scale,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX,\r\n\t\t\t\ty: centerY,\r\n\t\t\t\tinnerRadius: 0,\r\n\t\t\t\touterRadius: reset ? resetRadius : distance,\r\n\t\t\t\tstartAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\r\n\t\t\t\tendAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(labels, index, labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcountVisibleElements: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar count = 0;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tif (!isNaN(dataset.data[index]) && !element.hidden) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn count;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\t\tvar valueOrDefault = helpers$1.valueOrDefault;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_computeAngle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar count = this.getMeta().count;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\r\n\t\tif (isNaN(dataset.data[index]) || meta.data[index].hidden) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: me.chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\treturn resolve$3([\r\n\t\t\tme.chart.options.elements.arc.angle,\r\n\t\t\t(2 * Math.PI) / count\r\n\t\t], context, index);\r\n\t}\r\n});\n\ncore_defaults._set('pie', helpers$1.clone(core_defaults.doughnut));\r\ncore_defaults._set('pie', {\r\n\tcutoutPercentage: 0\r\n});\r\n\r\n// Pie charts are Doughnut chart with different defaults\r\nvar controller_pie = controller_doughnut;\n\nvar valueOrDefault$7 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('radar', {\r\n\tspanGaps: false,\r\n\tscale: {\r\n\t\ttype: 'radialLinear'\r\n\t},\r\n\telements: {\r\n\t\tline: {\r\n\t\t\tfill: 'start',\r\n\t\t\ttension: 0 // no bezier in radar\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_radar = core_datasetController.extend({\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderWidth',\r\n\t\t'borderColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar config = me._config;\r\n\t\tvar i, ilen;\r\n\r\n\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\tconfig.lineTension = config.tension;\r\n\t\t}\r\n\r\n\t\t// Utility\r\n\t\tline._scale = scale;\r\n\t\tline._datasetIndex = me.index;\r\n\t\t// Data\r\n\t\tline._children = points;\r\n\t\tline._loop = true;\r\n\t\t// Model\r\n\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\tline.pivot();\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\t// Update bezier control points\r\n\t\tme.updateBezierControlPoints();\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar lineModel = me.getMeta().dataset._model;\r\n\t\tvar x = reset ? scale.xCenter : pointPosition.x;\r\n\t\tvar y = reset ? scale.yCenter : pointPosition.y;\r\n\r\n\t\t// Utility\r\n\t\tpoint._scale = scale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = me.index;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x, // value not used in dataset scale, but we want a consistent API between scales\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$7(custom.tension, lineModel ? lineModel.tension : 0),\r\n\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar options = me.chart.options;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\tvalues.spanGaps = valueOrDefault$7(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$7(config.lineTension, options.elements.line.tension);\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar area = me.chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (meta.dataset._model.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tmodel = points[i]._model;\r\n\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\thelpers$1.previousItem(points, i, true)._model,\r\n\t\t\t\tmodel,\r\n\t\t\t\thelpers$1.nextItem(points, i, true)._model,\r\n\t\t\t\tmodel.tension\r\n\t\t\t);\r\n\r\n\t\t\t// Prevent the bezier going outside of the bounds of the graph\r\n\t\t\tmodel.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right);\r\n\t\t\tmodel.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom);\r\n\t\t\tmodel.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right);\r\n\t\t\tmodel.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom);\r\n\t\t}\r\n\t},\r\n\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$7(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$7(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$7(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$7(options.hoverRadius, options.radius);\r\n\t}\r\n});\n\ncore_defaults._set('scatter', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\tid: 'x-axis-1', // need an ID so datasets can reference the scale\r\n\t\t\ttype: 'linear', // scatter should not use a category axis\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\tid: 'y-axis-1',\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn ''; // doesn't make sense for scatter since data are formatted as a point\r\n\t\t\t},\r\n\t\t\tlabel: function(item) {\r\n\t\t\t\treturn '(' + item.xLabel + ', ' + item.yLabel + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tscatter: {\r\n\t\t\tshowLine: false\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// Scatter charts use line controllers\r\nvar controller_scatter = controller_line;\n\n// NOTE export a map in which the key represents the controller type, not\r\n// the class, and so must be CamelCase in order to be correctly retrieved\r\n// by the controller in core.controller.js (`controllers[meta.type]`).\r\n\r\nvar controllers = {\r\n\tbar: controller_bar,\r\n\tbubble: controller_bubble,\r\n\tdoughnut: controller_doughnut,\r\n\thorizontalBar: controller_horizontalBar,\r\n\tline: controller_line,\r\n\tpolarArea: controller_polarArea,\r\n\tpie: controller_pie,\r\n\tradar: controller_radar,\r\n\tscatter: controller_scatter\r\n};\n\n/**\r\n * Helper function to get relative position for an event\r\n * @param {Event|IEvent} event - The event to get the position for\r\n * @param {Chart} chart - The chart\r\n * @returns {object} the event position\r\n */\r\nfunction getRelativePosition(e, chart) {\r\n\tif (e.native) {\r\n\t\treturn {\r\n\t\t\tx: e.x,\r\n\t\t\ty: e.y\r\n\t\t};\r\n\t}\r\n\r\n\treturn helpers$1.getRelativePosition(e, chart);\r\n}\r\n\r\n/**\r\n * Helper function to traverse all of the visible elements in the chart\r\n * @param {Chart} chart - the chart\r\n * @param {function} handler - the callback to execute for each visible item\r\n */\r\nfunction parseVisibleItems(chart, handler) {\r\n\tvar metasets = chart._getSortedVisibleDatasetMetas();\r\n\tvar metadata, i, j, ilen, jlen, element;\r\n\r\n\tfor (i = 0, ilen = metasets.length; i < ilen; ++i) {\r\n\t\tmetadata = metasets[i].data;\r\n\t\tfor (j = 0, jlen = metadata.length; j < jlen; ++j) {\r\n\t\t\telement = metadata[j];\r\n\t\t\tif (!element._view.skip) {\r\n\t\t\t\thandler(element);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Helper function to get the items that intersect the event position\r\n * @param {ChartElement[]} items - elements to filter\r\n * @param {object} position - the point to be nearest to\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getIntersectItems(chart, position) {\r\n\tvar elements = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\r\n * @param {Chart} chart - the chart to look at elements from\r\n * @param {object} position - the point to be nearest to\r\n * @param {boolean} intersect - if true, only consider items that intersect the position\r\n * @param {function} distanceMetric - function to provide the distance between points\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getNearestItems(chart, position, intersect, distanceMetric) {\r\n\tvar minDistance = Number.POSITIVE_INFINITY;\r\n\tvar nearestItems = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (intersect && !element.inRange(position.x, position.y)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar center = element.getCenterPoint();\r\n\t\tvar distance = distanceMetric(position, center);\r\n\t\tif (distance < minDistance) {\r\n\t\t\tnearestItems = [element];\r\n\t\t\tminDistance = distance;\r\n\t\t} else if (distance === minDistance) {\r\n\t\t\t// Can have multiple items at the same distance in which case we sort by size\r\n\t\t\tnearestItems.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn nearestItems;\r\n}\r\n\r\n/**\r\n * Get a distance metric function for two points based on the\r\n * axis mode setting\r\n * @param {string} axis - the axis mode. x|y|xy\r\n */\r\nfunction getDistanceMetricForAxis(axis) {\r\n\tvar useX = axis.indexOf('x') !== -1;\r\n\tvar useY = axis.indexOf('y') !== -1;\r\n\r\n\treturn function(pt1, pt2) {\r\n\t\tvar deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\r\n\t\tvar deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\r\n\t\treturn Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\r\n\t};\r\n}\r\n\r\nfunction indexMode(chart, e, options) {\r\n\tvar position = getRelativePosition(e, chart);\r\n\t// Default axis for index mode is 'x' to match old behaviour\r\n\toptions.axis = options.axis || 'x';\r\n\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\tvar elements = [];\r\n\r\n\tif (!items.length) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tchart._getSortedVisibleDatasetMetas().forEach(function(meta) {\r\n\t\tvar element = meta.data[items[0]._index];\r\n\r\n\t\t// don't count items that are skipped (null data)\r\n\t\tif (element && !element._view.skip) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * @interface IInteractionOptions\r\n */\r\n/**\r\n * If true, only consider items that intersect the point\r\n * @name IInterfaceOptions#boolean\r\n * @type Boolean\r\n */\r\n\r\n/**\r\n * Contains interaction related functions\r\n * @namespace Chart.Interaction\r\n */\r\nvar core_interaction = {\r\n\t// Helper function for different modes\r\n\tmodes: {\r\n\t\tsingle: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar elements = [];\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\telements.push(element);\r\n\t\t\t\t\treturn elements;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn elements.slice(0, 1);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.label\r\n\t\t * @deprecated since version 2.4.0\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\tlabel: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\r\n\t\t * @function Chart.Interaction.modes.index\r\n\t\t * @since v2.4.0\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tindex: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\r\n\t\t * @function Chart.Interaction.modes.dataset\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tdataset: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\r\n\t\t\tif (items.length > 0) {\r\n\t\t\t\titems = chart.getDatasetMeta(items[0]._datasetIndex).data;\r\n\t\t\t}\r\n\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.x-axis\r\n\t\t * @deprecated since version 2.4.0. Use index mode and intersect == true\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\t'x-axis': function(chart, e) {\r\n\t\t\treturn indexMode(chart, e, {intersect: false});\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Point mode returns all elements that hit test based on the event position\r\n\t\t * of the event\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tpoint: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\treturn getIntersectItems(chart, position);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * nearest mode returns the element closest to the point\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tnearest: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\treturn getNearestItems(chart, position, options.intersect, distanceMetric);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * x mode returns the elements that hit-test at the current x coordinate\r\n\t\t * @function Chart.Interaction.modes.x\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tx: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inXRange(position.x)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * y mode returns the elements that hit-test at the current y coordinate\r\n\t\t * @function Chart.Interaction.modes.y\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\ty: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inYRange(position.y)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t}\r\n\t}\r\n};\n\nvar extend = helpers$1.extend;\r\n\r\nfunction filterByPosition(array, position) {\r\n\treturn helpers$1.where(array, function(v) {\r\n\t\treturn v.pos === position;\r\n\t});\r\n}\r\n\r\nfunction sortByWeight(array, reverse) {\r\n\treturn array.sort(function(a, b) {\r\n\t\tvar v0 = reverse ? b : a;\r\n\t\tvar v1 = reverse ? a : b;\r\n\t\treturn v0.weight === v1.weight ?\r\n\t\t\tv0.index - v1.index :\r\n\t\t\tv0.weight - v1.weight;\r\n\t});\r\n}\r\n\r\nfunction wrapBoxes(boxes) {\r\n\tvar layoutBoxes = [];\r\n\tvar i, ilen, box;\r\n\r\n\tfor (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\r\n\t\tbox = boxes[i];\r\n\t\tlayoutBoxes.push({\r\n\t\t\tindex: i,\r\n\t\t\tbox: box,\r\n\t\t\tpos: box.position,\r\n\t\t\thorizontal: box.isHorizontal(),\r\n\t\t\tweight: box.weight\r\n\t\t});\r\n\t}\r\n\treturn layoutBoxes;\r\n}\r\n\r\nfunction setLayoutDims(layouts, params) {\r\n\tvar i, ilen, layout;\r\n\tfor (i = 0, ilen = layouts.length; i < ilen; ++i) {\r\n\t\tlayout = layouts[i];\r\n\t\t// store width used instead of chartArea.w in fitBoxes\r\n\t\tlayout.width = layout.horizontal\r\n\t\t\t? layout.box.fullWidth && params.availableWidth\r\n\t\t\t: params.vBoxMaxWidth;\r\n\t\t// store height used instead of chartArea.h in fitBoxes\r\n\t\tlayout.height = layout.horizontal && params.hBoxMaxHeight;\r\n\t}\r\n}\r\n\r\nfunction buildLayoutBoxes(boxes) {\r\n\tvar layoutBoxes = wrapBoxes(boxes);\r\n\tvar left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\r\n\tvar right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\r\n\tvar top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\r\n\tvar bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\r\n\r\n\treturn {\r\n\t\tleftAndTop: left.concat(top),\r\n\t\trightAndBottom: right.concat(bottom),\r\n\t\tchartArea: filterByPosition(layoutBoxes, 'chartArea'),\r\n\t\tvertical: left.concat(right),\r\n\t\thorizontal: top.concat(bottom)\r\n\t};\r\n}\r\n\r\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\r\n\treturn Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\r\n}\r\n\r\nfunction updateDims(chartArea, params, layout) {\r\n\tvar box = layout.box;\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\tvar newWidth, newHeight;\r\n\r\n\tif (layout.size) {\r\n\t\t// this layout was already counted for, lets first reduce old size\r\n\t\tchartArea[layout.pos] -= layout.size;\r\n\t}\r\n\tlayout.size = layout.horizontal ? box.height : box.width;\r\n\tchartArea[layout.pos] += layout.size;\r\n\r\n\tif (box.getPadding) {\r\n\t\tvar boxPadding = box.getPadding();\r\n\t\tmaxPadding.top = Math.max(maxPadding.top, boxPadding.top);\r\n\t\tmaxPadding.left = Math.max(maxPadding.left, boxPadding.left);\r\n\t\tmaxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\r\n\t\tmaxPadding.right = Math.max(maxPadding.right, boxPadding.right);\r\n\t}\r\n\r\n\tnewWidth = params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right');\r\n\tnewHeight = params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom');\r\n\r\n\tif (newWidth !== chartArea.w || newHeight !== chartArea.h) {\r\n\t\tchartArea.w = newWidth;\r\n\t\tchartArea.h = newHeight;\r\n\r\n\t\t// return true if chart area changed in layout's direction\r\n\t\tvar sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];\r\n\t\treturn sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));\r\n\t}\r\n}\r\n\r\nfunction handleMaxPadding(chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction updatePos(pos) {\r\n\t\tvar change = Math.max(maxPadding[pos] - chartArea[pos], 0);\r\n\t\tchartArea[pos] += change;\r\n\t\treturn change;\r\n\t}\r\n\tchartArea.y += updatePos('top');\r\n\tchartArea.x += updatePos('left');\r\n\tupdatePos('right');\r\n\tupdatePos('bottom');\r\n}\r\n\r\nfunction getMargins(horizontal, chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction marginForPositions(positions) {\r\n\t\tvar margin = {left: 0, top: 0, right: 0, bottom: 0};\r\n\t\tpositions.forEach(function(pos) {\r\n\t\t\tmargin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\r\n\t\t});\r\n\t\treturn margin;\r\n\t}\r\n\r\n\treturn horizontal\r\n\t\t? marginForPositions(['left', 'right'])\r\n\t\t: marginForPositions(['top', 'bottom']);\r\n}\r\n\r\nfunction fitBoxes(boxes, chartArea, params) {\r\n\tvar refitBoxes = [];\r\n\tvar i, ilen, layout, box, refit, changed;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\r\n\t\tbox.update(\r\n\t\t\tlayout.width || chartArea.w,\r\n\t\t\tlayout.height || chartArea.h,\r\n\t\t\tgetMargins(layout.horizontal, chartArea)\r\n\t\t);\r\n\t\tif (updateDims(chartArea, params, layout)) {\r\n\t\t\tchanged = true;\r\n\t\t\tif (refitBoxes.length) {\r\n\t\t\t\t// Dimensions changed and there were non full width boxes before this\r\n\t\t\t\t// -> we have to refit those\r\n\t\t\t\trefit = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!box.fullWidth) { // fullWidth boxes don't need to be re-fitted in any case\r\n\t\t\trefitBoxes.push(layout);\r\n\t\t}\r\n\t}\r\n\r\n\treturn refit ? fitBoxes(refitBoxes, chartArea, params) || changed : changed;\r\n}\r\n\r\nfunction placeBoxes(boxes, chartArea, params) {\r\n\tvar userPadding = params.padding;\r\n\tvar x = chartArea.x;\r\n\tvar y = chartArea.y;\r\n\tvar i, ilen, layout, box;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\t\tif (layout.horizontal) {\r\n\t\t\tbox.left = box.fullWidth ? userPadding.left : chartArea.left;\r\n\t\t\tbox.right = box.fullWidth ? params.outerWidth - userPadding.right : chartArea.left + chartArea.w;\r\n\t\t\tbox.top = y;\r\n\t\t\tbox.bottom = y + box.height;\r\n\t\t\tbox.width = box.right - box.left;\r\n\t\t\ty = box.bottom;\r\n\t\t} else {\r\n\t\t\tbox.left = x;\r\n\t\t\tbox.right = x + box.width;\r\n\t\t\tbox.top = chartArea.top;\r\n\t\t\tbox.bottom = chartArea.top + chartArea.h;\r\n\t\t\tbox.height = box.bottom - box.top;\r\n\t\t\tx = box.right;\r\n\t\t}\r\n\t}\r\n\r\n\tchartArea.x = x;\r\n\tchartArea.y = y;\r\n}\r\n\r\ncore_defaults._set('global', {\r\n\tlayout: {\r\n\t\tpadding: {\r\n\t\t\ttop: 0,\r\n\t\t\tright: 0,\r\n\t\t\tbottom: 0,\r\n\t\t\tleft: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * @interface ILayoutItem\r\n * @prop {string} position - The position of the item in the chart layout. Possible values are\r\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\r\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\r\n * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\r\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\r\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\r\n * @prop {function} getPadding - Returns an object with padding on the edges\r\n * @prop {number} width - Width of item. Must be valid after update()\r\n * @prop {number} height - Height of item. Must be valid after update()\r\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\r\n */\r\n\r\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\r\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\r\n// It is this service's responsibility of carrying out that layout.\r\nvar core_layouts = {\r\n\tdefaults: {},\r\n\r\n\t/**\r\n\t * Register a box to a chart.\r\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\r\n\t * @param {Chart} chart - the chart to use\r\n\t * @param {ILayoutItem} item - the item to add to be layed out\r\n\t */\r\n\taddBox: function(chart, item) {\r\n\t\tif (!chart.boxes) {\r\n\t\t\tchart.boxes = [];\r\n\t\t}\r\n\r\n\t\t// initialize item with default values\r\n\t\titem.fullWidth = item.fullWidth || false;\r\n\t\titem.position = item.position || 'top';\r\n\t\titem.weight = item.weight || 0;\r\n\t\titem._layers = item._layers || function() {\r\n\t\t\treturn [{\r\n\t\t\t\tz: 0,\r\n\t\t\t\tdraw: function() {\r\n\t\t\t\t\titem.draw.apply(item, arguments);\r\n\t\t\t\t}\r\n\t\t\t}];\r\n\t\t};\r\n\r\n\t\tchart.boxes.push(item);\r\n\t},\r\n\r\n\t/**\r\n\t * Remove a layoutItem from a chart\r\n\t * @param {Chart} chart - the chart to remove the box from\r\n\t * @param {ILayoutItem} layoutItem - the item to remove from the layout\r\n\t */\r\n\tremoveBox: function(chart, layoutItem) {\r\n\t\tvar index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\r\n\t\tif (index !== -1) {\r\n\t\t\tchart.boxes.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Sets (or updates) options on the given `item`.\r\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\r\n\t * @param {ILayoutItem} item - the item to configure with the given options\r\n\t * @param {object} options - the new item options.\r\n\t */\r\n\tconfigure: function(chart, item, options) {\r\n\t\tvar props = ['fullWidth', 'position', 'weight'];\r\n\t\tvar ilen = props.length;\r\n\t\tvar i = 0;\r\n\t\tvar prop;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tprop = props[i];\r\n\t\t\tif (options.hasOwnProperty(prop)) {\r\n\t\t\t\titem[prop] = options[prop];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Fits boxes of the given chart into the given size by having each box measure itself\r\n\t * then running a fitting algorithm\r\n\t * @param {Chart} chart - the chart\r\n\t * @param {number} width - the width to fit into\r\n\t * @param {number} height - the height to fit into\r\n\t */\r\n\tupdate: function(chart, width, height) {\r\n\t\tif (!chart) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar layoutOptions = chart.options.layout || {};\r\n\t\tvar padding = helpers$1.options.toPadding(layoutOptions.padding);\r\n\r\n\t\tvar availableWidth = width - padding.width;\r\n\t\tvar availableHeight = height - padding.height;\r\n\t\tvar boxes = buildLayoutBoxes(chart.boxes);\r\n\t\tvar verticalBoxes = boxes.vertical;\r\n\t\tvar horizontalBoxes = boxes.horizontal;\r\n\r\n\t\t// Essentially we now have any number of boxes on each of the 4 sides.\r\n\t\t// Our canvas looks like the following.\r\n\t\t// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\r\n\t\t// B1 is the bottom axis\r\n\t\t// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\r\n\t\t// These locations are single-box locations only, when trying to register a chartArea location that is already taken,\r\n\t\t// an error will be thrown.\r\n\t\t//\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | T1 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | | | T2 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | C1 | | C2 | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | | |\r\n\t\t// | L1 | L2 | ChartArea (C0) | R1 |\r\n\t\t// | | | | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | C3 | | C4 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | B1 | |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | B2 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t//\r\n\r\n\t\tvar params = Object.freeze({\r\n\t\t\touterWidth: width,\r\n\t\t\touterHeight: height,\r\n\t\t\tpadding: padding,\r\n\t\t\tavailableWidth: availableWidth,\r\n\t\t\tvBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,\r\n\t\t\thBoxMaxHeight: availableHeight / 2\r\n\t\t});\r\n\t\tvar chartArea = extend({\r\n\t\t\tmaxPadding: extend({}, padding),\r\n\t\t\tw: availableWidth,\r\n\t\t\th: availableHeight,\r\n\t\t\tx: padding.left,\r\n\t\t\ty: padding.top\r\n\t\t}, padding);\r\n\r\n\t\tsetLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\r\n\r\n\t\t// First fit vertical boxes\r\n\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\r\n\t\t// Then fit horizontal boxes\r\n\t\tif (fitBoxes(horizontalBoxes, chartArea, params)) {\r\n\t\t\t// if the area changed, re-fit vertical boxes\r\n\t\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\t\t}\r\n\r\n\t\thandleMaxPadding(chartArea);\r\n\r\n\t\t// Finally place the boxes to correct coordinates\r\n\t\tplaceBoxes(boxes.leftAndTop, chartArea, params);\r\n\r\n\t\t// Move to opposite side of chart\r\n\t\tchartArea.x += chartArea.w;\r\n\t\tchartArea.y += chartArea.h;\r\n\r\n\t\tplaceBoxes(boxes.rightAndBottom, chartArea, params);\r\n\r\n\t\tchart.chartArea = {\r\n\t\t\tleft: chartArea.left,\r\n\t\t\ttop: chartArea.top,\r\n\t\t\tright: chartArea.left + chartArea.w,\r\n\t\t\tbottom: chartArea.top + chartArea.h\r\n\t\t};\r\n\r\n\t\t// Finally update boxes in chartArea (radial scale for example)\r\n\t\thelpers$1.each(boxes.chartArea, function(layout) {\r\n\t\t\tvar box = layout.box;\r\n\t\t\textend(box, chart.chartArea);\r\n\t\t\tbox.update(chartArea.w, chartArea.h);\r\n\t\t});\r\n\t}\r\n};\n\n/**\r\n * Platform fallback implementation (minimal).\r\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\r\n */\r\n\r\nvar platform_basic = {\r\n\tacquireContext: function(item) {\r\n\t\tif (item && item.canvas) {\r\n\t\t\t// Support for any object associated to a canvas (including a context2d)\r\n\t\t\titem = item.canvas;\r\n\t\t}\r\n\r\n\t\treturn item && item.getContext('2d') || null;\r\n\t}\r\n};\n\nvar platform_dom = \"/*\\r\\n * DOM element rendering detection\\r\\n * https://davidwalsh.name/detect-node-insertion\\r\\n */\\r\\n@keyframes chartjs-render-animation {\\r\\n\\tfrom { opacity: 0.99; }\\r\\n\\tto { opacity: 1; }\\r\\n}\\r\\n\\r\\n.chartjs-render-monitor {\\r\\n\\tanimation: chartjs-render-animation 0.001s;\\r\\n}\\r\\n\\r\\n/*\\r\\n * DOM element resizing detection\\r\\n * https://github.com/marcj/css-element-queries\\r\\n */\\r\\n.chartjs-size-monitor,\\r\\n.chartjs-size-monitor-expand,\\r\\n.chartjs-size-monitor-shrink {\\r\\n\\tposition: absolute;\\r\\n\\tdirection: ltr;\\r\\n\\tleft: 0;\\r\\n\\ttop: 0;\\r\\n\\tright: 0;\\r\\n\\tbottom: 0;\\r\\n\\toverflow: hidden;\\r\\n\\tpointer-events: none;\\r\\n\\tvisibility: hidden;\\r\\n\\tz-index: -1;\\r\\n}\\r\\n\\r\\n.chartjs-size-monitor-expand > div {\\r\\n\\tposition: absolute;\\r\\n\\twidth: 1000000px;\\r\\n\\theight: 1000000px;\\r\\n\\tleft: 0;\\r\\n\\ttop: 0;\\r\\n}\\r\\n\\r\\n.chartjs-size-monitor-shrink > div {\\r\\n\\tposition: absolute;\\r\\n\\twidth: 200%;\\r\\n\\theight: 200%;\\r\\n\\tleft: 0;\\r\\n\\ttop: 0;\\r\\n}\\r\\n\";\n\nvar platform_dom$1 = /*#__PURE__*/Object.freeze({\n__proto__: null,\n'default': platform_dom\n});\n\nvar stylesheet = getCjsExportFromNamespace(platform_dom$1);\n\nvar EXPANDO_KEY = '$chartjs';\r\nvar CSS_PREFIX = 'chartjs-';\r\nvar CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';\r\nvar CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\r\nvar CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\r\nvar ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\r\n\r\n/**\r\n * DOM event types -> Chart.js event types.\r\n * Note: only events with different types are mapped.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\r\n */\r\nvar EVENT_TYPES = {\r\n\ttouchstart: 'mousedown',\r\n\ttouchmove: 'mousemove',\r\n\ttouchend: 'mouseup',\r\n\tpointerenter: 'mouseenter',\r\n\tpointerdown: 'mousedown',\r\n\tpointermove: 'mousemove',\r\n\tpointerup: 'mouseup',\r\n\tpointerleave: 'mouseout',\r\n\tpointerout: 'mouseout'\r\n};\r\n\r\n/**\r\n * The \"used\" size is the final value of a dimension property after all calculations have\r\n * been performed. This method uses the computed style of `element` but returns undefined\r\n * if the computed style is not expressed in pixels. That can happen in some cases where\r\n * `element` has a size relative to its parent and this last one is not yet displayed,\r\n * for example because of `display: none` on a parent node.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\r\n * @returns {number} Size in pixels or undefined if unknown.\r\n */\r\nfunction readUsedSize(element, property) {\r\n\tvar value = helpers$1.getStyle(element, property);\r\n\tvar matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\r\n\treturn matches ? Number(matches[1]) : undefined;\r\n}\r\n\r\n/**\r\n * Initializes the canvas style and render size without modifying the canvas display size,\r\n * since responsiveness is handled by the controller.resize() method. The config is used\r\n * to determine the aspect ratio to apply in case no explicit height has been specified.\r\n */\r\nfunction initCanvas(canvas, config) {\r\n\tvar style = canvas.style;\r\n\r\n\t// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\r\n\t// returns null or '' if no explicit value has been set to the canvas attribute.\r\n\tvar renderHeight = canvas.getAttribute('height');\r\n\tvar renderWidth = canvas.getAttribute('width');\r\n\r\n\t// Chart.js modifies some canvas values that we want to restore on destroy\r\n\tcanvas[EXPANDO_KEY] = {\r\n\t\tinitial: {\r\n\t\t\theight: renderHeight,\r\n\t\t\twidth: renderWidth,\r\n\t\t\tstyle: {\r\n\t\t\t\tdisplay: style.display,\r\n\t\t\t\theight: style.height,\r\n\t\t\t\twidth: style.width\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Force canvas to display as block to avoid extra space caused by inline\r\n\t// elements, which would interfere with the responsive resize process.\r\n\t// https://github.com/chartjs/Chart.js/issues/2538\r\n\tstyle.display = style.display || 'block';\r\n\r\n\tif (renderWidth === null || renderWidth === '') {\r\n\t\tvar displayWidth = readUsedSize(canvas, 'width');\r\n\t\tif (displayWidth !== undefined) {\r\n\t\t\tcanvas.width = displayWidth;\r\n\t\t}\r\n\t}\r\n\r\n\tif (renderHeight === null || renderHeight === '') {\r\n\t\tif (canvas.style.height === '') {\r\n\t\t\t// If no explicit render height and style height, let's apply the aspect ratio,\r\n\t\t\t// which one can be specified by the user but also by charts as default option\r\n\t\t\t// (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\r\n\t\t\tcanvas.height = canvas.width / (config.options.aspectRatio || 2);\r\n\t\t} else {\r\n\t\t\tvar displayHeight = readUsedSize(canvas, 'height');\r\n\t\t\tif (displayWidth !== undefined) {\r\n\t\t\t\tcanvas.height = displayHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn canvas;\r\n}\r\n\r\n/**\r\n * Detects support for options object argument in addEventListener.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\r\n * @private\r\n */\r\nvar supportsEventListenerOptions = (function() {\r\n\tvar supports = false;\r\n\ttry {\r\n\t\tvar options = Object.defineProperty({}, 'passive', {\r\n\t\t\t// eslint-disable-next-line getter-return\r\n\t\t\tget: function() {\r\n\t\t\t\tsupports = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('e', null, options);\r\n\t} catch (e) {\r\n\t\t// continue regardless of error\r\n\t}\r\n\treturn supports;\r\n}());\r\n\r\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\r\n// https://github.com/chartjs/Chart.js/issues/4287\r\nvar eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\r\n\r\nfunction addListener(node, type, listener) {\r\n\tnode.addEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction removeListener(node, type, listener) {\r\n\tnode.removeEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction createEvent(type, chart, x, y, nativeEvent) {\r\n\treturn {\r\n\t\ttype: type,\r\n\t\tchart: chart,\r\n\t\tnative: nativeEvent || null,\r\n\t\tx: x !== undefined ? x : null,\r\n\t\ty: y !== undefined ? y : null,\r\n\t};\r\n}\r\n\r\nfunction fromNativeEvent(event, chart) {\r\n\tvar type = EVENT_TYPES[event.type] || event.type;\r\n\tvar pos = helpers$1.getRelativePosition(event, chart);\r\n\treturn createEvent(type, chart, pos.x, pos.y, event);\r\n}\r\n\r\nfunction throttled(fn, thisArg) {\r\n\tvar ticking = false;\r\n\tvar args = [];\r\n\r\n\treturn function() {\r\n\t\targs = Array.prototype.slice.call(arguments);\r\n\t\tthisArg = thisArg || this;\r\n\r\n\t\tif (!ticking) {\r\n\t\t\tticking = true;\r\n\t\t\thelpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tticking = false;\r\n\t\t\t\tfn.apply(thisArg, args);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction createDiv(cls) {\r\n\tvar el = document.createElement('div');\r\n\tel.className = cls || '';\r\n\treturn el;\r\n}\r\n\r\n// Implementation based on https://github.com/marcj/css-element-queries\r\nfunction createResizer(handler) {\r\n\tvar maxSize = 1000000;\r\n\r\n\t// NOTE(SB) Don't use innerHTML because it could be considered unsafe.\r\n\t// https://github.com/chartjs/Chart.js/issues/5902\r\n\tvar resizer = createDiv(CSS_SIZE_MONITOR);\r\n\tvar expand = createDiv(CSS_SIZE_MONITOR + '-expand');\r\n\tvar shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');\r\n\r\n\texpand.appendChild(createDiv());\r\n\tshrink.appendChild(createDiv());\r\n\r\n\tresizer.appendChild(expand);\r\n\tresizer.appendChild(shrink);\r\n\tresizer._reset = function() {\r\n\t\texpand.scrollLeft = maxSize;\r\n\t\texpand.scrollTop = maxSize;\r\n\t\tshrink.scrollLeft = maxSize;\r\n\t\tshrink.scrollTop = maxSize;\r\n\t};\r\n\r\n\tvar onScroll = function() {\r\n\t\tresizer._reset();\r\n\t\thandler();\r\n\t};\r\n\r\n\taddListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\r\n\taddListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\r\n\r\n\treturn resizer;\r\n}\r\n\r\n// https://davidwalsh.name/detect-node-insertion\r\nfunction watchForRender(node, handler) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\tvar proxy = expando.renderProxy = function(e) {\r\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\r\n\t\t\thandler();\r\n\t\t}\r\n\t};\r\n\r\n\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\taddListener(node, type, proxy);\r\n\t});\r\n\r\n\t// #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class\r\n\t// is removed then added back immediately (same animation frame?). Accessing the\r\n\t// `offsetParent` property will force a reflow and re-evaluate the CSS animation.\r\n\t// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics\r\n\t// https://github.com/chartjs/Chart.js/issues/4737\r\n\texpando.reflow = !!node.offsetParent;\r\n\r\n\tnode.classList.add(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction unwatchForRender(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar proxy = expando.renderProxy;\r\n\r\n\tif (proxy) {\r\n\t\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\t\tremoveListener(node, type, proxy);\r\n\t\t});\r\n\r\n\t\tdelete expando.renderProxy;\r\n\t}\r\n\r\n\tnode.classList.remove(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction addResizeListener(node, listener, chart) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\r\n\t// Let's keep track of this added resizer and thus avoid DOM query when removing it.\r\n\tvar resizer = expando.resizer = createResizer(throttled(function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = chart.options.maintainAspectRatio && node.parentNode;\r\n\t\t\tvar w = container ? container.clientWidth : 0;\r\n\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\tif (container && container.clientWidth < w && chart.canvas) {\r\n\t\t\t\t// If the container size shrank during chart resize, let's assume\r\n\t\t\t\t// scrollbar appeared. So we resize again with the scrollbar visible -\r\n\t\t\t\t// effectively making chart smaller and the scrollbar hidden again.\r\n\t\t\t\t// Because we are inside `throttled`, and currently `ticking`, scroll\r\n\t\t\t\t// events are ignored during this whole 2 resize process.\r\n\t\t\t\t// If we assumed wrong and something else happened, we are resizing\r\n\t\t\t\t// twice in a frame (potential performance issue)\r\n\t\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\t}\r\n\t\t}\r\n\t}));\r\n\r\n\t// The resizer needs to be attached to the node parent, so we first need to be\r\n\t// sure that `node` is attached to the DOM before injecting the resizer element.\r\n\twatchForRender(node, function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = node.parentNode;\r\n\t\t\tif (container && container !== resizer.parentNode) {\r\n\t\t\t\tcontainer.insertBefore(resizer, container.firstChild);\r\n\t\t\t}\r\n\r\n\t\t\t// The container size might have changed, let's reset the resizer state.\r\n\t\t\tresizer._reset();\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction removeResizeListener(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar resizer = expando.resizer;\r\n\r\n\tdelete expando.resizer;\r\n\tunwatchForRender(node);\r\n\r\n\tif (resizer && resizer.parentNode) {\r\n\t\tresizer.parentNode.removeChild(resizer);\r\n\t}\r\n}\r\n\r\n/**\r\n * Injects CSS styles inline if the styles are not already present.\r\n * @param {HTMLDocument|ShadowRoot} rootNode - the node to contain the <style>.\r\n * @param {string} css - the CSS to be injected.\r\n */\r\nfunction injectCSS(rootNode, css) {\r\n\t// https://stackoverflow.com/q/3922139\r\n\tvar expando = rootNode[EXPANDO_KEY] || (rootNode[EXPANDO_KEY] = {});\r\n\tif (!expando.containsStyles) {\r\n\t\texpando.containsStyles = true;\r\n\t\tcss = '/* Chart.js */\\n' + css;\r\n\t\tvar style = document.createElement('style');\r\n\t\tstyle.setAttribute('type', 'text/css');\r\n\t\tstyle.appendChild(document.createTextNode(css));\r\n\t\trootNode.appendChild(style);\r\n\t}\r\n}\r\n\r\nvar platform_dom$2 = {\r\n\t/**\r\n\t * When `true`, prevents the automatic injection of the stylesheet required to\r\n\t * correctly detect when the chart is added to the DOM and then resized. This\r\n\t * switch has been added to allow external stylesheet (`dist/Chart(.min)?.js`)\r\n\t * to be manually imported to make this library compatible with any CSP.\r\n\t * See https://github.com/chartjs/Chart.js/issues/5208\r\n\t */\r\n\tdisableCSSInjection: false,\r\n\r\n\t/**\r\n\t * This property holds whether this platform is enabled for the current environment.\r\n\t * Currently used by platform.js to select the proper implementation.\r\n\t * @private\r\n\t */\r\n\t_enabled: typeof window !== 'undefined' && typeof document !== 'undefined',\r\n\r\n\t/**\r\n\t * Initializes resources that depend on platform options.\r\n\t * @param {HTMLCanvasElement} canvas - The Canvas element.\r\n\t * @private\r\n\t */\r\n\t_ensureLoaded: function(canvas) {\r\n\t\tif (!this.disableCSSInjection) {\r\n\t\t\t// If the canvas is in a shadow DOM, then the styles must also be inserted\r\n\t\t\t// into the same shadow DOM.\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5763\r\n\t\t\tvar root = canvas.getRootNode ? canvas.getRootNode() : document;\r\n\t\t\tvar targetNode = root.host ? root : document.head;\r\n\t\t\tinjectCSS(targetNode, stylesheet);\r\n\t\t}\r\n\t},\r\n\r\n\tacquireContext: function(item, config) {\r\n\t\tif (typeof item === 'string') {\r\n\t\t\titem = document.getElementById(item);\r\n\t\t} else if (item.length) {\r\n\t\t\t// Support for array based queries (such as jQuery)\r\n\t\t\titem = item[0];\r\n\t\t}\r\n\r\n\t\tif (item && item.canvas) {\r\n\t\t\t// Support for any object associated to a canvas (including a context2d)\r\n\t\t\titem = item.canvas;\r\n\t\t}\r\n\r\n\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\r\n\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\r\n\t\t// https://github.com/chartjs/Chart.js/issues/2807\r\n\t\tvar context = item && item.getContext && item.getContext('2d');\r\n\r\n\t\t// `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is\r\n\t\t// inside an iframe or when running in a protected environment. We could guess the\r\n\t\t// types from their toString() value but let's keep things flexible and assume it's\r\n\t\t// a sufficient condition if the item has a context2D which has item as `canvas`.\r\n\t\t// https://github.com/chartjs/Chart.js/issues/3887\r\n\t\t// https://github.com/chartjs/Chart.js/issues/4102\r\n\t\t// https://github.com/chartjs/Chart.js/issues/4152\r\n\t\tif (context && context.canvas === item) {\r\n\t\t\t// Load platform resources on first chart creation, to make it possible to\r\n\t\t\t// import the library before setting platform options.\r\n\t\t\tthis._ensureLoaded(item);\r\n\t\t\tinitCanvas(item, config);\r\n\t\t\treturn context;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\treleaseContext: function(context) {\r\n\t\tvar canvas = context.canvas;\r\n\t\tif (!canvas[EXPANDO_KEY]) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar initial = canvas[EXPANDO_KEY].initial;\r\n\t\t['height', 'width'].forEach(function(prop) {\r\n\t\t\tvar value = initial[prop];\r\n\t\t\tif (helpers$1.isNullOrUndef(value)) {\r\n\t\t\t\tcanvas.removeAttribute(prop);\r\n\t\t\t} else {\r\n\t\t\t\tcanvas.setAttribute(prop, value);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\thelpers$1.each(initial.style || {}, function(value, key) {\r\n\t\t\tcanvas.style[key] = value;\r\n\t\t});\r\n\r\n\t\t// The canvas render size might have been changed (and thus the state stack discarded),\r\n\t\t// we can't use save() and restore() to restore the initial state. So make sure that at\r\n\t\t// least the canvas context is reset to the default state by setting the canvas width.\r\n\t\t// https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\r\n\t\t// eslint-disable-next-line no-self-assign\r\n\t\tcanvas.width = canvas.width;\r\n\r\n\t\tdelete canvas[EXPANDO_KEY];\r\n\t},\r\n\r\n\taddEventListener: function(chart, type, listener) {\r\n\t\tvar canvas = chart.canvas;\r\n\t\tif (type === 'resize') {\r\n\t\t\t// Note: the resize event is not supported on all browsers.\r\n\t\t\taddResizeListener(canvas, listener, chart);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});\r\n\t\tvar proxies = expando.proxies || (expando.proxies = {});\r\n\t\tvar proxy = proxies[chart.id + '_' + type] = function(event) {\r\n\t\t\tlistener(fromNativeEvent(event, chart));\r\n\t\t};\r\n\r\n\t\taddListener(canvas, type, proxy);\r\n\t},\r\n\r\n\tremoveEventListener: function(chart, type, listener) {\r\n\t\tvar canvas = chart.canvas;\r\n\t\tif (type === 'resize') {\r\n\t\t\t// Note: the resize event is not supported on all browsers.\r\n\t\t\tremoveResizeListener(canvas);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar expando = listener[EXPANDO_KEY] || {};\r\n\t\tvar proxies = expando.proxies || {};\r\n\t\tvar proxy = proxies[chart.id + '_' + type];\r\n\t\tif (!proxy) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tremoveListener(canvas, type, proxy);\r\n\t}\r\n};\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use EventTarget.addEventListener instead.\r\n * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\r\n * @function Chart.helpers.addEvent\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers$1.addEvent = addListener;\r\n\r\n/**\r\n * Provided for backward compatibility, use EventTarget.removeEventListener instead.\r\n * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\r\n * @function Chart.helpers.removeEvent\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers$1.removeEvent = removeListener;\n\n// @TODO Make possible to select another platform at build time.\r\nvar implementation = platform_dom$2._enabled ? platform_dom$2 : platform_basic;\r\n\r\n/**\r\n * @namespace Chart.platform\r\n * @see https://chartjs.gitbooks.io/proposals/content/Platform.html\r\n * @since 2.4.0\r\n */\r\nvar platform = helpers$1.extend({\r\n\t/**\r\n\t * @since 2.7.0\r\n\t */\r\n\tinitialize: function() {},\r\n\r\n\t/**\r\n\t * Called at chart construction time, returns a context2d instance implementing\r\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\r\n\t * @param {*} item - The native item from which to acquire context (platform specific)\r\n\t * @param {object} options - The chart options\r\n\t * @returns {CanvasRenderingContext2D} context2d instance\r\n\t */\r\n\tacquireContext: function() {},\r\n\r\n\t/**\r\n\t * Called at chart destruction time, releases any resources associated to the context\r\n\t * previously returned by the acquireContext() method.\r\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\r\n\t * @returns {boolean} true if the method succeeded, else false\r\n\t */\r\n\treleaseContext: function() {},\r\n\r\n\t/**\r\n\t * Registers the specified listener on the given chart.\r\n\t * @param {Chart} chart - Chart from which to listen for event\r\n\t * @param {string} type - The ({@link IEvent}) type to listen for\r\n\t * @param {function} listener - Receives a notification (an object that implements\r\n\t * the {@link IEvent} interface) when an event of the specified type occurs.\r\n\t */\r\n\taddEventListener: function() {},\r\n\r\n\t/**\r\n\t * Removes the specified listener previously registered with addEventListener.\r\n\t * @param {Chart} chart - Chart from which to remove the listener\r\n\t * @param {string} type - The ({@link IEvent}) type to remove\r\n\t * @param {function} listener - The listener function to remove from the event target.\r\n\t */\r\n\tremoveEventListener: function() {}\r\n\r\n}, implementation);\n\ncore_defaults._set('global', {\r\n\tplugins: {}\r\n});\r\n\r\n/**\r\n * The plugin service singleton\r\n * @namespace Chart.plugins\r\n * @since 2.1.0\r\n */\r\nvar core_plugins = {\r\n\t/**\r\n\t * Globally registered plugins.\r\n\t * @private\r\n\t */\r\n\t_plugins: [],\r\n\r\n\t/**\r\n\t * This identifier is used to invalidate the descriptors cache attached to each chart\r\n\t * when a global plugin is registered or unregistered. In this case, the cache ID is\r\n\t * incremented and descriptors are regenerated during following API calls.\r\n\t * @private\r\n\t */\r\n\t_cacheId: 0,\r\n\r\n\t/**\r\n\t * Registers the given plugin(s) if not already registered.\r\n\t * @param {IPlugin[]|IPlugin} plugins plugin instance(s).\r\n\t */\r\n\tregister: function(plugins) {\r\n\t\tvar p = this._plugins;\r\n\t\t([]).concat(plugins).forEach(function(plugin) {\r\n\t\t\tif (p.indexOf(plugin) === -1) {\r\n\t\t\t\tp.push(plugin);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._cacheId++;\r\n\t},\r\n\r\n\t/**\r\n\t * Unregisters the given plugin(s) only if registered.\r\n\t * @param {IPlugin[]|IPlugin} plugins plugin instance(s).\r\n\t */\r\n\tunregister: function(plugins) {\r\n\t\tvar p = this._plugins;\r\n\t\t([]).concat(plugins).forEach(function(plugin) {\r\n\t\t\tvar idx = p.indexOf(plugin);\r\n\t\t\tif (idx !== -1) {\r\n\t\t\t\tp.splice(idx, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._cacheId++;\r\n\t},\r\n\r\n\t/**\r\n\t * Remove all registered plugins.\r\n\t * @since 2.1.5\r\n\t */\r\n\tclear: function() {\r\n\t\tthis._plugins = [];\r\n\t\tthis._cacheId++;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the number of registered plugins?\r\n\t * @returns {number}\r\n\t * @since 2.1.5\r\n\t */\r\n\tcount: function() {\r\n\t\treturn this._plugins.length;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns all registered plugin instances.\r\n\t * @returns {IPlugin[]} array of plugin objects.\r\n\t * @since 2.1.5\r\n\t */\r\n\tgetAll: function() {\r\n\t\treturn this._plugins;\r\n\t},\r\n\r\n\t/**\r\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\r\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\r\n\t * returned value can be used, for instance, to interrupt the current action.\r\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\r\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\r\n\t * @param {Array} [args] - Extra arguments to apply to the hook call.\r\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\r\n\t */\r\n\tnotify: function(chart, hook, args) {\r\n\t\tvar descriptors = this.descriptors(chart);\r\n\t\tvar ilen = descriptors.length;\r\n\t\tvar i, descriptor, plugin, params, method;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tdescriptor = descriptors[i];\r\n\t\t\tplugin = descriptor.plugin;\r\n\t\t\tmethod = plugin[hook];\r\n\t\t\tif (typeof method === 'function') {\r\n\t\t\t\tparams = [chart].concat(args || []);\r\n\t\t\t\tparams.push(descriptor.options);\r\n\t\t\t\tif (method.apply(plugin, params) === false) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns descriptors of enabled plugins for the given chart.\r\n\t * @returns {object[]} [{ plugin, options }]\r\n\t * @private\r\n\t */\r\n\tdescriptors: function(chart) {\r\n\t\tvar cache = chart.$plugins || (chart.$plugins = {});\r\n\t\tif (cache.id === this._cacheId) {\r\n\t\t\treturn cache.descriptors;\r\n\t\t}\r\n\r\n\t\tvar plugins = [];\r\n\t\tvar descriptors = [];\r\n\t\tvar config = (chart && chart.config) || {};\r\n\t\tvar options = (config.options && config.options.plugins) || {};\r\n\r\n\t\tthis._plugins.concat(config.plugins || []).forEach(function(plugin) {\r\n\t\t\tvar idx = plugins.indexOf(plugin);\r\n\t\t\tif (idx !== -1) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar id = plugin.id;\r\n\t\t\tvar opts = options[id];\r\n\t\t\tif (opts === false) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (opts === true) {\r\n\t\t\t\topts = helpers$1.clone(core_defaults.global.plugins[id]);\r\n\t\t\t}\r\n\r\n\t\t\tplugins.push(plugin);\r\n\t\t\tdescriptors.push({\r\n\t\t\t\tplugin: plugin,\r\n\t\t\t\toptions: opts || {}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tcache.descriptors = descriptors;\r\n\t\tcache.id = this._cacheId;\r\n\t\treturn descriptors;\r\n\t},\r\n\r\n\t/**\r\n\t * Invalidates cache for the given chart: descriptors hold a reference on plugin option,\r\n\t * but in some cases, this reference can be changed by the user when updating options.\r\n\t * https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\r\n\t * @private\r\n\t */\r\n\t_invalidate: function(chart) {\r\n\t\tdelete chart.$plugins;\r\n\t}\r\n};\n\nvar core_scaleService = {\r\n\t// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then\r\n\t// use the new chart options to grab the correct scale\r\n\tconstructors: {},\r\n\t// Use a registration function so that we can move to an ES6 map when we no longer need to support\r\n\t// old browsers\r\n\r\n\t// Scale config defaults\r\n\tdefaults: {},\r\n\tregisterScaleType: function(type, scaleConstructor, scaleDefaults) {\r\n\t\tthis.constructors[type] = scaleConstructor;\r\n\t\tthis.defaults[type] = helpers$1.clone(scaleDefaults);\r\n\t},\r\n\tgetScaleConstructor: function(type) {\r\n\t\treturn this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;\r\n\t},\r\n\tgetScaleDefaults: function(type) {\r\n\t\t// Return the scale defaults merged with the global settings so that we always use the latest ones\r\n\t\treturn this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};\r\n\t},\r\n\tupdateScaleDefaults: function(type, additions) {\r\n\t\tvar me = this;\r\n\t\tif (me.defaults.hasOwnProperty(type)) {\r\n\t\t\tme.defaults[type] = helpers$1.extend(me.defaults[type], additions);\r\n\t\t}\r\n\t},\r\n\taddScalesToLayout: function(chart) {\r\n\t\t// Adds each scale to the chart.boxes array to be sized accordingly\r\n\t\thelpers$1.each(chart.scales, function(scale) {\r\n\t\t\t// Set ILayoutItem parameters for backwards compatibility\r\n\t\t\tscale.fullWidth = scale.options.fullWidth;\r\n\t\t\tscale.position = scale.options.position;\r\n\t\t\tscale.weight = scale.options.weight;\r\n\t\t\tcore_layouts.addBox(chart, scale);\r\n\t\t});\r\n\t}\r\n};\n\nvar valueOrDefault$8 = helpers$1.valueOrDefault;\r\nvar getRtlHelper = helpers$1.rtl.getRtlAdapter;\r\n\r\ncore_defaults._set('global', {\r\n\ttooltips: {\r\n\t\tenabled: true,\r\n\t\tcustom: null,\r\n\t\tmode: 'nearest',\r\n\t\tposition: 'average',\r\n\t\tintersect: true,\r\n\t\tbackgroundColor: 'rgba(0,0,0,0.8)',\r\n\t\ttitleFontStyle: 'bold',\r\n\t\ttitleSpacing: 2,\r\n\t\ttitleMarginBottom: 6,\r\n\t\ttitleFontColor: '#fff',\r\n\t\ttitleAlign: 'left',\r\n\t\tbodySpacing: 2,\r\n\t\tbodyFontColor: '#fff',\r\n\t\tbodyAlign: 'left',\r\n\t\tfooterFontStyle: 'bold',\r\n\t\tfooterSpacing: 2,\r\n\t\tfooterMarginTop: 6,\r\n\t\tfooterFontColor: '#fff',\r\n\t\tfooterAlign: 'left',\r\n\t\tyPadding: 6,\r\n\t\txPadding: 6,\r\n\t\tcaretPadding: 2,\r\n\t\tcaretSize: 5,\r\n\t\tcornerRadius: 6,\r\n\t\tmultiKeyBackground: '#fff',\r\n\t\tdisplayColors: true,\r\n\t\tborderColor: 'rgba(0,0,0,0)',\r\n\t\tborderWidth: 0,\r\n\t\tcallbacks: {\r\n\t\t\t// Args are: (tooltipItems, data)\r\n\t\t\tbeforeTitle: helpers$1.noop,\r\n\t\t\ttitle: function(tooltipItems, data) {\r\n\t\t\t\tvar title = '';\r\n\t\t\t\tvar labels = data.labels;\r\n\t\t\t\tvar labelCount = labels ? labels.length : 0;\r\n\r\n\t\t\t\tif (tooltipItems.length > 0) {\r\n\t\t\t\t\tvar item = tooltipItems[0];\r\n\t\t\t\t\tif (item.label) {\r\n\t\t\t\t\t\ttitle = item.label;\r\n\t\t\t\t\t} else if (item.xLabel) {\r\n\t\t\t\t\t\ttitle = item.xLabel;\r\n\t\t\t\t\t} else if (labelCount > 0 && item.index < labelCount) {\r\n\t\t\t\t\t\ttitle = labels[item.index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn title;\r\n\t\t\t},\r\n\t\t\tafterTitle: helpers$1.noop,\r\n\r\n\t\t\t// Args are: (tooltipItems, data)\r\n\t\t\tbeforeBody: helpers$1.noop,\r\n\r\n\t\t\t// Args are: (tooltipItem, data)\r\n\t\t\tbeforeLabel: helpers$1.noop,\r\n\t\t\tlabel: function(tooltipItem, data) {\r\n\t\t\t\tvar label = data.datasets[tooltipItem.datasetIndex].label || '';\r\n\r\n\t\t\t\tif (label) {\r\n\t\t\t\t\tlabel += ': ';\r\n\t\t\t\t}\r\n\t\t\t\tif (!helpers$1.isNullOrUndef(tooltipItem.value)) {\r\n\t\t\t\t\tlabel += tooltipItem.value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlabel += tooltipItem.yLabel;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t},\r\n\t\t\tlabelColor: function(tooltipItem, chart) {\r\n\t\t\t\tvar meta = chart.getDatasetMeta(tooltipItem.datasetIndex);\r\n\t\t\t\tvar activeElement = meta.data[tooltipItem.index];\r\n\t\t\t\tvar view = activeElement._view;\r\n\t\t\t\treturn {\r\n\t\t\t\t\tborderColor: view.borderColor,\r\n\t\t\t\t\tbackgroundColor: view.backgroundColor\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tlabelTextColor: function() {\r\n\t\t\t\treturn this._options.bodyFontColor;\r\n\t\t\t},\r\n\t\t\tafterLabel: helpers$1.noop,\r\n\r\n\t\t\t// Args are: (tooltipItems, data)\r\n\t\t\tafterBody: helpers$1.noop,\r\n\r\n\t\t\t// Args are: (tooltipItems, data)\r\n\t\t\tbeforeFooter: helpers$1.noop,\r\n\t\t\tfooter: helpers$1.noop,\r\n\t\t\tafterFooter: helpers$1.noop\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar positioners = {\r\n\t/**\r\n\t * Average mode places the tooltip at the average position of the elements shown\r\n\t * @function Chart.Tooltip.positioners.average\r\n\t * @param elements {ChartElement[]} the elements being displayed in the tooltip\r\n\t * @returns {object} tooltip position\r\n\t */\r\n\taverage: function(elements) {\r\n\t\tif (!elements.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar i, len;\r\n\t\tvar x = 0;\r\n\t\tvar y = 0;\r\n\t\tvar count = 0;\r\n\r\n\t\tfor (i = 0, len = elements.length; i < len; ++i) {\r\n\t\t\tvar el = elements[i];\r\n\t\t\tif (el && el.hasValue()) {\r\n\t\t\t\tvar pos = el.tooltipPosition();\r\n\t\t\t\tx += pos.x;\r\n\t\t\t\ty += pos.y;\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tx: x / count,\r\n\t\t\ty: y / count\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Gets the tooltip position nearest of the item nearest to the event position\r\n\t * @function Chart.Tooltip.positioners.nearest\r\n\t * @param elements {Chart.Element[]} the tooltip elements\r\n\t * @param eventPosition {object} the position of the event in canvas coordinates\r\n\t * @returns {object} the tooltip position\r\n\t */\r\n\tnearest: function(elements, eventPosition) {\r\n\t\tvar x = eventPosition.x;\r\n\t\tvar y = eventPosition.y;\r\n\t\tvar minDistance = Number.POSITIVE_INFINITY;\r\n\t\tvar i, len, nearestElement;\r\n\r\n\t\tfor (i = 0, len = elements.length; i < len; ++i) {\r\n\t\t\tvar el = elements[i];\r\n\t\t\tif (el && el.hasValue()) {\r\n\t\t\t\tvar center = el.getCenterPoint();\r\n\t\t\t\tvar d = helpers$1.distanceBetweenPoints(eventPosition, center);\r\n\r\n\t\t\t\tif (d < minDistance) {\r\n\t\t\t\t\tminDistance = d;\r\n\t\t\t\t\tnearestElement = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (nearestElement) {\r\n\t\t\tvar tp = nearestElement.tooltipPosition();\r\n\t\t\tx = tp.x;\r\n\t\t\ty = tp.y;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tx: x,\r\n\t\t\ty: y\r\n\t\t};\r\n\t}\r\n};\r\n\r\n// Helper to push or concat based on if the 2nd parameter is an array or not\r\nfunction pushOrConcat(base, toPush) {\r\n\tif (toPush) {\r\n\t\tif (helpers$1.isArray(toPush)) {\r\n\t\t\t// base = base.concat(toPush);\r\n\t\t\tArray.prototype.push.apply(base, toPush);\r\n\t\t} else {\r\n\t\t\tbase.push(toPush);\r\n\t\t}\r\n\t}\r\n\r\n\treturn base;\r\n}\r\n\r\n/**\r\n * Returns array of strings split by newline\r\n * @param {string} value - The value to split by newline.\r\n * @returns {string[]} value if newline present - Returned from String split() method\r\n * @function\r\n */\r\nfunction splitNewlines(str) {\r\n\tif ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\r\n\t\treturn str.split('\\n');\r\n\t}\r\n\treturn str;\r\n}\r\n\r\n\r\n/**\r\n * Private helper to create a tooltip item model\r\n * @param element - the chart element (point, arc, bar) to create the tooltip item for\r\n * @return new tooltip item\r\n */\r\nfunction createTooltipItem(element) {\r\n\tvar xScale = element._xScale;\r\n\tvar yScale = element._yScale || element._scale; // handle radar || polarArea charts\r\n\tvar index = element._index;\r\n\tvar datasetIndex = element._datasetIndex;\r\n\tvar controller = element._chart.getDatasetMeta(datasetIndex).controller;\r\n\tvar indexScale = controller._getIndexScale();\r\n\tvar valueScale = controller._getValueScale();\r\n\r\n\treturn {\r\n\t\txLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',\r\n\t\tyLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',\r\n\t\tlabel: indexScale ? '' + indexScale.getLabelForIndex(index, datasetIndex) : '',\r\n\t\tvalue: valueScale ? '' + valueScale.getLabelForIndex(index, datasetIndex) : '',\r\n\t\tindex: index,\r\n\t\tdatasetIndex: datasetIndex,\r\n\t\tx: element._model.x,\r\n\t\ty: element._model.y\r\n\t};\r\n}\r\n\r\n/**\r\n * Helper to get the reset model for the tooltip\r\n * @param tooltipOpts {object} the tooltip options\r\n */\r\nfunction getBaseModel(tooltipOpts) {\r\n\tvar globalDefaults = core_defaults.global;\r\n\r\n\treturn {\r\n\t\t// Positioning\r\n\t\txPadding: tooltipOpts.xPadding,\r\n\t\tyPadding: tooltipOpts.yPadding,\r\n\t\txAlign: tooltipOpts.xAlign,\r\n\t\tyAlign: tooltipOpts.yAlign,\r\n\r\n\t\t// Drawing direction and text direction\r\n\t\trtl: tooltipOpts.rtl,\r\n\t\ttextDirection: tooltipOpts.textDirection,\r\n\r\n\t\t// Body\r\n\t\tbodyFontColor: tooltipOpts.bodyFontColor,\r\n\t\t_bodyFontFamily: valueOrDefault$8(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),\r\n\t\t_bodyFontStyle: valueOrDefault$8(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),\r\n\t\t_bodyAlign: tooltipOpts.bodyAlign,\r\n\t\tbodyFontSize: valueOrDefault$8(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),\r\n\t\tbodySpacing: tooltipOpts.bodySpacing,\r\n\r\n\t\t// Title\r\n\t\ttitleFontColor: tooltipOpts.titleFontColor,\r\n\t\t_titleFontFamily: valueOrDefault$8(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),\r\n\t\t_titleFontStyle: valueOrDefault$8(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),\r\n\t\ttitleFontSize: valueOrDefault$8(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),\r\n\t\t_titleAlign: tooltipOpts.titleAlign,\r\n\t\ttitleSpacing: tooltipOpts.titleSpacing,\r\n\t\ttitleMarginBottom: tooltipOpts.titleMarginBottom,\r\n\r\n\t\t// Footer\r\n\t\tfooterFontColor: tooltipOpts.footerFontColor,\r\n\t\t_footerFontFamily: valueOrDefault$8(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),\r\n\t\t_footerFontStyle: valueOrDefault$8(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),\r\n\t\tfooterFontSize: valueOrDefault$8(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),\r\n\t\t_footerAlign: tooltipOpts.footerAlign,\r\n\t\tfooterSpacing: tooltipOpts.footerSpacing,\r\n\t\tfooterMarginTop: tooltipOpts.footerMarginTop,\r\n\r\n\t\t// Appearance\r\n\t\tcaretSize: tooltipOpts.caretSize,\r\n\t\tcornerRadius: tooltipOpts.cornerRadius,\r\n\t\tbackgroundColor: tooltipOpts.backgroundColor,\r\n\t\topacity: 0,\r\n\t\tlegendColorBackground: tooltipOpts.multiKeyBackground,\r\n\t\tdisplayColors: tooltipOpts.displayColors,\r\n\t\tborderColor: tooltipOpts.borderColor,\r\n\t\tborderWidth: tooltipOpts.borderWidth\r\n\t};\r\n}\r\n\r\n/**\r\n * Get the size of the tooltip\r\n */\r\nfunction getTooltipSize(tooltip, model) {\r\n\tvar ctx = tooltip._chart.ctx;\r\n\r\n\tvar height = model.yPadding * 2; // Tooltip Padding\r\n\tvar width = 0;\r\n\r\n\t// Count of all lines in the body\r\n\tvar body = model.body;\r\n\tvar combinedBodyLength = body.reduce(function(count, bodyItem) {\r\n\t\treturn count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;\r\n\t}, 0);\r\n\tcombinedBodyLength += model.beforeBody.length + model.afterBody.length;\r\n\r\n\tvar titleLineCount = model.title.length;\r\n\tvar footerLineCount = model.footer.length;\r\n\tvar titleFontSize = model.titleFontSize;\r\n\tvar bodyFontSize = model.bodyFontSize;\r\n\tvar footerFontSize = model.footerFontSize;\r\n\r\n\theight += titleLineCount * titleFontSize; // Title Lines\r\n\theight += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing\r\n\theight += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin\r\n\theight += combinedBodyLength * bodyFontSize; // Body Lines\r\n\theight += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing\r\n\theight += footerLineCount ? model.footerMarginTop : 0; // Footer Margin\r\n\theight += footerLineCount * (footerFontSize); // Footer Lines\r\n\theight += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing\r\n\r\n\t// Title width\r\n\tvar widthPadding = 0;\r\n\tvar maxLineWidth = function(line) {\r\n\t\twidth = Math.max(width, ctx.measureText(line).width + widthPadding);\r\n\t};\r\n\r\n\tctx.font = helpers$1.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);\r\n\thelpers$1.each(model.title, maxLineWidth);\r\n\r\n\t// Body width\r\n\tctx.font = helpers$1.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);\r\n\thelpers$1.each(model.beforeBody.concat(model.afterBody), maxLineWidth);\r\n\r\n\t// Body lines may include some extra width due to the color box\r\n\twidthPadding = model.displayColors ? (bodyFontSize + 2) : 0;\r\n\thelpers$1.each(body, function(bodyItem) {\r\n\t\thelpers$1.each(bodyItem.before, maxLineWidth);\r\n\t\thelpers$1.each(bodyItem.lines, maxLineWidth);\r\n\t\thelpers$1.each(bodyItem.after, maxLineWidth);\r\n\t});\r\n\r\n\t// Reset back to 0\r\n\twidthPadding = 0;\r\n\r\n\t// Footer width\r\n\tctx.font = helpers$1.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);\r\n\thelpers$1.each(model.footer, maxLineWidth);\r\n\r\n\t// Add padding\r\n\twidth += 2 * model.xPadding;\r\n\r\n\treturn {\r\n\t\twidth: width,\r\n\t\theight: height\r\n\t};\r\n}\r\n\r\n/**\r\n * Helper to get the alignment of a tooltip given the size\r\n */\r\nfunction determineAlignment(tooltip, size) {\r\n\tvar model = tooltip._model;\r\n\tvar chart = tooltip._chart;\r\n\tvar chartArea = tooltip._chart.chartArea;\r\n\tvar xAlign = 'center';\r\n\tvar yAlign = 'center';\r\n\r\n\tif (model.y < size.height) {\r\n\t\tyAlign = 'top';\r\n\t} else if (model.y > (chart.height - size.height)) {\r\n\t\tyAlign = 'bottom';\r\n\t}\r\n\r\n\tvar lf, rf; // functions to determine left, right alignment\r\n\tvar olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart\r\n\tvar yf; // function to get the y alignment if the tooltip goes outside of the left or right edges\r\n\tvar midX = (chartArea.left + chartArea.right) / 2;\r\n\tvar midY = (chartArea.top + chartArea.bottom) / 2;\r\n\r\n\tif (yAlign === 'center') {\r\n\t\tlf = function(x) {\r\n\t\t\treturn x <= midX;\r\n\t\t};\r\n\t\trf = function(x) {\r\n\t\t\treturn x > midX;\r\n\t\t};\r\n\t} else {\r\n\t\tlf = function(x) {\r\n\t\t\treturn x <= (size.width / 2);\r\n\t\t};\r\n\t\trf = function(x) {\r\n\t\t\treturn x >= (chart.width - (size.width / 2));\r\n\t\t};\r\n\t}\r\n\r\n\tolf = function(x) {\r\n\t\treturn x + size.width + model.caretSize + model.caretPadding > chart.width;\r\n\t};\r\n\torf = function(x) {\r\n\t\treturn x - size.width - model.caretSize - model.caretPadding < 0;\r\n\t};\r\n\tyf = function(y) {\r\n\t\treturn y <= midY ? 'top' : 'bottom';\r\n\t};\r\n\r\n\tif (lf(model.x)) {\r\n\t\txAlign = 'left';\r\n\r\n\t\t// Is tooltip too wide and goes over the right side of the chart.?\r\n\t\tif (olf(model.x)) {\r\n\t\t\txAlign = 'center';\r\n\t\t\tyAlign = yf(model.y);\r\n\t\t}\r\n\t} else if (rf(model.x)) {\r\n\t\txAlign = 'right';\r\n\r\n\t\t// Is tooltip too wide and goes outside left edge of canvas?\r\n\t\tif (orf(model.x)) {\r\n\t\t\txAlign = 'center';\r\n\t\t\tyAlign = yf(model.y);\r\n\t\t}\r\n\t}\r\n\r\n\tvar opts = tooltip._options;\r\n\treturn {\r\n\t\txAlign: opts.xAlign ? opts.xAlign : xAlign,\r\n\t\tyAlign: opts.yAlign ? opts.yAlign : yAlign\r\n\t};\r\n}\r\n\r\n/**\r\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\r\n */\r\nfunction getBackgroundPoint(vm, size, alignment, chart) {\r\n\t// Background Position\r\n\tvar x = vm.x;\r\n\tvar y = vm.y;\r\n\r\n\tvar caretSize = vm.caretSize;\r\n\tvar caretPadding = vm.caretPadding;\r\n\tvar cornerRadius = vm.cornerRadius;\r\n\tvar xAlign = alignment.xAlign;\r\n\tvar yAlign = alignment.yAlign;\r\n\tvar paddingAndSize = caretSize + caretPadding;\r\n\tvar radiusAndPadding = cornerRadius + caretPadding;\r\n\r\n\tif (xAlign === 'right') {\r\n\t\tx -= size.width;\r\n\t} else if (xAlign === 'center') {\r\n\t\tx -= (size.width / 2);\r\n\t\tif (x + size.width > chart.width) {\r\n\t\t\tx = chart.width - size.width;\r\n\t\t}\r\n\t\tif (x < 0) {\r\n\t\t\tx = 0;\r\n\t\t}\r\n\t}\r\n\r\n\tif (yAlign === 'top') {\r\n\t\ty += paddingAndSize;\r\n\t} else if (yAlign === 'bottom') {\r\n\t\ty -= size.height + paddingAndSize;\r\n\t} else {\r\n\t\ty -= (size.height / 2);\r\n\t}\r\n\r\n\tif (yAlign === 'center') {\r\n\t\tif (xAlign === 'left') {\r\n\t\t\tx += paddingAndSize;\r\n\t\t} else if (xAlign === 'right') {\r\n\t\t\tx -= paddingAndSize;\r\n\t\t}\r\n\t} else if (xAlign === 'left') {\r\n\t\tx -= radiusAndPadding;\r\n\t} else if (xAlign === 'right') {\r\n\t\tx += radiusAndPadding;\r\n\t}\r\n\r\n\treturn {\r\n\t\tx: x,\r\n\t\ty: y\r\n\t};\r\n}\r\n\r\nfunction getAlignedX(vm, align) {\r\n\treturn align === 'center'\r\n\t\t? vm.x + vm.width / 2\r\n\t\t: align === 'right'\r\n\t\t\t? vm.x + vm.width - vm.xPadding\r\n\t\t\t: vm.x + vm.xPadding;\r\n}\r\n\r\n/**\r\n * Helper to build before and after body lines\r\n */\r\nfunction getBeforeAfterBodyLines(callback) {\r\n\treturn pushOrConcat([], splitNewlines(callback));\r\n}\r\n\r\nvar exports$4 = core_element.extend({\r\n\tinitialize: function() {\r\n\t\tthis._model = getBaseModel(this._options);\r\n\t\tthis._lastActive = [];\r\n\t},\r\n\r\n\t// Get the title\r\n\t// Args are: (tooltipItem, data)\r\n\tgetTitle: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me._options;\r\n\t\tvar callbacks = opts.callbacks;\r\n\r\n\t\tvar beforeTitle = callbacks.beforeTitle.apply(me, arguments);\r\n\t\tvar title = callbacks.title.apply(me, arguments);\r\n\t\tvar afterTitle = callbacks.afterTitle.apply(me, arguments);\r\n\r\n\t\tvar lines = [];\r\n\t\tlines = pushOrConcat(lines, splitNewlines(beforeTitle));\r\n\t\tlines = pushOrConcat(lines, splitNewlines(title));\r\n\t\tlines = pushOrConcat(lines, splitNewlines(afterTitle));\r\n\r\n\t\treturn lines;\r\n\t},\r\n\r\n\t// Args are: (tooltipItem, data)\r\n\tgetBeforeBody: function() {\r\n\t\treturn getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this, arguments));\r\n\t},\r\n\r\n\t// Args are: (tooltipItem, data)\r\n\tgetBody: function(tooltipItems, data) {\r\n\t\tvar me = this;\r\n\t\tvar callbacks = me._options.callbacks;\r\n\t\tvar bodyItems = [];\r\n\r\n\t\thelpers$1.each(tooltipItems, function(tooltipItem) {\r\n\t\t\tvar bodyItem = {\r\n\t\t\t\tbefore: [],\r\n\t\t\t\tlines: [],\r\n\t\t\t\tafter: []\r\n\t\t\t};\r\n\t\t\tpushOrConcat(bodyItem.before, splitNewlines(callbacks.beforeLabel.call(me, tooltipItem, data)));\r\n\t\t\tpushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));\r\n\t\t\tpushOrConcat(bodyItem.after, splitNewlines(callbacks.afterLabel.call(me, tooltipItem, data)));\r\n\r\n\t\t\tbodyItems.push(bodyItem);\r\n\t\t});\r\n\r\n\t\treturn bodyItems;\r\n\t},\r\n\r\n\t// Args are: (tooltipItem, data)\r\n\tgetAfterBody: function() {\r\n\t\treturn getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this, arguments));\r\n\t},\r\n\r\n\t// Get the footer and beforeFooter and afterFooter lines\r\n\t// Args are: (tooltipItem, data)\r\n\tgetFooter: function() {\r\n\t\tvar me = this;\r\n\t\tvar callbacks = me._options.callbacks;\r\n\r\n\t\tvar beforeFooter = callbacks.beforeFooter.apply(me, arguments);\r\n\t\tvar footer = callbacks.footer.apply(me, arguments);\r\n\t\tvar afterFooter = callbacks.afterFooter.apply(me, arguments);\r\n\r\n\t\tvar lines = [];\r\n\t\tlines = pushOrConcat(lines, splitNewlines(beforeFooter));\r\n\t\tlines = pushOrConcat(lines, splitNewlines(footer));\r\n\t\tlines = pushOrConcat(lines, splitNewlines(afterFooter));\r\n\r\n\t\treturn lines;\r\n\t},\r\n\r\n\tupdate: function(changed) {\r\n\t\tvar me = this;\r\n\t\tvar opts = me._options;\r\n\r\n\t\t// Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition\r\n\t\t// that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time\r\n\t\t// which breaks any animations.\r\n\t\tvar existingModel = me._model;\r\n\t\tvar model = me._model = getBaseModel(opts);\r\n\t\tvar active = me._active;\r\n\r\n\t\tvar data = me._data;\r\n\r\n\t\t// In the case where active.length === 0 we need to keep these at existing values for good animations\r\n\t\tvar alignment = {\r\n\t\t\txAlign: existingModel.xAlign,\r\n\t\t\tyAlign: existingModel.yAlign\r\n\t\t};\r\n\t\tvar backgroundPoint = {\r\n\t\t\tx: existingModel.x,\r\n\t\t\ty: existingModel.y\r\n\t\t};\r\n\t\tvar tooltipSize = {\r\n\t\t\twidth: existingModel.width,\r\n\t\t\theight: existingModel.height\r\n\t\t};\r\n\t\tvar tooltipPosition = {\r\n\t\t\tx: existingModel.caretX,\r\n\t\t\ty: existingModel.caretY\r\n\t\t};\r\n\r\n\t\tvar i, len;\r\n\r\n\t\tif (active.length) {\r\n\t\t\tmodel.opacity = 1;\r\n\r\n\t\t\tvar labelColors = [];\r\n\t\t\tvar labelTextColors = [];\r\n\t\t\ttooltipPosition = positioners[opts.position].call(me, active, me._eventPosition);\r\n\r\n\t\t\tvar tooltipItems = [];\r\n\t\t\tfor (i = 0, len = active.length; i < len; ++i) {\r\n\t\t\t\ttooltipItems.push(createTooltipItem(active[i]));\r\n\t\t\t}\r\n\r\n\t\t\t// If the user provided a filter function, use it to modify the tooltip items\r\n\t\t\tif (opts.filter) {\r\n\t\t\t\ttooltipItems = tooltipItems.filter(function(a) {\r\n\t\t\t\t\treturn opts.filter(a, data);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// If the user provided a sorting function, use it to modify the tooltip items\r\n\t\t\tif (opts.itemSort) {\r\n\t\t\t\ttooltipItems = tooltipItems.sort(function(a, b) {\r\n\t\t\t\t\treturn opts.itemSort(a, b, data);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Determine colors for boxes\r\n\t\t\thelpers$1.each(tooltipItems, function(tooltipItem) {\r\n\t\t\t\tlabelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));\r\n\t\t\t\tlabelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));\r\n\t\t\t});\r\n\r\n\r\n\t\t\t// Build the Text Lines\r\n\t\t\tmodel.title = me.getTitle(tooltipItems, data);\r\n\t\t\tmodel.beforeBody = me.getBeforeBody(tooltipItems, data);\r\n\t\t\tmodel.body = me.getBody(tooltipItems, data);\r\n\t\t\tmodel.afterBody = me.getAfterBody(tooltipItems, data);\r\n\t\t\tmodel.footer = me.getFooter(tooltipItems, data);\r\n\r\n\t\t\t// Initial positioning and colors\r\n\t\t\tmodel.x = tooltipPosition.x;\r\n\t\t\tmodel.y = tooltipPosition.y;\r\n\t\t\tmodel.caretPadding = opts.caretPadding;\r\n\t\t\tmodel.labelColors = labelColors;\r\n\t\t\tmodel.labelTextColors = labelTextColors;\r\n\r\n\t\t\t// data points\r\n\t\t\tmodel.dataPoints = tooltipItems;\r\n\r\n\t\t\t// We need to determine alignment of the tooltip\r\n\t\t\ttooltipSize = getTooltipSize(this, model);\r\n\t\t\talignment = determineAlignment(this, tooltipSize);\r\n\t\t\t// Final Size and Position\r\n\t\t\tbackgroundPoint = getBackgroundPoint(model, tooltipSize, alignment, me._chart);\r\n\t\t} else {\r\n\t\t\tmodel.opacity = 0;\r\n\t\t}\r\n\r\n\t\tmodel.xAlign = alignment.xAlign;\r\n\t\tmodel.yAlign = alignment.yAlign;\r\n\t\tmodel.x = backgroundPoint.x;\r\n\t\tmodel.y = backgroundPoint.y;\r\n\t\tmodel.width = tooltipSize.width;\r\n\t\tmodel.height = tooltipSize.height;\r\n\r\n\t\t// Point where the caret on the tooltip points to\r\n\t\tmodel.caretX = tooltipPosition.x;\r\n\t\tmodel.caretY = tooltipPosition.y;\r\n\r\n\t\tme._model = model;\r\n\r\n\t\tif (changed && opts.custom) {\r\n\t\t\topts.custom.call(me, model);\r\n\t\t}\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\tdrawCaret: function(tooltipPoint, size) {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar caretPosition = this.getCaretPosition(tooltipPoint, size, vm);\r\n\r\n\t\tctx.lineTo(caretPosition.x1, caretPosition.y1);\r\n\t\tctx.lineTo(caretPosition.x2, caretPosition.y2);\r\n\t\tctx.lineTo(caretPosition.x3, caretPosition.y3);\r\n\t},\r\n\tgetCaretPosition: function(tooltipPoint, size, vm) {\r\n\t\tvar x1, x2, x3, y1, y2, y3;\r\n\t\tvar caretSize = vm.caretSize;\r\n\t\tvar cornerRadius = vm.cornerRadius;\r\n\t\tvar xAlign = vm.xAlign;\r\n\t\tvar yAlign = vm.yAlign;\r\n\t\tvar ptX = tooltipPoint.x;\r\n\t\tvar ptY = tooltipPoint.y;\r\n\t\tvar width = size.width;\r\n\t\tvar height = size.height;\r\n\r\n\t\tif (yAlign === 'center') {\r\n\t\t\ty2 = ptY + (height / 2);\r\n\r\n\t\t\tif (xAlign === 'left') {\r\n\t\t\t\tx1 = ptX;\r\n\t\t\t\tx2 = x1 - caretSize;\r\n\t\t\t\tx3 = x1;\r\n\r\n\t\t\t\ty1 = y2 + caretSize;\r\n\t\t\t\ty3 = y2 - caretSize;\r\n\t\t\t} else {\r\n\t\t\t\tx1 = ptX + width;\r\n\t\t\t\tx2 = x1 + caretSize;\r\n\t\t\t\tx3 = x1;\r\n\r\n\t\t\t\ty1 = y2 - caretSize;\r\n\t\t\t\ty3 = y2 + caretSize;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (xAlign === 'left') {\r\n\t\t\t\tx2 = ptX + cornerRadius + (caretSize);\r\n\t\t\t\tx1 = x2 - caretSize;\r\n\t\t\t\tx3 = x2 + caretSize;\r\n\t\t\t} else if (xAlign === 'right') {\r\n\t\t\t\tx2 = ptX + width - cornerRadius - caretSize;\r\n\t\t\t\tx1 = x2 - caretSize;\r\n\t\t\t\tx3 = x2 + caretSize;\r\n\t\t\t} else {\r\n\t\t\t\tx2 = vm.caretX;\r\n\t\t\t\tx1 = x2 - caretSize;\r\n\t\t\t\tx3 = x2 + caretSize;\r\n\t\t\t}\r\n\t\t\tif (yAlign === 'top') {\r\n\t\t\t\ty1 = ptY;\r\n\t\t\t\ty2 = y1 - caretSize;\r\n\t\t\t\ty3 = y1;\r\n\t\t\t} else {\r\n\t\t\t\ty1 = ptY + height;\r\n\t\t\t\ty2 = y1 + caretSize;\r\n\t\t\t\ty3 = y1;\r\n\t\t\t\t// invert drawing order\r\n\t\t\t\tvar tmp = x3;\r\n\t\t\t\tx3 = x1;\r\n\t\t\t\tx1 = tmp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};\r\n\t},\r\n\r\n\tdrawTitle: function(pt, vm, ctx) {\r\n\t\tvar title = vm.title;\r\n\t\tvar length = title.length;\r\n\t\tvar titleFontSize, titleSpacing, i;\r\n\r\n\t\tif (length) {\r\n\t\t\tvar rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);\r\n\r\n\t\t\tpt.x = getAlignedX(vm, vm._titleAlign);\r\n\r\n\t\t\tctx.textAlign = rtlHelper.textAlign(vm._titleAlign);\r\n\t\t\tctx.textBaseline = 'middle';\r\n\r\n\t\t\ttitleFontSize = vm.titleFontSize;\r\n\t\t\ttitleSpacing = vm.titleSpacing;\r\n\r\n\t\t\tctx.fillStyle = vm.titleFontColor;\r\n\t\t\tctx.font = helpers$1.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);\r\n\r\n\t\t\tfor (i = 0; i < length; ++i) {\r\n\t\t\t\tctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFontSize / 2);\r\n\t\t\t\tpt.y += titleFontSize + titleSpacing; // Line Height and spacing\r\n\r\n\t\t\t\tif (i + 1 === length) {\r\n\t\t\t\t\tpt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tdrawBody: function(pt, vm, ctx) {\r\n\t\tvar bodyFontSize = vm.bodyFontSize;\r\n\t\tvar bodySpacing = vm.bodySpacing;\r\n\t\tvar bodyAlign = vm._bodyAlign;\r\n\t\tvar body = vm.body;\r\n\t\tvar drawColorBoxes = vm.displayColors;\r\n\t\tvar xLinePadding = 0;\r\n\t\tvar colorX = drawColorBoxes ? getAlignedX(vm, 'left') : 0;\r\n\r\n\t\tvar rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);\r\n\r\n\t\tvar fillLineOfText = function(line) {\r\n\t\t\tctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyFontSize / 2);\r\n\t\t\tpt.y += bodyFontSize + bodySpacing;\r\n\t\t};\r\n\r\n\t\tvar bodyItem, textColor, labelColors, lines, i, j, ilen, jlen;\r\n\t\tvar bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\r\n\r\n\t\tctx.textAlign = bodyAlign;\r\n\t\tctx.textBaseline = 'middle';\r\n\t\tctx.font = helpers$1.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);\r\n\r\n\t\tpt.x = getAlignedX(vm, bodyAlignForCalculation);\r\n\r\n\t\t// Before body lines\r\n\t\tctx.fillStyle = vm.bodyFontColor;\r\n\t\thelpers$1.each(vm.beforeBody, fillLineOfText);\r\n\r\n\t\txLinePadding = drawColorBoxes && bodyAlignForCalculation !== 'right'\r\n\t\t\t? bodyAlign === 'center' ? (bodyFontSize / 2 + 1) : (bodyFontSize + 2)\r\n\t\t\t: 0;\r\n\r\n\t\t// Draw body lines now\r\n\t\tfor (i = 0, ilen = body.length; i < ilen; ++i) {\r\n\t\t\tbodyItem = body[i];\r\n\t\t\ttextColor = vm.labelTextColors[i];\r\n\t\t\tlabelColors = vm.labelColors[i];\r\n\r\n\t\t\tctx.fillStyle = textColor;\r\n\t\t\thelpers$1.each(bodyItem.before, fillLineOfText);\r\n\r\n\t\t\tlines = bodyItem.lines;\r\n\t\t\tfor (j = 0, jlen = lines.length; j < jlen; ++j) {\r\n\t\t\t\t// Draw Legend-like boxes if needed\r\n\t\t\t\tif (drawColorBoxes) {\r\n\t\t\t\t\tvar rtlColorX = rtlHelper.x(colorX);\r\n\r\n\t\t\t\t\t// Fill a white rect so that colours merge nicely if the opacity is < 1\r\n\t\t\t\t\tctx.fillStyle = vm.legendColorBackground;\r\n\t\t\t\t\tctx.fillRect(rtlHelper.leftForLtr(rtlColorX, bodyFontSize), pt.y, bodyFontSize, bodyFontSize);\r\n\r\n\t\t\t\t\t// Border\r\n\t\t\t\t\tctx.lineWidth = 1;\r\n\t\t\t\t\tctx.strokeStyle = labelColors.borderColor;\r\n\t\t\t\t\tctx.strokeRect(rtlHelper.leftForLtr(rtlColorX, bodyFontSize), pt.y, bodyFontSize, bodyFontSize);\r\n\r\n\t\t\t\t\t// Inner square\r\n\t\t\t\t\tctx.fillStyle = labelColors.backgroundColor;\r\n\t\t\t\t\tctx.fillRect(rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), bodyFontSize - 2), pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);\r\n\t\t\t\t\tctx.fillStyle = textColor;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfillLineOfText(lines[j]);\r\n\t\t\t}\r\n\r\n\t\t\thelpers$1.each(bodyItem.after, fillLineOfText);\r\n\t\t}\r\n\r\n\t\t// Reset back to 0 for after body\r\n\t\txLinePadding = 0;\r\n\r\n\t\t// After body lines\r\n\t\thelpers$1.each(vm.afterBody, fillLineOfText);\r\n\t\tpt.y -= bodySpacing; // Remove last body spacing\r\n\t},\r\n\r\n\tdrawFooter: function(pt, vm, ctx) {\r\n\t\tvar footer = vm.footer;\r\n\t\tvar length = footer.length;\r\n\t\tvar footerFontSize, i;\r\n\r\n\t\tif (length) {\r\n\t\t\tvar rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);\r\n\r\n\t\t\tpt.x = getAlignedX(vm, vm._footerAlign);\r\n\t\t\tpt.y += vm.footerMarginTop;\r\n\r\n\t\t\tctx.textAlign = rtlHelper.textAlign(vm._footerAlign);\r\n\t\t\tctx.textBaseline = 'middle';\r\n\r\n\t\t\tfooterFontSize = vm.footerFontSize;\r\n\r\n\t\t\tctx.fillStyle = vm.footerFontColor;\r\n\t\t\tctx.font = helpers$1.fontString(footerFontSize, vm._footerFontStyle, vm._footerFontFamily);\r\n\r\n\t\t\tfor (i = 0; i < length; ++i) {\r\n\t\t\t\tctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFontSize / 2);\r\n\t\t\t\tpt.y += footerFontSize + vm.footerSpacing;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tdrawBackground: function(pt, vm, ctx, tooltipSize) {\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.strokeStyle = vm.borderColor;\r\n\t\tctx.lineWidth = vm.borderWidth;\r\n\t\tvar xAlign = vm.xAlign;\r\n\t\tvar yAlign = vm.yAlign;\r\n\t\tvar x = pt.x;\r\n\t\tvar y = pt.y;\r\n\t\tvar width = tooltipSize.width;\r\n\t\tvar height = tooltipSize.height;\r\n\t\tvar radius = vm.cornerRadius;\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x + radius, y);\r\n\t\tif (yAlign === 'top') {\r\n\t\t\tthis.drawCaret(pt, tooltipSize);\r\n\t\t}\r\n\t\tctx.lineTo(x + width - radius, y);\r\n\t\tctx.quadraticCurveTo(x + width, y, x + width, y + radius);\r\n\t\tif (yAlign === 'center' && xAlign === 'right') {\r\n\t\t\tthis.drawCaret(pt, tooltipSize);\r\n\t\t}\r\n\t\tctx.lineTo(x + width, y + height - radius);\r\n\t\tctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\r\n\t\tif (yAlign === 'bottom') {\r\n\t\t\tthis.drawCaret(pt, tooltipSize);\r\n\t\t}\r\n\t\tctx.lineTo(x + radius, y + height);\r\n\t\tctx.quadraticCurveTo(x, y + height, x, y + height - radius);\r\n\t\tif (yAlign === 'center' && xAlign === 'left') {\r\n\t\t\tthis.drawCaret(pt, tooltipSize);\r\n\t\t}\r\n\t\tctx.lineTo(x, y + radius);\r\n\t\tctx.quadraticCurveTo(x, y, x + radius, y);\r\n\t\tctx.closePath();\r\n\r\n\t\tctx.fill();\r\n\r\n\t\tif (vm.borderWidth > 0) {\r\n\t\t\tctx.stroke();\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm.opacity === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar tooltipSize = {\r\n\t\t\twidth: vm.width,\r\n\t\t\theight: vm.height\r\n\t\t};\r\n\t\tvar pt = {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\r\n\t\t// IE11/Edge does not like very small opacities, so snap to 0\r\n\t\tvar opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;\r\n\r\n\t\t// Truthy/falsey value for empty tooltip\r\n\t\tvar hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;\r\n\r\n\t\tif (this._options.enabled && hasTooltipContent) {\r\n\t\t\tctx.save();\r\n\t\t\tctx.globalAlpha = opacity;\r\n\r\n\t\t\t// Draw Background\r\n\t\t\tthis.drawBackground(pt, vm, ctx, tooltipSize);\r\n\r\n\t\t\t// Draw Title, Body, and Footer\r\n\t\t\tpt.y += vm.yPadding;\r\n\r\n\t\t\thelpers$1.rtl.overrideTextDirection(ctx, vm.textDirection);\r\n\r\n\t\t\t// Titles\r\n\t\t\tthis.drawTitle(pt, vm, ctx);\r\n\r\n\t\t\t// Body\r\n\t\t\tthis.drawBody(pt, vm, ctx);\r\n\r\n\t\t\t// Footer\r\n\t\t\tthis.drawFooter(pt, vm, ctx);\r\n\r\n\t\t\thelpers$1.rtl.restoreTextDirection(ctx, vm.textDirection);\r\n\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Handle an event\r\n\t * @private\r\n\t * @param {IEvent} event - The event to handle\r\n\t * @returns {boolean} true if the tooltip changed\r\n\t */\r\n\thandleEvent: function(e) {\r\n\t\tvar me = this;\r\n\t\tvar options = me._options;\r\n\t\tvar changed = false;\r\n\r\n\t\tme._lastActive = me._lastActive || [];\r\n\r\n\t\t// Find Active Elements for tooltips\r\n\t\tif (e.type === 'mouseout') {\r\n\t\t\tme._active = [];\r\n\t\t} else {\r\n\t\t\tme._active = me._chart.getElementsAtEventForMode(e, options.mode, options);\r\n\t\t\tif (options.reverse) {\r\n\t\t\t\tme._active.reverse();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Remember Last Actives\r\n\t\tchanged = !helpers$1.arrayEquals(me._active, me._lastActive);\r\n\r\n\t\t// Only handle target event on tooltip change\r\n\t\tif (changed) {\r\n\t\t\tme._lastActive = me._active;\r\n\r\n\t\t\tif (options.enabled || options.custom) {\r\n\t\t\t\tme._eventPosition = {\r\n\t\t\t\t\tx: e.x,\r\n\t\t\t\t\ty: e.y\r\n\t\t\t\t};\r\n\r\n\t\t\t\tme.update(true);\r\n\t\t\t\tme.pivot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n});\r\n\r\n/**\r\n * @namespace Chart.Tooltip.positioners\r\n */\r\nvar positioners_1 = positioners;\r\n\r\nvar core_tooltip = exports$4;\ncore_tooltip.positioners = positioners_1;\n\nvar valueOrDefault$9 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {},\r\n\tevents: [\r\n\t\t'mousemove',\r\n\t\t'mouseout',\r\n\t\t'click',\r\n\t\t'touchstart',\r\n\t\t'touchmove'\r\n\t],\r\n\thover: {\r\n\t\tonHover: null,\r\n\t\tmode: 'nearest',\r\n\t\tintersect: true,\r\n\t\tanimationDuration: 400\r\n\t},\r\n\tonClick: null,\r\n\tmaintainAspectRatio: true,\r\n\tresponsive: true,\r\n\tresponsiveAnimationDuration: 0\r\n});\r\n\r\n/**\r\n * Recursively merge the given config objects representing the `scales` option\r\n * by incorporating scale defaults in `xAxes` and `yAxes` array items, then\r\n * returns a deep copy of the result, thus doesn't alter inputs.\r\n */\r\nfunction mergeScaleConfig(/* config objects ... */) {\r\n\treturn helpers$1.merge(Object.create(null), [].slice.call(arguments), {\r\n\t\tmerger: function(key, target, source, options) {\r\n\t\t\tif (key === 'xAxes' || key === 'yAxes') {\r\n\t\t\t\tvar slen = source[key].length;\r\n\t\t\t\tvar i, type, scale;\r\n\r\n\t\t\t\tif (!target[key]) {\r\n\t\t\t\t\ttarget[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (i = 0; i < slen; ++i) {\r\n\t\t\t\t\tscale = source[key][i];\r\n\t\t\t\t\ttype = valueOrDefault$9(scale.type, key === 'xAxes' ? 'category' : 'linear');\r\n\r\n\t\t\t\t\tif (i >= target[key].length) {\r\n\t\t\t\t\t\ttarget[key].push({});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {\r\n\t\t\t\t\t\t// new/untyped scale or type changed: let's apply the new defaults\r\n\t\t\t\t\t\t// then merge source scale to correctly overwrite the defaults.\r\n\t\t\t\t\t\thelpers$1.merge(target[key][i], [core_scaleService.getScaleDefaults(type), scale]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// scales type are the same\r\n\t\t\t\t\t\thelpers$1.merge(target[key][i], scale);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\thelpers$1._merger(key, target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Recursively merge the given config objects as the root options by handling\r\n * default scale options for the `scales` and `scale` properties, then returns\r\n * a deep copy of the result, thus doesn't alter inputs.\r\n */\r\nfunction mergeConfig(/* config objects ... */) {\r\n\treturn helpers$1.merge(Object.create(null), [].slice.call(arguments), {\r\n\t\tmerger: function(key, target, source, options) {\r\n\t\t\tvar tval = target[key] || Object.create(null);\r\n\t\t\tvar sval = source[key];\r\n\r\n\t\t\tif (key === 'scales') {\r\n\t\t\t\t// scale config merging is complex. Add our own function here for that\r\n\t\t\t\ttarget[key] = mergeScaleConfig(tval, sval);\r\n\t\t\t} else if (key === 'scale') {\r\n\t\t\t\t// used in polar area & radar charts since there is only one scale\r\n\t\t\t\ttarget[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);\r\n\t\t\t} else {\r\n\t\t\t\thelpers$1._merger(key, target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction initConfig(config) {\r\n\tconfig = config || Object.create(null);\r\n\r\n\t// Do NOT use mergeConfig for the data object because this method merges arrays\r\n\t// and so would change references to labels and datasets, preventing data updates.\r\n\tvar data = config.data = config.data || {};\r\n\tdata.datasets = data.datasets || [];\r\n\tdata.labels = data.labels || [];\r\n\r\n\tconfig.options = mergeConfig(\r\n\t\tcore_defaults.global,\r\n\t\tcore_defaults[config.type],\r\n\t\tconfig.options || {});\r\n\r\n\treturn config;\r\n}\r\n\r\nfunction updateConfig(chart) {\r\n\tvar newOptions = chart.options;\r\n\r\n\thelpers$1.each(chart.scales, function(scale) {\r\n\t\tcore_layouts.removeBox(chart, scale);\r\n\t});\r\n\r\n\tnewOptions = mergeConfig(\r\n\t\tcore_defaults.global,\r\n\t\tcore_defaults[chart.config.type],\r\n\t\tnewOptions);\r\n\r\n\tchart.options = chart.config.options = newOptions;\r\n\tchart.ensureScalesHaveIDs();\r\n\tchart.buildOrUpdateScales();\r\n\r\n\t// Tooltip\r\n\tchart.tooltip._options = newOptions.tooltips;\r\n\tchart.tooltip.initialize();\r\n}\r\n\r\nfunction nextAvailableScaleId(axesOpts, prefix, index) {\r\n\tvar id;\r\n\tvar hasId = function(obj) {\r\n\t\treturn obj.id === id;\r\n\t};\r\n\r\n\tdo {\r\n\t\tid = prefix + index++;\r\n\t} while (helpers$1.findIndex(axesOpts, hasId) >= 0);\r\n\r\n\treturn id;\r\n}\r\n\r\nfunction positionIsHorizontal(position) {\r\n\treturn position === 'top' || position === 'bottom';\r\n}\r\n\r\nfunction compare2Level(l1, l2) {\r\n\treturn function(a, b) {\r\n\t\treturn a[l1] === b[l1]\r\n\t\t\t? a[l2] - b[l2]\r\n\t\t\t: a[l1] - b[l1];\r\n\t};\r\n}\r\n\r\nvar Chart = function(item, config) {\r\n\tthis.construct(item, config);\r\n\treturn this;\r\n};\r\n\r\nhelpers$1.extend(Chart.prototype, /** @lends Chart */ {\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tconstruct: function(item, config) {\r\n\t\tvar me = this;\r\n\r\n\t\tconfig = initConfig(config);\r\n\r\n\t\tvar context = platform.acquireContext(item, config);\r\n\t\tvar canvas = context && context.canvas;\r\n\t\tvar height = canvas && canvas.height;\r\n\t\tvar width = canvas && canvas.width;\r\n\r\n\t\tme.id = helpers$1.uid();\r\n\t\tme.ctx = context;\r\n\t\tme.canvas = canvas;\r\n\t\tme.config = config;\r\n\t\tme.width = width;\r\n\t\tme.height = height;\r\n\t\tme.aspectRatio = height ? width / height : null;\r\n\t\tme.options = config.options;\r\n\t\tme._bufferedRender = false;\r\n\t\tme._layers = [];\r\n\r\n\t\t/**\r\n\t\t * Provided for backward compatibility, Chart and Chart.Controller have been merged,\r\n\t\t * the \"instance\" still need to be defined since it might be called from plugins.\r\n\t\t * @prop Chart#chart\r\n\t\t * @deprecated since version 2.6.0\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\tme.chart = me;\r\n\t\tme.controller = me; // chart.chart.controller #inception\r\n\r\n\t\t// Add the chart instance to the global namespace\r\n\t\tChart.instances[me.id] = me;\r\n\r\n\t\t// Define alias to the config data: `chart.data === chart.config.data`\r\n\t\tObject.defineProperty(me, 'data', {\r\n\t\t\tget: function() {\r\n\t\t\t\treturn me.config.data;\r\n\t\t\t},\r\n\t\t\tset: function(value) {\r\n\t\t\t\tme.config.data = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (!context || !canvas) {\r\n\t\t\t// The given item is not a compatible context2d element, let's return before finalizing\r\n\t\t\t// the chart initialization but after setting basic chart / controller properties that\r\n\t\t\t// can help to figure out that the chart is not valid (e.g chart.canvas !== null);\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\r\n\t\t\tconsole.error(\"Failed to create chart: can't acquire context from the given item\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tme.initialize();\r\n\t\tme.update();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tinitialize: function() {\r\n\t\tvar me = this;\r\n\r\n\t\t// Before init plugin notification\r\n\t\tcore_plugins.notify(me, 'beforeInit');\r\n\r\n\t\thelpers$1.retinaScale(me, me.options.devicePixelRatio);\r\n\r\n\t\tme.bindEvents();\r\n\r\n\t\tif (me.options.responsive) {\r\n\t\t\t// Initial resize before chart draws (must be silent to preserve initial animations).\r\n\t\t\tme.resize(true);\r\n\t\t}\r\n\r\n\t\tme.initToolTip();\r\n\r\n\t\t// After init plugin notification\r\n\t\tcore_plugins.notify(me, 'afterInit');\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\tclear: function() {\r\n\t\thelpers$1.canvas.clear(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tstop: function() {\r\n\t\t// Stops any current animation loop occurring\r\n\t\tcore_animations.cancelAnimation(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\tresize: function(silent) {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options;\r\n\t\tvar canvas = me.canvas;\r\n\t\tvar aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;\r\n\r\n\t\t// the canvas render width and height will be casted to integers so make sure that\r\n\t\t// the canvas display style uses the same integer values to avoid blurring effect.\r\n\r\n\t\t// Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collapsed\r\n\t\tvar newWidth = Math.max(0, Math.floor(helpers$1.getMaximumWidth(canvas)));\r\n\t\tvar newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers$1.getMaximumHeight(canvas)));\r\n\r\n\t\tif (me.width === newWidth && me.height === newHeight) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tcanvas.width = me.width = newWidth;\r\n\t\tcanvas.height = me.height = newHeight;\r\n\t\tcanvas.style.width = newWidth + 'px';\r\n\t\tcanvas.style.height = newHeight + 'px';\r\n\r\n\t\thelpers$1.retinaScale(me, options.devicePixelRatio);\r\n\r\n\t\tif (!silent) {\r\n\t\t\t// Notify any plugins about the resize\r\n\t\t\tvar newSize = {width: newWidth, height: newHeight};\r\n\t\t\tcore_plugins.notify(me, 'resize', [newSize]);\r\n\r\n\t\t\t// Notify of resize\r\n\t\t\tif (options.onResize) {\r\n\t\t\t\toptions.onResize(me, newSize);\r\n\t\t\t}\r\n\r\n\t\t\tme.stop();\r\n\t\t\tme.update({\r\n\t\t\t\tduration: options.responsiveAnimationDuration\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\tensureScalesHaveIDs: function() {\r\n\t\tvar options = this.options;\r\n\t\tvar scalesOptions = options.scales || {};\r\n\t\tvar scaleOptions = options.scale;\r\n\r\n\t\thelpers$1.each(scalesOptions.xAxes, function(xAxisOptions, index) {\r\n\t\t\tif (!xAxisOptions.id) {\r\n\t\t\t\txAxisOptions.id = nextAvailableScaleId(scalesOptions.xAxes, 'x-axis-', index);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\thelpers$1.each(scalesOptions.yAxes, function(yAxisOptions, index) {\r\n\t\t\tif (!yAxisOptions.id) {\r\n\t\t\t\tyAxisOptions.id = nextAvailableScaleId(scalesOptions.yAxes, 'y-axis-', index);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (scaleOptions) {\r\n\t\t\tscaleOptions.id = scaleOptions.id || 'scale';\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Builds a map of scale ID to scale object for future lookup.\r\n\t */\r\n\tbuildOrUpdateScales: function() {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options;\r\n\t\tvar scales = me.scales || {};\r\n\t\tvar items = [];\r\n\t\tvar updated = Object.keys(scales).reduce(function(obj, id) {\r\n\t\t\tobj[id] = false;\r\n\t\t\treturn obj;\r\n\t\t}, {});\r\n\r\n\t\tif (options.scales) {\r\n\t\t\titems = items.concat(\r\n\t\t\t\t(options.scales.xAxes || []).map(function(xAxisOptions) {\r\n\t\t\t\t\treturn {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};\r\n\t\t\t\t}),\r\n\t\t\t\t(options.scales.yAxes || []).map(function(yAxisOptions) {\r\n\t\t\t\t\treturn {options: yAxisOptions, dtype: 'linear', dposition: 'left'};\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (options.scale) {\r\n\t\t\titems.push({\r\n\t\t\t\toptions: options.scale,\r\n\t\t\t\tdtype: 'radialLinear',\r\n\t\t\t\tisDefault: true,\r\n\t\t\t\tdposition: 'chartArea'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\thelpers$1.each(items, function(item) {\r\n\t\t\tvar scaleOptions = item.options;\r\n\t\t\tvar id = scaleOptions.id;\r\n\t\t\tvar scaleType = valueOrDefault$9(scaleOptions.type, item.dtype);\r\n\r\n\t\t\tif (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {\r\n\t\t\t\tscaleOptions.position = item.dposition;\r\n\t\t\t}\r\n\r\n\t\t\tupdated[id] = true;\r\n\t\t\tvar scale = null;\r\n\t\t\tif (id in scales && scales[id].type === scaleType) {\r\n\t\t\t\tscale = scales[id];\r\n\t\t\t\tscale.options = scaleOptions;\r\n\t\t\t\tscale.ctx = me.ctx;\r\n\t\t\t\tscale.chart = me;\r\n\t\t\t} else {\r\n\t\t\t\tvar scaleClass = core_scaleService.getScaleConstructor(scaleType);\r\n\t\t\t\tif (!scaleClass) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tscale = new scaleClass({\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\ttype: scaleType,\r\n\t\t\t\t\toptions: scaleOptions,\r\n\t\t\t\t\tctx: me.ctx,\r\n\t\t\t\t\tchart: me\r\n\t\t\t\t});\r\n\t\t\t\tscales[scale.id] = scale;\r\n\t\t\t}\r\n\r\n\t\t\tscale.mergeTicksOptions();\r\n\r\n\t\t\t// TODO(SB): I think we should be able to remove this custom case (options.scale)\r\n\t\t\t// and consider it as a regular scale part of the \"scales\"\" map only! This would\r\n\t\t\t// make the logic easier and remove some useless? custom code.\r\n\t\t\tif (item.isDefault) {\r\n\t\t\t\tme.scale = scale;\r\n\t\t\t}\r\n\t\t});\r\n\t\t// clear up discarded scales\r\n\t\thelpers$1.each(updated, function(hasUpdated, id) {\r\n\t\t\tif (!hasUpdated) {\r\n\t\t\t\tdelete scales[id];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tme.scales = scales;\r\n\r\n\t\tcore_scaleService.addScalesToLayout(this);\r\n\t},\r\n\r\n\tbuildOrUpdateControllers: function() {\r\n\t\tvar me = this;\r\n\t\tvar newControllers = [];\r\n\t\tvar datasets = me.data.datasets;\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = datasets.length; i < ilen; i++) {\r\n\t\t\tvar dataset = datasets[i];\r\n\t\t\tvar meta = me.getDatasetMeta(i);\r\n\t\t\tvar type = dataset.type || me.config.type;\r\n\r\n\t\t\tif (meta.type && meta.type !== type) {\r\n\t\t\t\tme.destroyDatasetMeta(i);\r\n\t\t\t\tmeta = me.getDatasetMeta(i);\r\n\t\t\t}\r\n\t\t\tmeta.type = type;\r\n\t\t\tmeta.order = dataset.order || 0;\r\n\t\t\tmeta.index = i;\r\n\r\n\t\t\tif (meta.controller) {\r\n\t\t\t\tmeta.controller.updateIndex(i);\r\n\t\t\t\tmeta.controller.linkScales();\r\n\t\t\t} else {\r\n\t\t\t\tvar ControllerClass = controllers[meta.type];\r\n\t\t\t\tif (ControllerClass === undefined) {\r\n\t\t\t\t\tthrow new Error('\"' + meta.type + '\" is not a chart type.');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmeta.controller = new ControllerClass(me, i);\r\n\t\t\t\tnewControllers.push(meta.controller);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn newControllers;\r\n\t},\r\n\r\n\t/**\r\n\t * Reset the elements of all datasets\r\n\t * @private\r\n\t */\r\n\tresetElements: function() {\r\n\t\tvar me = this;\r\n\t\thelpers$1.each(me.data.datasets, function(dataset, datasetIndex) {\r\n\t\t\tme.getDatasetMeta(datasetIndex).controller.reset();\r\n\t\t}, me);\r\n\t},\r\n\r\n\t/**\r\n\t* Resets the chart back to it's state before the initial animation\r\n\t*/\r\n\treset: function() {\r\n\t\tthis.resetElements();\r\n\t\tthis.tooltip.initialize();\r\n\t},\r\n\r\n\tupdate: function(config) {\r\n\t\tvar me = this;\r\n\t\tvar i, ilen;\r\n\r\n\t\tif (!config || typeof config !== 'object') {\r\n\t\t\t// backwards compatibility\r\n\t\t\tconfig = {\r\n\t\t\t\tduration: config,\r\n\t\t\t\tlazy: arguments[1]\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tupdateConfig(me);\r\n\r\n\t\t// plugins options references might have change, let's invalidate the cache\r\n\t\t// https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\r\n\t\tcore_plugins._invalidate(me);\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeUpdate') === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// In case the entire data object changed\r\n\t\tme.tooltip._data = me.data;\r\n\r\n\t\t// Make sure dataset controllers are updated and new controllers are reset\r\n\t\tvar newControllers = me.buildOrUpdateControllers();\r\n\r\n\t\t// Make sure all dataset controllers have correct meta data counts\r\n\t\tfor (i = 0, ilen = me.data.datasets.length; i < ilen; i++) {\r\n\t\t\tme.getDatasetMeta(i).controller.buildOrUpdateElements();\r\n\t\t}\r\n\r\n\t\tme.updateLayout();\r\n\r\n\t\t// Can only reset the new controllers after the scales have been updated\r\n\t\tif (me.options.animation && me.options.animation.duration) {\r\n\t\t\thelpers$1.each(newControllers, function(controller) {\r\n\t\t\t\tcontroller.reset();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tme.updateDatasets();\r\n\r\n\t\t// Need to reset tooltip in case it is displayed with elements that are removed\r\n\t\t// after update.\r\n\t\tme.tooltip.initialize();\r\n\r\n\t\t// Last active contains items that were previously in the tooltip.\r\n\t\t// When we reset the tooltip, we need to clear it\r\n\t\tme.lastActive = [];\r\n\r\n\t\t// Do this before render so that any plugins that need final scale updates can use it\r\n\t\tcore_plugins.notify(me, 'afterUpdate');\r\n\r\n\t\tme._layers.sort(compare2Level('z', '_idx'));\r\n\r\n\t\tif (me._bufferedRender) {\r\n\t\t\tme._bufferedRequest = {\r\n\t\t\t\tduration: config.duration,\r\n\t\t\t\teasing: config.easing,\r\n\t\t\t\tlazy: config.lazy\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tme.render(config);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\r\n\t * hook, in which case, plugins will not be called on `afterLayout`.\r\n\t * @private\r\n\t */\r\n\tupdateLayout: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeLayout') === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tcore_layouts.update(this, this.width, this.height);\r\n\r\n\t\tme._layers = [];\r\n\t\thelpers$1.each(me.boxes, function(box) {\r\n\t\t\t// _configure is called twice, once in core.scale.update and once here.\r\n\t\t\t// Here the boxes are fully updated and at their final positions.\r\n\t\t\tif (box._configure) {\r\n\t\t\t\tbox._configure();\r\n\t\t\t}\r\n\t\t\tme._layers.push.apply(me._layers, box._layers());\r\n\t\t}, me);\r\n\r\n\t\tme._layers.forEach(function(item, index) {\r\n\t\t\titem._idx = index;\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * Provided for backward compatibility, use `afterLayout` instead.\r\n\t\t * @method IPlugin#afterScaleUpdate\r\n\t\t * @deprecated since version 2.5.0\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\tcore_plugins.notify(me, 'afterScaleUpdate');\r\n\t\tcore_plugins.notify(me, 'afterLayout');\r\n\t},\r\n\r\n\t/**\r\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\r\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\r\n\t * @private\r\n\t */\r\n\tupdateDatasets: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeDatasetsUpdate') === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\r\n\t\t\tme.updateDataset(i);\r\n\t\t}\r\n\r\n\t\tcore_plugins.notify(me, 'afterDatasetsUpdate');\r\n\t},\r\n\r\n\t/**\r\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\r\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\r\n\t * @private\r\n\t */\r\n\tupdateDataset: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getDatasetMeta(index);\r\n\t\tvar args = {\r\n\t\t\tmeta: meta,\r\n\t\t\tindex: index\r\n\t\t};\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmeta.controller._update();\r\n\r\n\t\tcore_plugins.notify(me, 'afterDatasetUpdate', [args]);\r\n\t},\r\n\r\n\trender: function(config) {\r\n\t\tvar me = this;\r\n\r\n\t\tif (!config || typeof config !== 'object') {\r\n\t\t\t// backwards compatibility\r\n\t\t\tconfig = {\r\n\t\t\t\tduration: config,\r\n\t\t\t\tlazy: arguments[1]\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tvar animationOptions = me.options.animation;\r\n\t\tvar duration = valueOrDefault$9(config.duration, animationOptions && animationOptions.duration);\r\n\t\tvar lazy = config.lazy;\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeRender') === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar onComplete = function(animation) {\r\n\t\t\tcore_plugins.notify(me, 'afterRender');\r\n\t\t\thelpers$1.callback(animationOptions && animationOptions.onComplete, [animation], me);\r\n\t\t};\r\n\r\n\t\tif (animationOptions && duration) {\r\n\t\t\tvar animation = new core_animation({\r\n\t\t\t\tnumSteps: duration / 16.66, // 60 fps\r\n\t\t\t\teasing: config.easing || animationOptions.easing,\r\n\r\n\t\t\t\trender: function(chart, animationObject) {\r\n\t\t\t\t\tvar easingFunction = helpers$1.easing.effects[animationObject.easing];\r\n\t\t\t\t\tvar currentStep = animationObject.currentStep;\r\n\t\t\t\t\tvar stepDecimal = currentStep / animationObject.numSteps;\r\n\r\n\t\t\t\t\tchart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonAnimationProgress: animationOptions.onProgress,\r\n\t\t\t\tonAnimationComplete: onComplete\r\n\t\t\t});\r\n\r\n\t\t\tcore_animations.addAnimation(me, animation, duration, lazy);\r\n\t\t} else {\r\n\t\t\tme.draw();\r\n\r\n\t\t\t// See https://github.com/chartjs/Chart.js/issues/3781\r\n\t\t\tonComplete(new core_animation({numSteps: 0, chart: me}));\r\n\t\t}\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\tdraw: function(easingValue) {\r\n\t\tvar me = this;\r\n\t\tvar i, layers;\r\n\r\n\t\tme.clear();\r\n\r\n\t\tif (helpers$1.isNullOrUndef(easingValue)) {\r\n\t\t\teasingValue = 1;\r\n\t\t}\r\n\r\n\t\tme.transition(easingValue);\r\n\r\n\t\tif (me.width <= 0 || me.height <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeDraw', [easingValue]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Because of plugin hooks (before/afterDatasetsDraw), datasets can't\r\n\t\t// currently be part of layers. Instead, we draw\r\n\t\t// layers <= 0 before(default, backward compat), and the rest after\r\n\t\tlayers = me._layers;\r\n\t\tfor (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\r\n\t\t\tlayers[i].draw(me.chartArea);\r\n\t\t}\r\n\r\n\t\tme.drawDatasets(easingValue);\r\n\r\n\t\t// Rest of layers\r\n\t\tfor (; i < layers.length; ++i) {\r\n\t\t\tlayers[i].draw(me.chartArea);\r\n\t\t}\r\n\r\n\t\tme._drawTooltip(easingValue);\r\n\r\n\t\tcore_plugins.notify(me, 'afterDraw', [easingValue]);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\ttransition: function(easingValue) {\r\n\t\tvar me = this;\r\n\r\n\t\tfor (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\tif (me.isDatasetVisible(i)) {\r\n\t\t\t\tme.getDatasetMeta(i).controller.transition(easingValue);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme.tooltip.transition(easingValue);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getSortedDatasetMetas: function(filterVisible) {\r\n\t\tvar me = this;\r\n\t\tvar datasets = me.data.datasets || [];\r\n\t\tvar result = [];\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = datasets.length; i < ilen; ++i) {\r\n\t\t\tif (!filterVisible || me.isDatasetVisible(i)) {\r\n\t\t\t\tresult.push(me.getDatasetMeta(i));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tresult.sort(compare2Level('order', 'index'));\r\n\r\n\t\treturn result;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getSortedVisibleDatasetMetas: function() {\r\n\t\treturn this._getSortedDatasetMetas(true);\r\n\t},\r\n\r\n\t/**\r\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\r\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\r\n\t * @private\r\n\t */\r\n\tdrawDatasets: function(easingValue) {\r\n\t\tvar me = this;\r\n\t\tvar metasets, i;\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmetasets = me._getSortedVisibleDatasetMetas();\r\n\t\tfor (i = metasets.length - 1; i >= 0; --i) {\r\n\t\t\tme.drawDataset(metasets[i], easingValue);\r\n\t\t}\r\n\r\n\t\tcore_plugins.notify(me, 'afterDatasetsDraw', [easingValue]);\r\n\t},\r\n\r\n\t/**\r\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\r\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\r\n\t * @private\r\n\t */\r\n\tdrawDataset: function(meta, easingValue) {\r\n\t\tvar me = this;\r\n\t\tvar args = {\r\n\t\t\tmeta: meta,\r\n\t\t\tindex: meta.index,\r\n\t\t\teasingValue: easingValue\r\n\t\t};\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmeta.controller.draw(easingValue);\r\n\r\n\t\tcore_plugins.notify(me, 'afterDatasetDraw', [args]);\r\n\t},\r\n\r\n\t/**\r\n\t * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`\r\n\t * hook, in which case, plugins will not be called on `afterTooltipDraw`.\r\n\t * @private\r\n\t */\r\n\t_drawTooltip: function(easingValue) {\r\n\t\tvar me = this;\r\n\t\tvar tooltip = me.tooltip;\r\n\t\tvar args = {\r\n\t\t\ttooltip: tooltip,\r\n\t\t\teasingValue: easingValue\r\n\t\t};\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttooltip.draw();\r\n\r\n\t\tcore_plugins.notify(me, 'afterTooltipDraw', [args]);\r\n\t},\r\n\r\n\t/**\r\n\t * Get the single element that was clicked on\r\n\t * @return An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw\r\n\t */\r\n\tgetElementAtEvent: function(e) {\r\n\t\treturn core_interaction.modes.single(this, e);\r\n\t},\r\n\r\n\tgetElementsAtEvent: function(e) {\r\n\t\treturn core_interaction.modes.label(this, e, {intersect: true});\r\n\t},\r\n\r\n\tgetElementsAtXAxis: function(e) {\r\n\t\treturn core_interaction.modes['x-axis'](this, e, {intersect: true});\r\n\t},\r\n\r\n\tgetElementsAtEventForMode: function(e, mode, options) {\r\n\t\tvar method = core_interaction.modes[mode];\r\n\t\tif (typeof method === 'function') {\r\n\t\t\treturn method(this, e, options);\r\n\t\t}\r\n\r\n\t\treturn [];\r\n\t},\r\n\r\n\tgetDatasetAtEvent: function(e) {\r\n\t\treturn core_interaction.modes.dataset(this, e, {intersect: true});\r\n\t},\r\n\r\n\tgetDatasetMeta: function(datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.data.datasets[datasetIndex];\r\n\t\tif (!dataset._meta) {\r\n\t\t\tdataset._meta = {};\r\n\t\t}\r\n\r\n\t\tvar meta = dataset._meta[me.id];\r\n\t\tif (!meta) {\r\n\t\t\tmeta = dataset._meta[me.id] = {\r\n\t\t\t\ttype: null,\r\n\t\t\t\tdata: [],\r\n\t\t\t\tdataset: null,\r\n\t\t\t\tcontroller: null,\r\n\t\t\t\thidden: null,\t\t\t// See isDatasetVisible() comment\r\n\t\t\t\txAxisID: null,\r\n\t\t\t\tyAxisID: null,\r\n\t\t\t\torder: dataset.order || 0,\r\n\t\t\t\tindex: datasetIndex\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn meta;\r\n\t},\r\n\r\n\tgetVisibleDatasetCount: function() {\r\n\t\tvar count = 0;\r\n\t\tfor (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\r\n\t\t\tif (this.isDatasetVisible(i)) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t},\r\n\r\n\tisDatasetVisible: function(datasetIndex) {\r\n\t\tvar meta = this.getDatasetMeta(datasetIndex);\r\n\r\n\t\t// meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\r\n\t\t// the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\r\n\t\treturn typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;\r\n\t},\r\n\r\n\tgenerateLegend: function() {\r\n\t\treturn this.options.legendCallback(this);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tdestroyDatasetMeta: function(datasetIndex) {\r\n\t\tvar id = this.id;\r\n\t\tvar dataset = this.data.datasets[datasetIndex];\r\n\t\tvar meta = dataset._meta && dataset._meta[id];\r\n\r\n\t\tif (meta) {\r\n\t\t\tmeta.controller.destroy();\r\n\t\t\tdelete dataset._meta[id];\r\n\t\t}\r\n\t},\r\n\r\n\tdestroy: function() {\r\n\t\tvar me = this;\r\n\t\tvar canvas = me.canvas;\r\n\t\tvar i, ilen;\r\n\r\n\t\tme.stop();\r\n\r\n\t\t// dataset controllers need to cleanup associated data\r\n\t\tfor (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\r\n\t\t\tme.destroyDatasetMeta(i);\r\n\t\t}\r\n\r\n\t\tif (canvas) {\r\n\t\t\tme.unbindEvents();\r\n\t\t\thelpers$1.canvas.clear(me);\r\n\t\t\tplatform.releaseContext(me.ctx);\r\n\t\t\tme.canvas = null;\r\n\t\t\tme.ctx = null;\r\n\t\t}\r\n\r\n\t\tcore_plugins.notify(me, 'destroy');\r\n\r\n\t\tdelete Chart.instances[me.id];\r\n\t},\r\n\r\n\ttoBase64Image: function() {\r\n\t\treturn this.canvas.toDataURL.apply(this.canvas, arguments);\r\n\t},\r\n\r\n\tinitToolTip: function() {\r\n\t\tvar me = this;\r\n\t\tme.tooltip = new core_tooltip({\r\n\t\t\t_chart: me,\r\n\t\t\t_chartInstance: me, // deprecated, backward compatibility\r\n\t\t\t_data: me.data,\r\n\t\t\t_options: me.options.tooltips\r\n\t\t}, me);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tbindEvents: function() {\r\n\t\tvar me = this;\r\n\t\tvar listeners = me._listeners = {};\r\n\t\tvar listener = function() {\r\n\t\t\tme.eventHandler.apply(me, arguments);\r\n\t\t};\r\n\r\n\t\thelpers$1.each(me.options.events, function(type) {\r\n\t\t\tplatform.addEventListener(me, type, listener);\r\n\t\t\tlisteners[type] = listener;\r\n\t\t});\r\n\r\n\t\t// Elements used to detect size change should not be injected for non responsive charts.\r\n\t\t// See https://github.com/chartjs/Chart.js/issues/2210\r\n\t\tif (me.options.responsive) {\r\n\t\t\tlistener = function() {\r\n\t\t\t\tme.resize();\r\n\t\t\t};\r\n\r\n\t\t\tplatform.addEventListener(me, 'resize', listener);\r\n\t\t\tlisteners.resize = listener;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tunbindEvents: function() {\r\n\t\tvar me = this;\r\n\t\tvar listeners = me._listeners;\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tdelete me._listeners;\r\n\t\thelpers$1.each(listeners, function(listener, type) {\r\n\t\t\tplatform.removeEventListener(me, type, listener);\r\n\t\t});\r\n\t},\r\n\r\n\tupdateHoverStyle: function(elements, mode, enabled) {\r\n\t\tvar prefix = enabled ? 'set' : 'remove';\r\n\t\tvar element, i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = elements.length; i < ilen; ++i) {\r\n\t\t\telement = elements[i];\r\n\t\t\tif (element) {\r\n\t\t\t\tthis.getDatasetMeta(element._datasetIndex).controller[prefix + 'HoverStyle'](element);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (mode === 'dataset') {\r\n\t\t\tthis.getDatasetMeta(elements[0]._datasetIndex).controller['_' + prefix + 'DatasetHoverStyle']();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\teventHandler: function(e) {\r\n\t\tvar me = this;\r\n\t\tvar tooltip = me.tooltip;\r\n\r\n\t\tif (core_plugins.notify(me, 'beforeEvent', [e]) === false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Buffer any update calls so that renders do not occur\r\n\t\tme._bufferedRender = true;\r\n\t\tme._bufferedRequest = null;\r\n\r\n\t\tvar changed = me.handleEvent(e);\r\n\t\t// for smooth tooltip animations issue #4989\r\n\t\t// the tooltip should be the source of change\r\n\t\t// Animation check workaround:\r\n\t\t// tooltip._start will be null when tooltip isn't animating\r\n\t\tif (tooltip) {\r\n\t\t\tchanged = tooltip._start\r\n\t\t\t\t? tooltip.handleEvent(e)\r\n\t\t\t\t: changed | tooltip.handleEvent(e);\r\n\t\t}\r\n\r\n\t\tcore_plugins.notify(me, 'afterEvent', [e]);\r\n\r\n\t\tvar bufferedRequest = me._bufferedRequest;\r\n\t\tif (bufferedRequest) {\r\n\t\t\t// If we have an update that was triggered, we need to do a normal render\r\n\t\t\tme.render(bufferedRequest);\r\n\t\t} else if (changed && !me.animating) {\r\n\t\t\t// If entering, leaving, or changing elements, animate the change via pivot\r\n\t\t\tme.stop();\r\n\r\n\t\t\t// We only need to render at this point. Updating will cause scales to be\r\n\t\t\t// recomputed generating flicker & using more memory than necessary.\r\n\t\t\tme.render({\r\n\t\t\t\tduration: me.options.hover.animationDuration,\r\n\t\t\t\tlazy: true\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tme._bufferedRender = false;\r\n\t\tme._bufferedRequest = null;\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\t/**\r\n\t * Handle an event\r\n\t * @private\r\n\t * @param {IEvent} event the event to handle\r\n\t * @return {boolean} true if the chart needs to re-render\r\n\t */\r\n\thandleEvent: function(e) {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options || {};\r\n\t\tvar hoverOptions = options.hover;\r\n\t\tvar changed = false;\r\n\r\n\t\tme.lastActive = me.lastActive || [];\r\n\r\n\t\t// Find Active Elements for hover and tooltips\r\n\t\tif (e.type === 'mouseout') {\r\n\t\t\tme.active = [];\r\n\t\t} else {\r\n\t\t\tme.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);\r\n\t\t}\r\n\r\n\t\t// Invoke onHover hook\r\n\t\t// Need to call with native event here to not break backwards compatibility\r\n\t\thelpers$1.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);\r\n\r\n\t\tif (e.type === 'mouseup' || e.type === 'click') {\r\n\t\t\tif (options.onClick) {\r\n\t\t\t\t// Use e.native here for backwards compatibility\r\n\t\t\t\toptions.onClick.call(me, e.native, me.active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Remove styling for last active (even if it may still be active)\r\n\t\tif (me.lastActive.length) {\r\n\t\t\tme.updateHoverStyle(me.lastActive, hoverOptions.mode, false);\r\n\t\t}\r\n\r\n\t\t// Built in hover styling\r\n\t\tif (me.active.length && hoverOptions.mode) {\r\n\t\t\tme.updateHoverStyle(me.active, hoverOptions.mode, true);\r\n\t\t}\r\n\r\n\t\tchanged = !helpers$1.arrayEquals(me.active, me.lastActive);\r\n\r\n\t\t// Remember Last Actives\r\n\t\tme.lastActive = me.active;\r\n\r\n\t\treturn changed;\r\n\t}\r\n});\r\n\r\n/**\r\n * NOTE(SB) We actually don't use this container anymore but we need to keep it\r\n * for backward compatibility. Though, it can still be useful for plugins that\r\n * would need to work on multiple charts?!\r\n */\r\nChart.instances = {};\r\n\r\nvar core_controller = Chart;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart instead.\r\n * @class Chart.Controller\r\n * @deprecated since version 2.6\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nChart.Controller = Chart;\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore.\r\n * @namespace Chart\r\n * @deprecated since version 2.8\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nChart.types = {};\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore.\r\n * @namespace Chart.helpers.configMerge\r\n * @deprecated since version 2.8.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers$1.configMerge = mergeConfig;\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore.\r\n * @namespace Chart.helpers.scaleMerge\r\n * @deprecated since version 2.8.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers$1.scaleMerge = mergeScaleConfig;\n\nvar core_helpers = function() {\r\n\r\n\t// -- Basic js utility methods\r\n\r\n\thelpers$1.where = function(collection, filterCallback) {\r\n\t\tif (helpers$1.isArray(collection) && Array.prototype.filter) {\r\n\t\t\treturn collection.filter(filterCallback);\r\n\t\t}\r\n\t\tvar filtered = [];\r\n\r\n\t\thelpers$1.each(collection, function(item) {\r\n\t\t\tif (filterCallback(item)) {\r\n\t\t\t\tfiltered.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filtered;\r\n\t};\r\n\thelpers$1.findIndex = Array.prototype.findIndex ?\r\n\t\tfunction(array, callback, scope) {\r\n\t\t\treturn array.findIndex(callback, scope);\r\n\t\t} :\r\n\t\tfunction(array, callback, scope) {\r\n\t\t\tscope = scope === undefined ? array : scope;\r\n\t\t\tfor (var i = 0, ilen = array.length; i < ilen; ++i) {\r\n\t\t\t\tif (callback.call(scope, array[i], i, array)) {\r\n\t\t\t\t\treturn i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t};\r\n\thelpers$1.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {\r\n\t\t// Default to start of the array\r\n\t\tif (helpers$1.isNullOrUndef(startIndex)) {\r\n\t\t\tstartIndex = -1;\r\n\t\t}\r\n\t\tfor (var i = startIndex + 1; i < arrayToSearch.length; i++) {\r\n\t\t\tvar currentItem = arrayToSearch[i];\r\n\t\t\tif (filterCallback(currentItem)) {\r\n\t\t\t\treturn currentItem;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\thelpers$1.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {\r\n\t\t// Default to end of the array\r\n\t\tif (helpers$1.isNullOrUndef(startIndex)) {\r\n\t\t\tstartIndex = arrayToSearch.length;\r\n\t\t}\r\n\t\tfor (var i = startIndex - 1; i >= 0; i--) {\r\n\t\t\tvar currentItem = arrayToSearch[i];\r\n\t\t\tif (filterCallback(currentItem)) {\r\n\t\t\t\treturn currentItem;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// -- Math methods\r\n\thelpers$1.isNumber = function(n) {\r\n\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\r\n\t};\r\n\thelpers$1.almostEquals = function(x, y, epsilon) {\r\n\t\treturn Math.abs(x - y) < epsilon;\r\n\t};\r\n\thelpers$1.almostWhole = function(x, epsilon) {\r\n\t\tvar rounded = Math.round(x);\r\n\t\treturn ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\r\n\t};\r\n\thelpers$1.max = function(array) {\r\n\t\treturn array.reduce(function(max, value) {\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\treturn Math.max(max, value);\r\n\t\t\t}\r\n\t\t\treturn max;\r\n\t\t}, Number.NEGATIVE_INFINITY);\r\n\t};\r\n\thelpers$1.min = function(array) {\r\n\t\treturn array.reduce(function(min, value) {\r\n\t\t\tif (!isNaN(value)) {\r\n\t\t\t\treturn Math.min(min, value);\r\n\t\t\t}\r\n\t\t\treturn min;\r\n\t\t}, Number.POSITIVE_INFINITY);\r\n\t};\r\n\thelpers$1.sign = Math.sign ?\r\n\t\tfunction(x) {\r\n\t\t\treturn Math.sign(x);\r\n\t\t} :\r\n\t\tfunction(x) {\r\n\t\t\tx = +x; // convert to a number\r\n\t\t\tif (x === 0 || isNaN(x)) {\r\n\t\t\t\treturn x;\r\n\t\t\t}\r\n\t\t\treturn x > 0 ? 1 : -1;\r\n\t\t};\r\n\thelpers$1.toRadians = function(degrees) {\r\n\t\treturn degrees * (Math.PI / 180);\r\n\t};\r\n\thelpers$1.toDegrees = function(radians) {\r\n\t\treturn radians * (180 / Math.PI);\r\n\t};\r\n\r\n\t/**\r\n\t * Returns the number of decimal places\r\n\t * i.e. the number of digits after the decimal point, of the value of this Number.\r\n\t * @param {number} x - A number.\r\n\t * @returns {number} The number of decimal places.\r\n\t * @private\r\n\t */\r\n\thelpers$1._decimalPlaces = function(x) {\r\n\t\tif (!helpers$1.isFinite(x)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar e = 1;\r\n\t\tvar p = 0;\r\n\t\twhile (Math.round(x * e) / e !== x) {\r\n\t\t\te *= 10;\r\n\t\t\tp++;\r\n\t\t}\r\n\t\treturn p;\r\n\t};\r\n\r\n\t// Gets the angle from vertical upright to the point about a centre.\r\n\thelpers$1.getAngleFromPoint = function(centrePoint, anglePoint) {\r\n\t\tvar distanceFromXCenter = anglePoint.x - centrePoint.x;\r\n\t\tvar distanceFromYCenter = anglePoint.y - centrePoint.y;\r\n\t\tvar radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\r\n\r\n\t\tvar angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\r\n\r\n\t\tif (angle < (-0.5 * Math.PI)) {\r\n\t\t\tangle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tangle: angle,\r\n\t\t\tdistance: radialDistanceFromCenter\r\n\t\t};\r\n\t};\r\n\thelpers$1.distanceBetweenPoints = function(pt1, pt2) {\r\n\t\treturn Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\r\n\t};\r\n\r\n\t/**\r\n\t * Provided for backward compatibility, not available anymore\r\n\t * @function Chart.helpers.aliasPixel\r\n\t * @deprecated since version 2.8.0\r\n\t * @todo remove at version 3\r\n\t */\r\n\thelpers$1.aliasPixel = function(pixelWidth) {\r\n\t\treturn (pixelWidth % 2 === 0) ? 0 : 0.5;\r\n\t};\r\n\r\n\t/**\r\n\t * Returns the aligned pixel value to avoid anti-aliasing blur\r\n\t * @param {Chart} chart - The chart instance.\r\n\t * @param {number} pixel - A pixel value.\r\n\t * @param {number} width - The width of the element.\r\n\t * @returns {number} The aligned pixel value.\r\n\t * @private\r\n\t */\r\n\thelpers$1._alignPixel = function(chart, pixel, width) {\r\n\t\tvar devicePixelRatio = chart.currentDevicePixelRatio;\r\n\t\tvar halfWidth = width / 2;\r\n\t\treturn Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\r\n\t};\r\n\r\n\thelpers$1.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {\r\n\t\t// Props to Rob Spencer at scaled innovation for his post on splining between points\r\n\t\t// http://scaledinnovation.com/analytics/splines/aboutSplines.html\r\n\r\n\t\t// This function must also respect \"skipped\" points\r\n\r\n\t\tvar previous = firstPoint.skip ? middlePoint : firstPoint;\r\n\t\tvar current = middlePoint;\r\n\t\tvar next = afterPoint.skip ? middlePoint : afterPoint;\r\n\r\n\t\tvar d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));\r\n\t\tvar d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));\r\n\r\n\t\tvar s01 = d01 / (d01 + d12);\r\n\t\tvar s12 = d12 / (d01 + d12);\r\n\r\n\t\t// If all points are the same, s01 & s02 will be inf\r\n\t\ts01 = isNaN(s01) ? 0 : s01;\r\n\t\ts12 = isNaN(s12) ? 0 : s12;\r\n\r\n\t\tvar fa = t * s01; // scaling factor for triangle Ta\r\n\t\tvar fb = t * s12;\r\n\r\n\t\treturn {\r\n\t\t\tprevious: {\r\n\t\t\t\tx: current.x - fa * (next.x - previous.x),\r\n\t\t\t\ty: current.y - fa * (next.y - previous.y)\r\n\t\t\t},\r\n\t\t\tnext: {\r\n\t\t\t\tx: current.x + fb * (next.x - previous.x),\r\n\t\t\t\ty: current.y + fb * (next.y - previous.y)\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\thelpers$1.EPSILON = Number.EPSILON || 1e-14;\r\n\thelpers$1.splineCurveMonotone = function(points) {\r\n\t\t// This function calculates Bézier control points in a similar way than |splineCurve|,\r\n\t\t// but preserves monotonicity of the provided data and ensures no local extremums are added\r\n\t\t// between the dataset discrete points due to the interpolation.\r\n\t\t// See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\r\n\r\n\t\tvar pointsWithTangents = (points || []).map(function(point) {\r\n\t\t\treturn {\r\n\t\t\t\tmodel: point._model,\r\n\t\t\t\tdeltaK: 0,\r\n\t\t\t\tmK: 0\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\t// Calculate slopes (deltaK) and initialize tangents (mK)\r\n\t\tvar pointsLen = pointsWithTangents.length;\r\n\t\tvar i, pointBefore, pointCurrent, pointAfter;\r\n\t\tfor (i = 0; i < pointsLen; ++i) {\r\n\t\t\tpointCurrent = pointsWithTangents[i];\r\n\t\t\tif (pointCurrent.model.skip) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\r\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\r\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\r\n\t\t\t\tvar slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);\r\n\r\n\t\t\t\t// In the case of two points that appear at the same x pixel, slopeDeltaX is 0\r\n\t\t\t\tpointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (!pointBefore || pointBefore.model.skip) {\r\n\t\t\t\tpointCurrent.mK = pointCurrent.deltaK;\r\n\t\t\t} else if (!pointAfter || pointAfter.model.skip) {\r\n\t\t\t\tpointCurrent.mK = pointBefore.deltaK;\r\n\t\t\t} else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {\r\n\t\t\t\tpointCurrent.mK = 0;\r\n\t\t\t} else {\r\n\t\t\t\tpointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Adjust tangents to ensure monotonic properties\r\n\t\tvar alphaK, betaK, tauK, squaredMagnitude;\r\n\t\tfor (i = 0; i < pointsLen - 1; ++i) {\r\n\t\t\tpointCurrent = pointsWithTangents[i];\r\n\t\t\tpointAfter = pointsWithTangents[i + 1];\r\n\t\t\tif (pointCurrent.model.skip || pointAfter.model.skip) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (helpers$1.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {\r\n\t\t\t\tpointCurrent.mK = pointAfter.mK = 0;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\talphaK = pointCurrent.mK / pointCurrent.deltaK;\r\n\t\t\tbetaK = pointAfter.mK / pointCurrent.deltaK;\r\n\t\t\tsquaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\r\n\t\t\tif (squaredMagnitude <= 9) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\ttauK = 3 / Math.sqrt(squaredMagnitude);\r\n\t\t\tpointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;\r\n\t\t\tpointAfter.mK = betaK * tauK * pointCurrent.deltaK;\r\n\t\t}\r\n\r\n\t\t// Compute control points\r\n\t\tvar deltaX;\r\n\t\tfor (i = 0; i < pointsLen; ++i) {\r\n\t\t\tpointCurrent = pointsWithTangents[i];\r\n\t\t\tif (pointCurrent.model.skip) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tpointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\r\n\t\t\tpointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\r\n\t\t\tif (pointBefore && !pointBefore.model.skip) {\r\n\t\t\t\tdeltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;\r\n\t\t\t\tpointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;\r\n\t\t\t\tpointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;\r\n\t\t\t}\r\n\t\t\tif (pointAfter && !pointAfter.model.skip) {\r\n\t\t\t\tdeltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;\r\n\t\t\t\tpointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;\r\n\t\t\t\tpointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\thelpers$1.nextItem = function(collection, index, loop) {\r\n\t\tif (loop) {\r\n\t\t\treturn index >= collection.length - 1 ? collection[0] : collection[index + 1];\r\n\t\t}\r\n\t\treturn index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];\r\n\t};\r\n\thelpers$1.previousItem = function(collection, index, loop) {\r\n\t\tif (loop) {\r\n\t\t\treturn index <= 0 ? collection[collection.length - 1] : collection[index - 1];\r\n\t\t}\r\n\t\treturn index <= 0 ? collection[0] : collection[index - 1];\r\n\t};\r\n\t// Implementation of the nice number algorithm used in determining where axis labels will go\r\n\thelpers$1.niceNum = function(range, round) {\r\n\t\tvar exponent = Math.floor(helpers$1.log10(range));\r\n\t\tvar fraction = range / Math.pow(10, exponent);\r\n\t\tvar niceFraction;\r\n\r\n\t\tif (round) {\r\n\t\t\tif (fraction < 1.5) {\r\n\t\t\t\tniceFraction = 1;\r\n\t\t\t} else if (fraction < 3) {\r\n\t\t\t\tniceFraction = 2;\r\n\t\t\t} else if (fraction < 7) {\r\n\t\t\t\tniceFraction = 5;\r\n\t\t\t} else {\r\n\t\t\t\tniceFraction = 10;\r\n\t\t\t}\r\n\t\t} else if (fraction <= 1.0) {\r\n\t\t\tniceFraction = 1;\r\n\t\t} else if (fraction <= 2) {\r\n\t\t\tniceFraction = 2;\r\n\t\t} else if (fraction <= 5) {\r\n\t\t\tniceFraction = 5;\r\n\t\t} else {\r\n\t\t\tniceFraction = 10;\r\n\t\t}\r\n\r\n\t\treturn niceFraction * Math.pow(10, exponent);\r\n\t};\r\n\t// Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\thelpers$1.requestAnimFrame = (function() {\r\n\t\tif (typeof window === 'undefined') {\r\n\t\t\treturn function(callback) {\r\n\t\t\t\tcallback();\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn window.requestAnimationFrame ||\r\n\t\t\twindow.webkitRequestAnimationFrame ||\r\n\t\t\twindow.mozRequestAnimationFrame ||\r\n\t\t\twindow.oRequestAnimationFrame ||\r\n\t\t\twindow.msRequestAnimationFrame ||\r\n\t\t\tfunction(callback) {\r\n\t\t\t\treturn window.setTimeout(callback, 1000 / 60);\r\n\t\t\t};\r\n\t}());\r\n\t// -- DOM methods\r\n\thelpers$1.getRelativePosition = function(evt, chart) {\r\n\t\tvar mouseX, mouseY;\r\n\t\tvar e = evt.originalEvent || evt;\r\n\t\tvar canvas = evt.target || evt.srcElement;\r\n\t\tvar boundingRect = canvas.getBoundingClientRect();\r\n\r\n\t\tvar touches = e.touches;\r\n\t\tif (touches && touches.length > 0) {\r\n\t\t\tmouseX = touches[0].clientX;\r\n\t\t\tmouseY = touches[0].clientY;\r\n\r\n\t\t} else {\r\n\t\t\tmouseX = e.clientX;\r\n\t\t\tmouseY = e.clientY;\r\n\t\t}\r\n\r\n\t\t// Scale mouse coordinates into canvas coordinates\r\n\t\t// by following the pattern laid out by 'jerryj' in the comments of\r\n\t\t// https://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/\r\n\t\tvar paddingLeft = parseFloat(helpers$1.getStyle(canvas, 'padding-left'));\r\n\t\tvar paddingTop = parseFloat(helpers$1.getStyle(canvas, 'padding-top'));\r\n\t\tvar paddingRight = parseFloat(helpers$1.getStyle(canvas, 'padding-right'));\r\n\t\tvar paddingBottom = parseFloat(helpers$1.getStyle(canvas, 'padding-bottom'));\r\n\t\tvar width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;\r\n\t\tvar height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;\r\n\r\n\t\t// We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However\r\n\t\t// the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here\r\n\t\tmouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);\r\n\t\tmouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);\r\n\r\n\t\treturn {\r\n\t\t\tx: mouseX,\r\n\t\t\ty: mouseY\r\n\t\t};\r\n\r\n\t};\r\n\r\n\t// Private helper function to convert max-width/max-height values that may be percentages into a number\r\n\tfunction parseMaxStyle(styleValue, node, parentProperty) {\r\n\t\tvar valueInPixels;\r\n\t\tif (typeof styleValue === 'string') {\r\n\t\t\tvalueInPixels = parseInt(styleValue, 10);\r\n\r\n\t\t\tif (styleValue.indexOf('%') !== -1) {\r\n\t\t\t\t// percentage * size in dimension\r\n\t\t\t\tvalueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvalueInPixels = styleValue;\r\n\t\t}\r\n\r\n\t\treturn valueInPixels;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if the given value contains an effective constraint.\r\n\t * @private\r\n\t */\r\n\tfunction isConstrainedValue(value) {\r\n\t\treturn value !== undefined && value !== null && value !== 'none';\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the max width or height of the given DOM node in a cross-browser compatible fashion\r\n\t * @param {HTMLElement} domNode - the node to check the constraint on\r\n\t * @param {string} maxStyle - the style that defines the maximum for the direction we are using ('max-width' / 'max-height')\r\n\t * @param {string} percentageProperty - property of parent to use when calculating width as a percentage\r\n\t * @see {@link https://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser}\r\n\t */\r\n\tfunction getConstraintDimension(domNode, maxStyle, percentageProperty) {\r\n\t\tvar view = document.defaultView;\r\n\t\tvar parentNode = helpers$1._getParentNode(domNode);\r\n\t\tvar constrainedNode = view.getComputedStyle(domNode)[maxStyle];\r\n\t\tvar constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];\r\n\t\tvar hasCNode = isConstrainedValue(constrainedNode);\r\n\t\tvar hasCContainer = isConstrainedValue(constrainedContainer);\r\n\t\tvar infinity = Number.POSITIVE_INFINITY;\r\n\r\n\t\tif (hasCNode || hasCContainer) {\r\n\t\t\treturn Math.min(\r\n\t\t\t\thasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,\r\n\t\t\t\thasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);\r\n\t\t}\r\n\r\n\t\treturn 'none';\r\n\t}\r\n\t// returns Number or undefined if no constraint\r\n\thelpers$1.getConstraintWidth = function(domNode) {\r\n\t\treturn getConstraintDimension(domNode, 'max-width', 'clientWidth');\r\n\t};\r\n\t// returns Number or undefined if no constraint\r\n\thelpers$1.getConstraintHeight = function(domNode) {\r\n\t\treturn getConstraintDimension(domNode, 'max-height', 'clientHeight');\r\n\t};\r\n\t/**\r\n\t * @private\r\n \t */\r\n\thelpers$1._calculatePadding = function(container, padding, parentDimension) {\r\n\t\tpadding = helpers$1.getStyle(container, padding);\r\n\r\n\t\treturn padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);\r\n\t};\r\n\t/**\r\n\t * @private\r\n\t */\r\n\thelpers$1._getParentNode = function(domNode) {\r\n\t\tvar parent = domNode.parentNode;\r\n\t\tif (parent && parent.toString() === '[object ShadowRoot]') {\r\n\t\t\tparent = parent.host;\r\n\t\t}\r\n\t\treturn parent;\r\n\t};\r\n\thelpers$1.getMaximumWidth = function(domNode) {\r\n\t\tvar container = helpers$1._getParentNode(domNode);\r\n\t\tif (!container) {\r\n\t\t\treturn domNode.clientWidth;\r\n\t\t}\r\n\r\n\t\tvar clientWidth = container.clientWidth;\r\n\t\tvar paddingLeft = helpers$1._calculatePadding(container, 'padding-left', clientWidth);\r\n\t\tvar paddingRight = helpers$1._calculatePadding(container, 'padding-right', clientWidth);\r\n\r\n\t\tvar w = clientWidth - paddingLeft - paddingRight;\r\n\t\tvar cw = helpers$1.getConstraintWidth(domNode);\r\n\t\treturn isNaN(cw) ? w : Math.min(w, cw);\r\n\t};\r\n\thelpers$1.getMaximumHeight = function(domNode) {\r\n\t\tvar container = helpers$1._getParentNode(domNode);\r\n\t\tif (!container) {\r\n\t\t\treturn domNode.clientHeight;\r\n\t\t}\r\n\r\n\t\tvar clientHeight = container.clientHeight;\r\n\t\tvar paddingTop = helpers$1._calculatePadding(container, 'padding-top', clientHeight);\r\n\t\tvar paddingBottom = helpers$1._calculatePadding(container, 'padding-bottom', clientHeight);\r\n\r\n\t\tvar h = clientHeight - paddingTop - paddingBottom;\r\n\t\tvar ch = helpers$1.getConstraintHeight(domNode);\r\n\t\treturn isNaN(ch) ? h : Math.min(h, ch);\r\n\t};\r\n\thelpers$1.getStyle = function(el, property) {\r\n\t\treturn el.currentStyle ?\r\n\t\t\tel.currentStyle[property] :\r\n\t\t\tdocument.defaultView.getComputedStyle(el, null).getPropertyValue(property);\r\n\t};\r\n\thelpers$1.retinaScale = function(chart, forceRatio) {\r\n\t\tvar pixelRatio = chart.currentDevicePixelRatio = forceRatio || (typeof window !== 'undefined' && window.devicePixelRatio) || 1;\r\n\t\tif (pixelRatio === 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar canvas = chart.canvas;\r\n\t\tvar height = chart.height;\r\n\t\tvar width = chart.width;\r\n\r\n\t\tcanvas.height = height * pixelRatio;\r\n\t\tcanvas.width = width * pixelRatio;\r\n\t\tchart.ctx.scale(pixelRatio, pixelRatio);\r\n\r\n\t\t// If no style has been set on the canvas, the render size is used as display size,\r\n\t\t// making the chart visually bigger, so let's enforce it to the \"correct\" values.\r\n\t\t// See https://github.com/chartjs/Chart.js/issues/3575\r\n\t\tif (!canvas.style.height && !canvas.style.width) {\r\n\t\t\tcanvas.style.height = height + 'px';\r\n\t\t\tcanvas.style.width = width + 'px';\r\n\t\t}\r\n\t};\r\n\t// -- Canvas methods\r\n\thelpers$1.fontString = function(pixelSize, fontStyle, fontFamily) {\r\n\t\treturn fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\r\n\t};\r\n\thelpers$1.longestText = function(ctx, font, arrayOfThings, cache) {\r\n\t\tcache = cache || {};\r\n\t\tvar data = cache.data = cache.data || {};\r\n\t\tvar gc = cache.garbageCollect = cache.garbageCollect || [];\r\n\r\n\t\tif (cache.font !== font) {\r\n\t\t\tdata = cache.data = {};\r\n\t\t\tgc = cache.garbageCollect = [];\r\n\t\t\tcache.font = font;\r\n\t\t}\r\n\r\n\t\tctx.font = font;\r\n\t\tvar longest = 0;\r\n\t\tvar ilen = arrayOfThings.length;\r\n\t\tvar i, j, jlen, thing, nestedThing;\r\n\t\tfor (i = 0; i < ilen; i++) {\r\n\t\t\tthing = arrayOfThings[i];\r\n\r\n\t\t\t// Undefined strings and arrays should not be measured\r\n\t\t\tif (thing !== undefined && thing !== null && helpers$1.isArray(thing) !== true) {\r\n\t\t\t\tlongest = helpers$1.measureText(ctx, data, gc, longest, thing);\r\n\t\t\t} else if (helpers$1.isArray(thing)) {\r\n\t\t\t\t// if it is an array lets measure each element\r\n\t\t\t\t// to do maybe simplify this function a bit so we can do this more recursively?\r\n\t\t\t\tfor (j = 0, jlen = thing.length; j < jlen; j++) {\r\n\t\t\t\t\tnestedThing = thing[j];\r\n\t\t\t\t\t// Undefined strings and arrays should not be measured\r\n\t\t\t\t\tif (nestedThing !== undefined && nestedThing !== null && !helpers$1.isArray(nestedThing)) {\r\n\t\t\t\t\t\tlongest = helpers$1.measureText(ctx, data, gc, longest, nestedThing);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar gcLen = gc.length / 2;\r\n\t\tif (gcLen > arrayOfThings.length) {\r\n\t\t\tfor (i = 0; i < gcLen; i++) {\r\n\t\t\t\tdelete data[gc[i]];\r\n\t\t\t}\r\n\t\t\tgc.splice(0, gcLen);\r\n\t\t}\r\n\t\treturn longest;\r\n\t};\r\n\thelpers$1.measureText = function(ctx, data, gc, longest, string) {\r\n\t\tvar textWidth = data[string];\r\n\t\tif (!textWidth) {\r\n\t\t\ttextWidth = data[string] = ctx.measureText(string).width;\r\n\t\t\tgc.push(string);\r\n\t\t}\r\n\t\tif (textWidth > longest) {\r\n\t\t\tlongest = textWidth;\r\n\t\t}\r\n\t\treturn longest;\r\n\t};\r\n\r\n\t/**\r\n\t * @deprecated\r\n\t */\r\n\thelpers$1.numberOfLabelLines = function(arrayOfThings) {\r\n\t\tvar numberOfLines = 1;\r\n\t\thelpers$1.each(arrayOfThings, function(thing) {\r\n\t\t\tif (helpers$1.isArray(thing)) {\r\n\t\t\t\tif (thing.length > numberOfLines) {\r\n\t\t\t\t\tnumberOfLines = thing.length;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn numberOfLines;\r\n\t};\r\n\r\n\thelpers$1.color = !chartjsColor ?\r\n\t\tfunction(value) {\r\n\t\t\tconsole.error('Color.js not found!');\r\n\t\t\treturn value;\r\n\t\t} :\r\n\t\tfunction(value) {\r\n\t\t\t/* global CanvasGradient */\r\n\t\t\tif (value instanceof CanvasGradient) {\r\n\t\t\t\tvalue = core_defaults.global.defaultColor;\r\n\t\t\t}\r\n\r\n\t\t\treturn chartjsColor(value);\r\n\t\t};\r\n\r\n\thelpers$1.getHoverColor = function(colorValue) {\r\n\t\t/* global CanvasPattern */\r\n\t\treturn (colorValue instanceof CanvasPattern || colorValue instanceof CanvasGradient) ?\r\n\t\t\tcolorValue :\r\n\t\t\thelpers$1.color(colorValue).saturate(0.5).darken(0.1).rgbString();\r\n\t};\r\n};\n\nfunction abstract() {\r\n\tthrow new Error(\r\n\t\t'This method is not implemented: either no adapter can ' +\r\n\t\t'be found or an incomplete integration was provided.'\r\n\t);\r\n}\r\n\r\n/**\r\n * Date adapter (current used by the time scale)\r\n * @namespace Chart._adapters._date\r\n * @memberof Chart._adapters\r\n * @private\r\n */\r\n\r\n/**\r\n * Currently supported unit string values.\r\n * @typedef {('millisecond'|'second'|'minute'|'hour'|'day'|'week'|'month'|'quarter'|'year')}\r\n * @memberof Chart._adapters._date\r\n * @name Unit\r\n */\r\n\r\n/**\r\n * @class\r\n */\r\nfunction DateAdapter(options) {\r\n\tthis.options = options || {};\r\n}\r\n\r\nhelpers$1.extend(DateAdapter.prototype, /** @lends DateAdapter */ {\r\n\t/**\r\n\t * Returns a map of time formats for the supported formatting units defined\r\n\t * in Unit as well as 'datetime' representing a detailed date/time string.\r\n\t * @returns {{string: string}}\r\n\t */\r\n\tformats: abstract,\r\n\r\n\t/**\r\n\t * Parses the given `value` and return the associated timestamp.\r\n\t * @param {any} value - the value to parse (usually comes from the data)\r\n\t * @param {string} [format] - the expected data format\r\n\t * @returns {(number|null)}\r\n\t * @function\r\n\t */\r\n\tparse: abstract,\r\n\r\n\t/**\r\n\t * Returns the formatted date in the specified `format` for a given `timestamp`.\r\n\t * @param {number} timestamp - the timestamp to format\r\n\t * @param {string} format - the date/time token\r\n\t * @return {string}\r\n\t * @function\r\n\t */\r\n\tformat: abstract,\r\n\r\n\t/**\r\n\t * Adds the specified `amount` of `unit` to the given `timestamp`.\r\n\t * @param {number} timestamp - the input timestamp\r\n\t * @param {number} amount - the amount to add\r\n\t * @param {Unit} unit - the unit as string\r\n\t * @return {number}\r\n\t * @function\r\n\t */\r\n\tadd: abstract,\r\n\r\n\t/**\r\n\t * Returns the number of `unit` between the given timestamps.\r\n\t * @param {number} max - the input timestamp (reference)\r\n\t * @param {number} min - the timestamp to substract\r\n\t * @param {Unit} unit - the unit as string\r\n\t * @return {number}\r\n\t * @function\r\n\t */\r\n\tdiff: abstract,\r\n\r\n\t/**\r\n\t * Returns start of `unit` for the given `timestamp`.\r\n\t * @param {number} timestamp - the input timestamp\r\n\t * @param {Unit} unit - the unit as string\r\n\t * @param {number} [weekday] - the ISO day of the week with 1 being Monday\r\n\t * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\r\n\t * @function\r\n\t */\r\n\tstartOf: abstract,\r\n\r\n\t/**\r\n\t * Returns end of `unit` for the given `timestamp`.\r\n\t * @param {number} timestamp - the input timestamp\r\n\t * @param {Unit} unit - the unit as string\r\n\t * @function\r\n\t */\r\n\tendOf: abstract,\r\n\r\n\t// DEPRECATIONS\r\n\r\n\t/**\r\n\t * Provided for backward compatibility for scale.getValueForPixel(),\r\n\t * this method should be overridden only by the moment adapter.\r\n\t * @deprecated since version 2.8.0\r\n\t * @todo remove at version 3\r\n\t * @private\r\n\t */\r\n\t_create: function(value) {\r\n\t\treturn value;\r\n\t}\r\n});\r\n\r\nDateAdapter.override = function(members) {\r\n\thelpers$1.extend(DateAdapter.prototype, members);\r\n};\r\n\r\nvar _date = DateAdapter;\n\nvar core_adapters = {\n\t_date: _date\n};\n\n/**\r\n * Namespace to hold static tick generation functions\r\n * @namespace Chart.Ticks\r\n */\r\nvar core_ticks = {\r\n\t/**\r\n\t * Namespace to hold formatters for different types of ticks\r\n\t * @namespace Chart.Ticks.formatters\r\n\t */\r\n\tformatters: {\r\n\t\t/**\r\n\t\t * Formatter for value labels\r\n\t\t * @method Chart.Ticks.formatters.values\r\n\t\t * @param value the value to display\r\n\t\t * @return {string|string[]} the label to display\r\n\t\t */\r\n\t\tvalues: function(value) {\r\n\t\t\treturn helpers$1.isArray(value) ? value : '' + value;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Formatter for linear numeric ticks\r\n\t\t * @method Chart.Ticks.formatters.linear\r\n\t\t * @param tickValue {number} the value to be formatted\r\n\t\t * @param index {number} the position of the tickValue parameter in the ticks array\r\n\t\t * @param ticks {number[]} the list of ticks being converted\r\n\t\t * @return {string} string representation of the tickValue parameter\r\n\t\t */\r\n\t\tlinear: function(tickValue, index, ticks) {\r\n\t\t\t// If we have lots of ticks, don't use the ones\r\n\t\t\tvar delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];\r\n\r\n\t\t\t// If we have a number like 2.5 as the delta, figure out how many decimal places we need\r\n\t\t\tif (Math.abs(delta) > 1) {\r\n\t\t\t\tif (tickValue !== Math.floor(tickValue)) {\r\n\t\t\t\t\t// not an integer\r\n\t\t\t\t\tdelta = tickValue - Math.floor(tickValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar logDelta = helpers$1.log10(Math.abs(delta));\r\n\t\t\tvar tickString = '';\r\n\r\n\t\t\tif (tickValue !== 0) {\r\n\t\t\t\tvar maxTick = Math.max(Math.abs(ticks[0]), Math.abs(ticks[ticks.length - 1]));\r\n\t\t\t\tif (maxTick < 1e-4) { // all ticks are small numbers; use scientific notation\r\n\t\t\t\t\tvar logTick = helpers$1.log10(Math.abs(tickValue));\r\n\t\t\t\t\tvar numExponential = Math.floor(logTick) - Math.floor(logDelta);\r\n\t\t\t\t\tnumExponential = Math.max(Math.min(numExponential, 20), 0);\r\n\t\t\t\t\ttickString = tickValue.toExponential(numExponential);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar numDecimal = -1 * Math.floor(logDelta);\r\n\t\t\t\t\tnumDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places\r\n\t\t\t\t\ttickString = tickValue.toFixed(numDecimal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttickString = '0'; // never show decimal places for 0\r\n\t\t\t}\r\n\r\n\t\t\treturn tickString;\r\n\t\t},\r\n\r\n\t\tlogarithmic: function(tickValue, index, ticks) {\r\n\t\t\tvar remain = tickValue / (Math.pow(10, Math.floor(helpers$1.log10(tickValue))));\r\n\r\n\t\t\tif (tickValue === 0) {\r\n\t\t\t\treturn '0';\r\n\t\t\t} else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {\r\n\t\t\t\treturn tickValue.toExponential();\r\n\t\t\t}\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}\r\n};\n\nvar isArray = helpers$1.isArray;\r\nvar isNullOrUndef = helpers$1.isNullOrUndef;\r\nvar valueOrDefault$a = helpers$1.valueOrDefault;\r\nvar valueAtIndexOrDefault = helpers$1.valueAtIndexOrDefault;\r\n\r\ncore_defaults._set('scale', {\r\n\tdisplay: true,\r\n\tposition: 'left',\r\n\toffset: false,\r\n\r\n\t// grid line settings\r\n\tgridLines: {\r\n\t\tdisplay: true,\r\n\t\tcolor: 'rgba(0,0,0,0.1)',\r\n\t\tlineWidth: 1,\r\n\t\tdrawBorder: true,\r\n\t\tdrawOnChartArea: true,\r\n\t\tdrawTicks: true,\r\n\t\ttickMarkLength: 10,\r\n\t\tzeroLineWidth: 1,\r\n\t\tzeroLineColor: 'rgba(0,0,0,0.25)',\r\n\t\tzeroLineBorderDash: [],\r\n\t\tzeroLineBorderDashOffset: 0.0,\r\n\t\toffsetGridLines: false,\r\n\t\tborderDash: [],\r\n\t\tborderDashOffset: 0.0\r\n\t},\r\n\r\n\t// scale label\r\n\tscaleLabel: {\r\n\t\t// display property\r\n\t\tdisplay: false,\r\n\r\n\t\t// actual label\r\n\t\tlabelString: '',\r\n\r\n\t\t// top/bottom padding\r\n\t\tpadding: {\r\n\t\t\ttop: 4,\r\n\t\t\tbottom: 4\r\n\t\t}\r\n\t},\r\n\r\n\t// label settings\r\n\tticks: {\r\n\t\tbeginAtZero: false,\r\n\t\tminRotation: 0,\r\n\t\tmaxRotation: 50,\r\n\t\tmirror: false,\r\n\t\tpadding: 0,\r\n\t\treverse: false,\r\n\t\tdisplay: true,\r\n\t\tautoSkip: true,\r\n\t\tautoSkipPadding: 0,\r\n\t\tlabelOffset: 0,\r\n\t\t// We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\r\n\t\tcallback: core_ticks.formatters.values,\r\n\t\tminor: {},\r\n\t\tmajor: {}\r\n\t}\r\n});\r\n\r\n/** Returns a new array containing numItems from arr */\r\nfunction sample(arr, numItems) {\r\n\tvar result = [];\r\n\tvar increment = arr.length / numItems;\r\n\tvar i = 0;\r\n\tvar len = arr.length;\r\n\r\n\tfor (; i < len; i += increment) {\r\n\t\tresult.push(arr[Math.floor(i)]);\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\r\n\tvar length = scale.getTicks().length;\r\n\tvar validIndex = Math.min(index, length - 1);\r\n\tvar lineValue = scale.getPixelForTick(validIndex);\r\n\tvar start = scale._startPixel;\r\n\tvar end = scale._endPixel;\r\n\tvar epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\r\n\tvar offset;\r\n\r\n\tif (offsetGridLines) {\r\n\t\tif (length === 1) {\r\n\t\t\toffset = Math.max(lineValue - start, end - lineValue);\r\n\t\t} else if (index === 0) {\r\n\t\t\toffset = (scale.getPixelForTick(1) - lineValue) / 2;\r\n\t\t} else {\r\n\t\t\toffset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\r\n\t\t}\r\n\t\tlineValue += validIndex < index ? offset : -offset;\r\n\r\n\t\t// Return undefined if the pixel is out of the range\r\n\t\tif (lineValue < start - epsilon || lineValue > end + epsilon) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\treturn lineValue;\r\n}\r\n\r\nfunction garbageCollect(caches, length) {\r\n\thelpers$1.each(caches, function(cache) {\r\n\t\tvar gc = cache.gc;\r\n\t\tvar gcLen = gc.length / 2;\r\n\t\tvar i;\r\n\t\tif (gcLen > length) {\r\n\t\t\tfor (i = 0; i < gcLen; ++i) {\r\n\t\t\t\tdelete cache.data[gc[i]];\r\n\t\t\t}\r\n\t\t\tgc.splice(0, gcLen);\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Returns {width, height, offset} objects for the first, last, widest, highest tick\r\n * labels where offset indicates the anchor point offset from the top in pixels.\r\n */\r\nfunction computeLabelSizes(ctx, tickFonts, ticks, caches) {\r\n\tvar length = ticks.length;\r\n\tvar widths = [];\r\n\tvar heights = [];\r\n\tvar offsets = [];\r\n\tvar widestLabelSize = 0;\r\n\tvar highestLabelSize = 0;\r\n\tvar i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;\r\n\r\n\tfor (i = 0; i < length; ++i) {\r\n\t\tlabel = ticks[i].label;\r\n\t\ttickFont = ticks[i].major ? tickFonts.major : tickFonts.minor;\r\n\t\tctx.font = fontString = tickFont.string;\r\n\t\tcache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\r\n\t\tlineHeight = tickFont.lineHeight;\r\n\t\twidth = height = 0;\r\n\t\t// Undefined labels and arrays should not be measured\r\n\t\tif (!isNullOrUndef(label) && !isArray(label)) {\r\n\t\t\twidth = helpers$1.measureText(ctx, cache.data, cache.gc, width, label);\r\n\t\t\theight = lineHeight;\r\n\t\t} else if (isArray(label)) {\r\n\t\t\t// if it is an array let's measure each element\r\n\t\t\tfor (j = 0, jlen = label.length; j < jlen; ++j) {\r\n\t\t\t\tnestedLabel = label[j];\r\n\t\t\t\t// Undefined labels and arrays should not be measured\r\n\t\t\t\tif (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\r\n\t\t\t\t\twidth = helpers$1.measureText(ctx, cache.data, cache.gc, width, nestedLabel);\r\n\t\t\t\t\theight += lineHeight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twidths.push(width);\r\n\t\theights.push(height);\r\n\t\toffsets.push(lineHeight / 2);\r\n\t\twidestLabelSize = Math.max(width, widestLabelSize);\r\n\t\thighestLabelSize = Math.max(height, highestLabelSize);\r\n\t}\r\n\tgarbageCollect(caches, length);\r\n\r\n\twidest = widths.indexOf(widestLabelSize);\r\n\thighest = heights.indexOf(highestLabelSize);\r\n\r\n\tfunction valueAt(idx) {\r\n\t\treturn {\r\n\t\t\twidth: widths[idx] || 0,\r\n\t\t\theight: heights[idx] || 0,\r\n\t\t\toffset: offsets[idx] || 0\r\n\t\t};\r\n\t}\r\n\r\n\treturn {\r\n\t\tfirst: valueAt(0),\r\n\t\tlast: valueAt(length - 1),\r\n\t\twidest: valueAt(widest),\r\n\t\thighest: valueAt(highest)\r\n\t};\r\n}\r\n\r\nfunction getTickMarkLength(options) {\r\n\treturn options.drawTicks ? options.tickMarkLength : 0;\r\n}\r\n\r\nfunction getScaleLabelHeight(options) {\r\n\tvar font, padding;\r\n\r\n\tif (!options.display) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfont = helpers$1.options._parseFont(options);\r\n\tpadding = helpers$1.options.toPadding(options.padding);\r\n\r\n\treturn font.lineHeight + padding.height;\r\n}\r\n\r\nfunction parseFontOptions(options, nestedOpts) {\r\n\treturn helpers$1.extend(helpers$1.options._parseFont({\r\n\t\tfontFamily: valueOrDefault$a(nestedOpts.fontFamily, options.fontFamily),\r\n\t\tfontSize: valueOrDefault$a(nestedOpts.fontSize, options.fontSize),\r\n\t\tfontStyle: valueOrDefault$a(nestedOpts.fontStyle, options.fontStyle),\r\n\t\tlineHeight: valueOrDefault$a(nestedOpts.lineHeight, options.lineHeight)\r\n\t}), {\r\n\t\tcolor: helpers$1.options.resolve([nestedOpts.fontColor, options.fontColor, core_defaults.global.defaultFontColor])\r\n\t});\r\n}\r\n\r\nfunction parseTickFontOptions(options) {\r\n\tvar minor = parseFontOptions(options, options.minor);\r\n\tvar major = options.major.enabled ? parseFontOptions(options, options.major) : minor;\r\n\r\n\treturn {minor: minor, major: major};\r\n}\r\n\r\nfunction nonSkipped(ticksToFilter) {\r\n\tvar filtered = [];\r\n\tvar item, index, len;\r\n\tfor (index = 0, len = ticksToFilter.length; index < len; ++index) {\r\n\t\titem = ticksToFilter[index];\r\n\t\tif (typeof item._index !== 'undefined') {\r\n\t\t\tfiltered.push(item);\r\n\t\t}\r\n\t}\r\n\treturn filtered;\r\n}\r\n\r\nfunction getEvenSpacing(arr) {\r\n\tvar len = arr.length;\r\n\tvar i, diff;\r\n\r\n\tif (len < 2) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (diff = arr[0], i = 1; i < len; ++i) {\r\n\t\tif (arr[i] - arr[i - 1] !== diff) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn diff;\r\n}\r\n\r\nfunction calculateSpacing(majorIndices, ticks, axisLength, ticksLimit) {\r\n\tvar evenMajorSpacing = getEvenSpacing(majorIndices);\r\n\tvar spacing = (ticks.length - 1) / ticksLimit;\r\n\tvar factors, factor, i, ilen;\r\n\r\n\t// If the major ticks are evenly spaced apart, place the minor ticks\r\n\t// so that they divide the major ticks into even chunks\r\n\tif (!evenMajorSpacing) {\r\n\t\treturn Math.max(spacing, 1);\r\n\t}\r\n\r\n\tfactors = helpers$1.math._factorize(evenMajorSpacing);\r\n\tfor (i = 0, ilen = factors.length - 1; i < ilen; i++) {\r\n\t\tfactor = factors[i];\r\n\t\tif (factor > spacing) {\r\n\t\t\treturn factor;\r\n\t\t}\r\n\t}\r\n\treturn Math.max(spacing, 1);\r\n}\r\n\r\nfunction getMajorIndices(ticks) {\r\n\tvar result = [];\r\n\tvar i, ilen;\r\n\tfor (i = 0, ilen = ticks.length; i < ilen; i++) {\r\n\t\tif (ticks[i].major) {\r\n\t\t\tresult.push(i);\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nfunction skipMajors(ticks, majorIndices, spacing) {\r\n\tvar count = 0;\r\n\tvar next = majorIndices[0];\r\n\tvar i, tick;\r\n\r\n\tspacing = Math.ceil(spacing);\r\n\tfor (i = 0; i < ticks.length; i++) {\r\n\t\ttick = ticks[i];\r\n\t\tif (i === next) {\r\n\t\t\ttick._index = i;\r\n\t\t\tcount++;\r\n\t\t\tnext = majorIndices[count * spacing];\r\n\t\t} else {\r\n\t\t\tdelete tick.label;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction skip(ticks, spacing, majorStart, majorEnd) {\r\n\tvar start = valueOrDefault$a(majorStart, 0);\r\n\tvar end = Math.min(valueOrDefault$a(majorEnd, ticks.length), ticks.length);\r\n\tvar count = 0;\r\n\tvar length, i, tick, next;\r\n\r\n\tspacing = Math.ceil(spacing);\r\n\tif (majorEnd) {\r\n\t\tlength = majorEnd - majorStart;\r\n\t\tspacing = length / Math.floor(length / spacing);\r\n\t}\r\n\r\n\tnext = start;\r\n\r\n\twhile (next < 0) {\r\n\t\tcount++;\r\n\t\tnext = Math.round(start + count * spacing);\r\n\t}\r\n\r\n\tfor (i = Math.max(start, 0); i < end; i++) {\r\n\t\ttick = ticks[i];\r\n\t\tif (i === next) {\r\n\t\t\ttick._index = i;\r\n\t\t\tcount++;\r\n\t\t\tnext = Math.round(start + count * spacing);\r\n\t\t} else {\r\n\t\t\tdelete tick.label;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar Scale = core_element.extend({\r\n\r\n\tzeroLineIndex: 0,\r\n\r\n\t/**\r\n\t * Get the padding needed for the scale\r\n\t * @method getPadding\r\n\t * @private\r\n\t * @returns {Padding} the necessary padding\r\n\t */\r\n\tgetPadding: function() {\r\n\t\tvar me = this;\r\n\t\treturn {\r\n\t\t\tleft: me.paddingLeft || 0,\r\n\t\t\ttop: me.paddingTop || 0,\r\n\t\t\tright: me.paddingRight || 0,\r\n\t\t\tbottom: me.paddingBottom || 0\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the scale tick objects ({label, major})\r\n\t * @since 2.7\r\n\t */\r\n\tgetTicks: function() {\r\n\t\treturn this._ticks;\r\n\t},\r\n\r\n\t/**\r\n\t* @private\r\n\t*/\r\n\t_getLabels: function() {\r\n\t\tvar data = this.chart.data;\r\n\t\treturn this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\r\n\t},\r\n\r\n\t// These methods are ordered by lifecyle. Utilities then follow.\r\n\t// Any function defined here is inherited by all scale types.\r\n\t// Any function can be extended by the scale type\r\n\r\n\t/**\r\n\t * Provided for backward compatibility, not available anymore\r\n\t * @function Chart.Scale.mergeTicksOptions\r\n\t * @deprecated since version 2.8.0\r\n\t * @todo remove at version 3\r\n\t */\r\n\tmergeTicksOptions: function() {\r\n\t\t// noop\r\n\t},\r\n\r\n\tbeforeUpdate: function() {\r\n\t\thelpers$1.callback(this.options.beforeUpdate, [this]);\r\n\t},\r\n\r\n\t/**\r\n\t * @param {number} maxWidth - the max width in pixels\r\n\t * @param {number} maxHeight - the max height in pixels\r\n\t * @param {object} margins - the space between the edge of the other scales and edge of the chart\r\n\t * This space comes from two sources:\r\n\t * - padding - space that's required to show the labels at the edges of the scale\r\n\t * - thickness of scales or legends in another orientation\r\n\t */\r\n\tupdate: function(maxWidth, maxHeight, margins) {\r\n\t\tvar me = this;\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tvar sampleSize = tickOpts.sampleSize;\r\n\t\tvar i, ilen, labels, ticks, samplingEnabled;\r\n\r\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\r\n\t\tme.beforeUpdate();\r\n\r\n\t\t// Absorb the master measurements\r\n\t\tme.maxWidth = maxWidth;\r\n\t\tme.maxHeight = maxHeight;\r\n\t\tme.margins = helpers$1.extend({\r\n\t\t\tleft: 0,\r\n\t\t\tright: 0,\r\n\t\t\ttop: 0,\r\n\t\t\tbottom: 0\r\n\t\t}, margins);\r\n\r\n\t\tme._ticks = null;\r\n\t\tme.ticks = null;\r\n\t\tme._labelSizes = null;\r\n\t\tme._maxLabelLines = 0;\r\n\t\tme.longestLabelWidth = 0;\r\n\t\tme.longestTextCache = me.longestTextCache || {};\r\n\t\tme._gridLineItems = null;\r\n\t\tme._labelItems = null;\r\n\r\n\t\t// Dimensions\r\n\t\tme.beforeSetDimensions();\r\n\t\tme.setDimensions();\r\n\t\tme.afterSetDimensions();\r\n\r\n\t\t// Data min/max\r\n\t\tme.beforeDataLimits();\r\n\t\tme.determineDataLimits();\r\n\t\tme.afterDataLimits();\r\n\r\n\t\t// Ticks - `this.ticks` is now DEPRECATED!\r\n\t\t// Internal ticks are now stored as objects in the PRIVATE `this._ticks` member\r\n\t\t// and must not be accessed directly from outside this class. `this.ticks` being\r\n\t\t// around for long time and not marked as private, we can't change its structure\r\n\t\t// without unexpected breaking changes. If you need to access the scale ticks,\r\n\t\t// use scale.getTicks() instead.\r\n\r\n\t\tme.beforeBuildTicks();\r\n\r\n\t\t// New implementations should return an array of objects but for BACKWARD COMPAT,\r\n\t\t// we still support no return (`this.ticks` internally set by calling this method).\r\n\t\tticks = me.buildTicks() || [];\r\n\r\n\t\t// Allow modification of ticks in callback.\r\n\t\tticks = me.afterBuildTicks(ticks) || ticks;\r\n\r\n\t\t// Ensure ticks contains ticks in new tick format\r\n\t\tif ((!ticks || !ticks.length) && me.ticks) {\r\n\t\t\tticks = [];\r\n\t\t\tfor (i = 0, ilen = me.ticks.length; i < ilen; ++i) {\r\n\t\t\t\tticks.push({\r\n\t\t\t\t\tvalue: me.ticks[i],\r\n\t\t\t\t\tmajor: false\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme._ticks = ticks;\r\n\r\n\t\t// Compute tick rotation and fit using a sampled subset of labels\r\n\t\t// We generally don't need to compute the size of every single label for determining scale size\r\n\t\tsamplingEnabled = sampleSize < ticks.length;\r\n\t\tlabels = me._convertTicksToLabels(samplingEnabled ? sample(ticks, sampleSize) : ticks);\r\n\r\n\t\t// _configure is called twice, once here, once from core.controller.updateLayout.\r\n\t\t// Here we haven't been positioned yet, but dimensions are correct.\r\n\t\t// Variables set in _configure are needed for calculateTickRotation, and\r\n\t\t// it's ok that coordinates are not correct there, only dimensions matter.\r\n\t\tme._configure();\r\n\r\n\t\t// Tick Rotation\r\n\t\tme.beforeCalculateTickRotation();\r\n\t\tme.calculateTickRotation();\r\n\t\tme.afterCalculateTickRotation();\r\n\r\n\t\tme.beforeFit();\r\n\t\tme.fit();\r\n\t\tme.afterFit();\r\n\r\n\t\t// Auto-skip\r\n\t\tme._ticksToDraw = tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto') ? me._autoSkip(ticks) : ticks;\r\n\r\n\t\tif (samplingEnabled) {\r\n\t\t\t// Generate labels using all non-skipped ticks\r\n\t\t\tlabels = me._convertTicksToLabels(me._ticksToDraw);\r\n\t\t}\r\n\r\n\t\tme.ticks = labels; // BACKWARD COMPATIBILITY\r\n\r\n\t\t// IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\r\n\r\n\t\tme.afterUpdate();\r\n\r\n\t\t// TODO(v3): remove minSize as a public property and return value from all layout boxes. It is unused\r\n\t\t// make maxWidth and maxHeight private\r\n\t\treturn me.minSize;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tvar reversePixels = me.options.ticks.reverse;\r\n\t\tvar startPixel, endPixel;\r\n\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\tstartPixel = me.left;\r\n\t\t\tendPixel = me.right;\r\n\t\t} else {\r\n\t\t\tstartPixel = me.top;\r\n\t\t\tendPixel = me.bottom;\r\n\t\t\t// by default vertical scales are from bottom to top, so pixels are reversed\r\n\t\t\treversePixels = !reversePixels;\r\n\t\t}\r\n\t\tme._startPixel = startPixel;\r\n\t\tme._endPixel = endPixel;\r\n\t\tme._reversePixels = reversePixels;\r\n\t\tme._length = endPixel - startPixel;\r\n\t},\r\n\r\n\tafterUpdate: function() {\r\n\t\thelpers$1.callback(this.options.afterUpdate, [this]);\r\n\t},\r\n\r\n\t//\r\n\r\n\tbeforeSetDimensions: function() {\r\n\t\thelpers$1.callback(this.options.beforeSetDimensions, [this]);\r\n\t},\r\n\tsetDimensions: function() {\r\n\t\tvar me = this;\r\n\t\t// Set the unconstrained dimension before label rotation\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.width = me.maxWidth;\r\n\t\t\tme.left = 0;\r\n\t\t\tme.right = me.width;\r\n\t\t} else {\r\n\t\t\tme.height = me.maxHeight;\r\n\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.top = 0;\r\n\t\t\tme.bottom = me.height;\r\n\t\t}\r\n\r\n\t\t// Reset padding\r\n\t\tme.paddingLeft = 0;\r\n\t\tme.paddingTop = 0;\r\n\t\tme.paddingRight = 0;\r\n\t\tme.paddingBottom = 0;\r\n\t},\r\n\tafterSetDimensions: function() {\r\n\t\thelpers$1.callback(this.options.afterSetDimensions, [this]);\r\n\t},\r\n\r\n\t// Data limits\r\n\tbeforeDataLimits: function() {\r\n\t\thelpers$1.callback(this.options.beforeDataLimits, [this]);\r\n\t},\r\n\tdetermineDataLimits: helpers$1.noop,\r\n\tafterDataLimits: function() {\r\n\t\thelpers$1.callback(this.options.afterDataLimits, [this]);\r\n\t},\r\n\r\n\t//\r\n\tbeforeBuildTicks: function() {\r\n\t\thelpers$1.callback(this.options.beforeBuildTicks, [this]);\r\n\t},\r\n\tbuildTicks: helpers$1.noop,\r\n\tafterBuildTicks: function(ticks) {\r\n\t\tvar me = this;\r\n\t\t// ticks is empty for old axis implementations here\r\n\t\tif (isArray(ticks) && ticks.length) {\r\n\t\t\treturn helpers$1.callback(me.options.afterBuildTicks, [me, ticks]);\r\n\t\t}\r\n\t\t// Support old implementations (that modified `this.ticks` directly in buildTicks)\r\n\t\tme.ticks = helpers$1.callback(me.options.afterBuildTicks, [me, me.ticks]) || me.ticks;\r\n\t\treturn ticks;\r\n\t},\r\n\r\n\tbeforeTickToLabelConversion: function() {\r\n\t\thelpers$1.callback(this.options.beforeTickToLabelConversion, [this]);\r\n\t},\r\n\tconvertTicksToLabels: function() {\r\n\t\tvar me = this;\r\n\t\t// Convert ticks to strings\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tme.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);\r\n\t},\r\n\tafterTickToLabelConversion: function() {\r\n\t\thelpers$1.callback(this.options.afterTickToLabelConversion, [this]);\r\n\t},\r\n\r\n\t//\r\n\r\n\tbeforeCalculateTickRotation: function() {\r\n\t\thelpers$1.callback(this.options.beforeCalculateTickRotation, [this]);\r\n\t},\r\n\tcalculateTickRotation: function() {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options;\r\n\t\tvar tickOpts = options.ticks;\r\n\t\tvar numTicks = me.getTicks().length;\r\n\t\tvar minRotation = tickOpts.minRotation || 0;\r\n\t\tvar maxRotation = tickOpts.maxRotation;\r\n\t\tvar labelRotation = minRotation;\r\n\t\tvar labelSizes, maxLabelWidth, maxLabelHeight, maxWidth, tickWidth, maxHeight, maxLabelDiagonal;\r\n\r\n\t\tif (!me._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !me.isHorizontal()) {\r\n\t\t\tme.labelRotation = minRotation;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlabelSizes = me._getLabelSizes();\r\n\t\tmaxLabelWidth = labelSizes.widest.width;\r\n\t\tmaxLabelHeight = labelSizes.highest.height - labelSizes.highest.offset;\r\n\r\n\t\t// Estimate the width of each grid based on the canvas width, the maximum\r\n\t\t// label width and the number of tick intervals\r\n\t\tmaxWidth = Math.min(me.maxWidth, me.chart.width - maxLabelWidth);\r\n\t\ttickWidth = options.offset ? me.maxWidth / numTicks : maxWidth / (numTicks - 1);\r\n\r\n\t\t// Allow 3 pixels x2 padding either side for label readability\r\n\t\tif (maxLabelWidth + 6 > tickWidth) {\r\n\t\t\ttickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\r\n\t\t\tmaxHeight = me.maxHeight - getTickMarkLength(options.gridLines)\r\n\t\t\t\t- tickOpts.padding - getScaleLabelHeight(options.scaleLabel);\r\n\t\t\tmaxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\r\n\t\t\tlabelRotation = helpers$1.toDegrees(Math.min(\r\n\t\t\t\tMath.asin(Math.min((labelSizes.highest.height + 6) / tickWidth, 1)),\r\n\t\t\t\tMath.asin(Math.min(maxHeight / maxLabelDiagonal, 1)) - Math.asin(maxLabelHeight / maxLabelDiagonal)\r\n\t\t\t));\r\n\t\t\tlabelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\r\n\t\t}\r\n\r\n\t\tme.labelRotation = labelRotation;\r\n\t},\r\n\tafterCalculateTickRotation: function() {\r\n\t\thelpers$1.callback(this.options.afterCalculateTickRotation, [this]);\r\n\t},\r\n\r\n\t//\r\n\r\n\tbeforeFit: function() {\r\n\t\thelpers$1.callback(this.options.beforeFit, [this]);\r\n\t},\r\n\tfit: function() {\r\n\t\tvar me = this;\r\n\t\t// Reset\r\n\t\tvar minSize = me.minSize = {\r\n\t\t\twidth: 0,\r\n\t\t\theight: 0\r\n\t\t};\r\n\r\n\t\tvar chart = me.chart;\r\n\t\tvar opts = me.options;\r\n\t\tvar tickOpts = opts.ticks;\r\n\t\tvar scaleLabelOpts = opts.scaleLabel;\r\n\t\tvar gridLineOpts = opts.gridLines;\r\n\t\tvar display = me._isVisible();\r\n\t\tvar isBottom = opts.position === 'bottom';\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\r\n\t\t// Width\r\n\t\tif (isHorizontal) {\r\n\t\t\tminSize.width = me.maxWidth;\r\n\t\t} else if (display) {\r\n\t\t\tminSize.width = getTickMarkLength(gridLineOpts) + getScaleLabelHeight(scaleLabelOpts);\r\n\t\t}\r\n\r\n\t\t// height\r\n\t\tif (!isHorizontal) {\r\n\t\t\tminSize.height = me.maxHeight; // fill all the height\r\n\t\t} else if (display) {\r\n\t\t\tminSize.height = getTickMarkLength(gridLineOpts) + getScaleLabelHeight(scaleLabelOpts);\r\n\t\t}\r\n\r\n\t\t// Don't bother fitting the ticks if we are not showing the labels\r\n\t\tif (tickOpts.display && display) {\r\n\t\t\tvar tickFonts = parseTickFontOptions(tickOpts);\r\n\t\t\tvar labelSizes = me._getLabelSizes();\r\n\t\t\tvar firstLabelSize = labelSizes.first;\r\n\t\t\tvar lastLabelSize = labelSizes.last;\r\n\t\t\tvar widestLabelSize = labelSizes.widest;\r\n\t\t\tvar highestLabelSize = labelSizes.highest;\r\n\t\t\tvar lineSpace = tickFonts.minor.lineHeight * 0.4;\r\n\t\t\tvar tickPadding = tickOpts.padding;\r\n\r\n\t\t\tif (isHorizontal) {\r\n\t\t\t\t// A horizontal axis is more constrained by the height.\r\n\t\t\t\tvar isRotated = me.labelRotation !== 0;\r\n\t\t\t\tvar angleRadians = helpers$1.toRadians(me.labelRotation);\r\n\t\t\t\tvar cosRotation = Math.cos(angleRadians);\r\n\t\t\t\tvar sinRotation = Math.sin(angleRadians);\r\n\r\n\t\t\t\tvar labelHeight = sinRotation * widestLabelSize.width\r\n\t\t\t\t\t+ cosRotation * (highestLabelSize.height - (isRotated ? highestLabelSize.offset : 0))\r\n\t\t\t\t\t+ (isRotated ? 0 : lineSpace); // padding\r\n\r\n\t\t\t\tminSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);\r\n\r\n\t\t\t\tvar offsetLeft = me.getPixelForTick(0) - me.left;\r\n\t\t\t\tvar offsetRight = me.right - me.getPixelForTick(me.getTicks().length - 1);\r\n\t\t\t\tvar paddingLeft, paddingRight;\r\n\r\n\t\t\t\t// Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\r\n\t\t\t\t// which means that the right padding is dominated by the font height\r\n\t\t\t\tif (isRotated) {\r\n\t\t\t\t\tpaddingLeft = isBottom ?\r\n\t\t\t\t\t\tcosRotation * firstLabelSize.width + sinRotation * firstLabelSize.offset :\r\n\t\t\t\t\t\tsinRotation * (firstLabelSize.height - firstLabelSize.offset);\r\n\t\t\t\t\tpaddingRight = isBottom ?\r\n\t\t\t\t\t\tsinRotation * (lastLabelSize.height - lastLabelSize.offset) :\r\n\t\t\t\t\t\tcosRotation * lastLabelSize.width + sinRotation * lastLabelSize.offset;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpaddingLeft = firstLabelSize.width / 2;\r\n\t\t\t\t\tpaddingRight = lastLabelSize.width / 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Adjust padding taking into account changes in offsets\r\n\t\t\t\t// and add 3 px to move away from canvas edges\r\n\t\t\t\tme.paddingLeft = Math.max((paddingLeft - offsetLeft) * me.width / (me.width - offsetLeft), 0) + 3;\r\n\t\t\t\tme.paddingRight = Math.max((paddingRight - offsetRight) * me.width / (me.width - offsetRight), 0) + 3;\r\n\t\t\t} else {\r\n\t\t\t\t// A vertical axis is more constrained by the width. Labels are the\r\n\t\t\t\t// dominant factor here, so get that length first and account for padding\r\n\t\t\t\tvar labelWidth = tickOpts.mirror ? 0 :\r\n\t\t\t\t\t// use lineSpace for consistency with horizontal axis\r\n\t\t\t\t\t// tickPadding is not implemented for horizontal\r\n\t\t\t\t\twidestLabelSize.width + tickPadding + lineSpace;\r\n\r\n\t\t\t\tminSize.width = Math.min(me.maxWidth, minSize.width + labelWidth);\r\n\r\n\t\t\t\tme.paddingTop = firstLabelSize.height / 2;\r\n\t\t\t\tme.paddingBottom = lastLabelSize.height / 2;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme.handleMargins();\r\n\r\n\t\tif (isHorizontal) {\r\n\t\t\tme.width = me._length = chart.width - me.margins.left - me.margins.right;\r\n\t\t\tme.height = minSize.height;\r\n\t\t} else {\r\n\t\t\tme.width = minSize.width;\r\n\t\t\tme.height = me._length = chart.height - me.margins.top - me.margins.bottom;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Handle margins and padding interactions\r\n\t * @private\r\n\t */\r\n\thandleMargins: function() {\r\n\t\tvar me = this;\r\n\t\tif (me.margins) {\r\n\t\t\tme.margins.left = Math.max(me.paddingLeft, me.margins.left);\r\n\t\t\tme.margins.top = Math.max(me.paddingTop, me.margins.top);\r\n\t\t\tme.margins.right = Math.max(me.paddingRight, me.margins.right);\r\n\t\t\tme.margins.bottom = Math.max(me.paddingBottom, me.margins.bottom);\r\n\t\t}\r\n\t},\r\n\r\n\tafterFit: function() {\r\n\t\thelpers$1.callback(this.options.afterFit, [this]);\r\n\t},\r\n\r\n\t// Shared Methods\r\n\tisHorizontal: function() {\r\n\t\tvar pos = this.options.position;\r\n\t\treturn pos === 'top' || pos === 'bottom';\r\n\t},\r\n\tisFullWidth: function() {\r\n\t\treturn this.options.fullWidth;\r\n\t},\r\n\r\n\t// Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not\r\n\tgetRightValue: function(rawValue) {\r\n\t\t// Null and undefined values first\r\n\t\tif (isNullOrUndef(rawValue)) {\r\n\t\t\treturn NaN;\r\n\t\t}\r\n\t\t// isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values\r\n\t\tif ((typeof rawValue === 'number' || rawValue instanceof Number) && !isFinite(rawValue)) {\r\n\t\t\treturn NaN;\r\n\t\t}\r\n\r\n\t\t// If it is in fact an object, dive in one more level\r\n\t\tif (rawValue) {\r\n\t\t\tif (this.isHorizontal()) {\r\n\t\t\t\tif (rawValue.x !== undefined) {\r\n\t\t\t\t\treturn this.getRightValue(rawValue.x);\r\n\t\t\t\t}\r\n\t\t\t} else if (rawValue.y !== undefined) {\r\n\t\t\t\treturn this.getRightValue(rawValue.y);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Value is good, return it\r\n\t\treturn rawValue;\r\n\t},\r\n\r\n\t_convertTicksToLabels: function(ticks) {\r\n\t\tvar me = this;\r\n\t\tvar labels, i, ilen;\r\n\r\n\t\tme.ticks = ticks.map(function(tick) {\r\n\t\t\treturn tick.value;\r\n\t\t});\r\n\r\n\t\tme.beforeTickToLabelConversion();\r\n\r\n\t\t// New implementations should return the formatted tick labels but for BACKWARD\r\n\t\t// COMPAT, we still support no return (`this.ticks` internally changed by calling\r\n\t\t// this method and supposed to contain only string values).\r\n\t\tlabels = me.convertTicksToLabels(ticks) || me.ticks;\r\n\r\n\t\tme.afterTickToLabelConversion();\r\n\r\n\t\t// BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)\r\n\t\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\r\n\t\t\tticks[i].label = labels[i];\r\n\t\t}\r\n\r\n\t\treturn labels;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getLabelSizes: function() {\r\n\t\tvar me = this;\r\n\t\tvar labelSizes = me._labelSizes;\r\n\r\n\t\tif (!labelSizes) {\r\n\t\t\tme._labelSizes = labelSizes = computeLabelSizes(me.ctx, parseTickFontOptions(me.options.ticks), me.getTicks(), me.longestTextCache);\r\n\t\t\tme.longestLabelWidth = labelSizes.widest.width;\r\n\t\t}\r\n\r\n\t\treturn labelSizes;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_parseValue: function(value) {\r\n\t\tvar start, end, min, max;\r\n\r\n\t\tif (isArray(value)) {\r\n\t\t\tstart = +this.getRightValue(value[0]);\r\n\t\t\tend = +this.getRightValue(value[1]);\r\n\t\t\tmin = Math.min(start, end);\r\n\t\t\tmax = Math.max(start, end);\r\n\t\t} else {\r\n\t\t\tvalue = +this.getRightValue(value);\r\n\t\t\tstart = undefined;\r\n\t\t\tend = value;\r\n\t\t\tmin = value;\r\n\t\t\tmax = value;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tmin: min,\r\n\t\t\tmax: max,\r\n\t\t\tstart: start,\r\n\t\t\tend: end\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t* @private\r\n\t*/\r\n\t_getScaleLabel: function(rawValue) {\r\n\t\tvar v = this._parseValue(rawValue);\r\n\t\tif (v.start !== undefined) {\r\n\t\t\treturn '[' + v.start + ', ' + v.end + ']';\r\n\t\t}\r\n\r\n\t\treturn +this.getRightValue(rawValue);\r\n\t},\r\n\r\n\t/**\r\n\t * Used to get the value to display in the tooltip for the data at the given index\r\n\t * @param index\r\n\t * @param datasetIndex\r\n\t */\r\n\tgetLabelForIndex: helpers$1.noop,\r\n\r\n\t/**\r\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\r\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\r\n\t * @param value\r\n\t * @param index\r\n\t * @param datasetIndex\r\n\t */\r\n\tgetPixelForValue: helpers$1.noop,\r\n\r\n\t/**\r\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\r\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\r\n\t * @param pixel\r\n\t */\r\n\tgetValueForPixel: helpers$1.noop,\r\n\r\n\t/**\r\n\t * Returns the location of the tick at the given index\r\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\r\n\t */\r\n\tgetPixelForTick: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar offset = me.options.offset;\r\n\t\tvar numTicks = me._ticks.length;\r\n\t\tvar tickWidth = 1 / Math.max(numTicks - (offset ? 0 : 1), 1);\r\n\r\n\t\treturn index < 0 || index > numTicks - 1\r\n\t\t\t? null\r\n\t\t\t: me.getPixelForDecimal(index * tickWidth + (offset ? tickWidth / 2 : 0));\r\n\t},\r\n\r\n\t/**\r\n\t * Utility for getting the pixel location of a percentage of scale\r\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\r\n\t */\r\n\tgetPixelForDecimal: function(decimal) {\r\n\t\tvar me = this;\r\n\r\n\t\tif (me._reversePixels) {\r\n\t\t\tdecimal = 1 - decimal;\r\n\t\t}\r\n\r\n\t\treturn me._startPixel + decimal * me._length;\r\n\t},\r\n\r\n\tgetDecimalForPixel: function(pixel) {\r\n\t\tvar decimal = (pixel - this._startPixel) / this._length;\r\n\t\treturn this._reversePixels ? 1 - decimal : decimal;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the pixel for the minimum chart value\r\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\r\n\t */\r\n\tgetBasePixel: function() {\r\n\t\treturn this.getPixelForValue(this.getBaseValue());\r\n\t},\r\n\r\n\tgetBaseValue: function() {\r\n\t\tvar me = this;\r\n\t\tvar min = me.min;\r\n\t\tvar max = me.max;\r\n\r\n\t\treturn me.beginAtZero ? 0 :\r\n\t\t\tmin < 0 && max < 0 ? max :\r\n\t\t\tmin > 0 && max > 0 ? min :\r\n\t\t\t0;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a subset of ticks to be plotted to avoid overlapping labels.\r\n\t * @private\r\n\t */\r\n\t_autoSkip: function(ticks) {\r\n\t\tvar me = this;\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tvar axisLength = me._length;\r\n\t\tvar ticksLimit = tickOpts.maxTicksLimit || axisLength / me._tickSize() + 1;\r\n\t\tvar majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\r\n\t\tvar numMajorIndices = majorIndices.length;\r\n\t\tvar first = majorIndices[0];\r\n\t\tvar last = majorIndices[numMajorIndices - 1];\r\n\t\tvar i, ilen, spacing, avgMajorSpacing;\r\n\r\n\t\t// If there are too many major ticks to display them all\r\n\t\tif (numMajorIndices > ticksLimit) {\r\n\t\t\tskipMajors(ticks, majorIndices, numMajorIndices / ticksLimit);\r\n\t\t\treturn nonSkipped(ticks);\r\n\t\t}\r\n\r\n\t\tspacing = calculateSpacing(majorIndices, ticks, axisLength, ticksLimit);\r\n\r\n\t\tif (numMajorIndices > 0) {\r\n\t\t\tfor (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\r\n\t\t\t\tskip(ticks, spacing, majorIndices[i], majorIndices[i + 1]);\r\n\t\t\t}\r\n\t\t\tavgMajorSpacing = numMajorIndices > 1 ? (last - first) / (numMajorIndices - 1) : null;\r\n\t\t\tskip(ticks, spacing, helpers$1.isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\r\n\t\t\tskip(ticks, spacing, last, helpers$1.isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\r\n\t\t\treturn nonSkipped(ticks);\r\n\t\t}\r\n\t\tskip(ticks, spacing);\r\n\t\treturn nonSkipped(ticks);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_tickSize: function() {\r\n\t\tvar me = this;\r\n\t\tvar optionTicks = me.options.ticks;\r\n\r\n\t\t// Calculate space needed by label in axis direction.\r\n\t\tvar rot = helpers$1.toRadians(me.labelRotation);\r\n\t\tvar cos = Math.abs(Math.cos(rot));\r\n\t\tvar sin = Math.abs(Math.sin(rot));\r\n\r\n\t\tvar labelSizes = me._getLabelSizes();\r\n\t\tvar padding = optionTicks.autoSkipPadding || 0;\r\n\t\tvar w = labelSizes ? labelSizes.widest.width + padding : 0;\r\n\t\tvar h = labelSizes ? labelSizes.highest.height + padding : 0;\r\n\r\n\t\t// Calculate space needed for 1 tick in axis direction.\r\n\t\treturn me.isHorizontal()\r\n\t\t\t? h * cos > w * sin ? w / cos : h / sin\r\n\t\t\t: h * sin < w * cos ? h / cos : w / sin;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_isVisible: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar display = me.options.display;\r\n\t\tvar i, ilen, meta;\r\n\r\n\t\tif (display !== 'auto') {\r\n\t\t\treturn !!display;\r\n\t\t}\r\n\r\n\t\t// When 'auto', the scale is visible if at least one associated dataset is visible.\r\n\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\r\n\t\t\tif (chart.isDatasetVisible(i)) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\tif (meta.xAxisID === me.id || meta.yAxisID === me.id) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_computeGridLineItems: function(chartArea) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar options = me.options;\r\n\t\tvar gridLines = options.gridLines;\r\n\t\tvar position = options.position;\r\n\t\tvar offsetGridLines = gridLines.offsetGridLines;\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\tvar ticks = me._ticksToDraw;\r\n\t\tvar ticksLength = ticks.length + (offsetGridLines ? 1 : 0);\r\n\r\n\t\tvar tl = getTickMarkLength(gridLines);\r\n\t\tvar items = [];\r\n\t\tvar axisWidth = gridLines.drawBorder ? valueAtIndexOrDefault(gridLines.lineWidth, 0, 0) : 0;\r\n\t\tvar axisHalfWidth = axisWidth / 2;\r\n\t\tvar alignPixel = helpers$1._alignPixel;\r\n\t\tvar alignBorderValue = function(pixel) {\r\n\t\t\treturn alignPixel(chart, pixel, axisWidth);\r\n\t\t};\r\n\t\tvar borderValue, i, tick, lineValue, alignedLineValue;\r\n\t\tvar tx1, ty1, tx2, ty2, x1, y1, x2, y2, lineWidth, lineColor, borderDash, borderDashOffset;\r\n\r\n\t\tif (position === 'top') {\r\n\t\t\tborderValue = alignBorderValue(me.bottom);\r\n\t\t\tty1 = me.bottom - tl;\r\n\t\t\tty2 = borderValue - axisHalfWidth;\r\n\t\t\ty1 = alignBorderValue(chartArea.top) + axisHalfWidth;\r\n\t\t\ty2 = chartArea.bottom;\r\n\t\t} else if (position === 'bottom') {\r\n\t\t\tborderValue = alignBorderValue(me.top);\r\n\t\t\ty1 = chartArea.top;\r\n\t\t\ty2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\r\n\t\t\tty1 = borderValue + axisHalfWidth;\r\n\t\t\tty2 = me.top + tl;\r\n\t\t} else if (position === 'left') {\r\n\t\t\tborderValue = alignBorderValue(me.right);\r\n\t\t\ttx1 = me.right - tl;\r\n\t\t\ttx2 = borderValue - axisHalfWidth;\r\n\t\t\tx1 = alignBorderValue(chartArea.left) + axisHalfWidth;\r\n\t\t\tx2 = chartArea.right;\r\n\t\t} else {\r\n\t\t\tborderValue = alignBorderValue(me.left);\r\n\t\t\tx1 = chartArea.left;\r\n\t\t\tx2 = alignBorderValue(chartArea.right) - axisHalfWidth;\r\n\t\t\ttx1 = borderValue + axisHalfWidth;\r\n\t\t\ttx2 = me.left + tl;\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < ticksLength; ++i) {\r\n\t\t\ttick = ticks[i] || {};\r\n\r\n\t\t\t// autoskipper skipped this tick (#4635)\r\n\t\t\tif (isNullOrUndef(tick.label) && i < ticks.length) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (i === me.zeroLineIndex && options.offset === offsetGridLines) {\r\n\t\t\t\t// Draw the first index specially\r\n\t\t\t\tlineWidth = gridLines.zeroLineWidth;\r\n\t\t\t\tlineColor = gridLines.zeroLineColor;\r\n\t\t\t\tborderDash = gridLines.zeroLineBorderDash || [];\r\n\t\t\t\tborderDashOffset = gridLines.zeroLineBorderDashOffset || 0.0;\r\n\t\t\t} else {\r\n\t\t\t\tlineWidth = valueAtIndexOrDefault(gridLines.lineWidth, i, 1);\r\n\t\t\t\tlineColor = valueAtIndexOrDefault(gridLines.color, i, 'rgba(0,0,0,0.1)');\r\n\t\t\t\tborderDash = gridLines.borderDash || [];\r\n\t\t\t\tborderDashOffset = gridLines.borderDashOffset || 0.0;\r\n\t\t\t}\r\n\r\n\t\t\tlineValue = getPixelForGridLine(me, tick._index || i, offsetGridLines);\r\n\r\n\t\t\t// Skip if the pixel is out of the range\r\n\t\t\tif (lineValue === undefined) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\talignedLineValue = alignPixel(chart, lineValue, lineWidth);\r\n\r\n\t\t\tif (isHorizontal) {\r\n\t\t\t\ttx1 = tx2 = x1 = x2 = alignedLineValue;\r\n\t\t\t} else {\r\n\t\t\t\tty1 = ty2 = y1 = y2 = alignedLineValue;\r\n\t\t\t}\r\n\r\n\t\t\titems.push({\r\n\t\t\t\ttx1: tx1,\r\n\t\t\t\tty1: ty1,\r\n\t\t\t\ttx2: tx2,\r\n\t\t\t\tty2: ty2,\r\n\t\t\t\tx1: x1,\r\n\t\t\t\ty1: y1,\r\n\t\t\t\tx2: x2,\r\n\t\t\t\ty2: y2,\r\n\t\t\t\twidth: lineWidth,\r\n\t\t\t\tcolor: lineColor,\r\n\t\t\t\tborderDash: borderDash,\r\n\t\t\t\tborderDashOffset: borderDashOffset,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\titems.ticksLength = ticksLength;\r\n\t\titems.borderValue = borderValue;\r\n\r\n\t\treturn items;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_computeLabelItems: function() {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options;\r\n\t\tvar optionTicks = options.ticks;\r\n\t\tvar position = options.position;\r\n\t\tvar isMirrored = optionTicks.mirror;\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\tvar ticks = me._ticksToDraw;\r\n\t\tvar fonts = parseTickFontOptions(optionTicks);\r\n\t\tvar tickPadding = optionTicks.padding;\r\n\t\tvar tl = getTickMarkLength(options.gridLines);\r\n\t\tvar rotation = -helpers$1.toRadians(me.labelRotation);\r\n\t\tvar items = [];\r\n\t\tvar i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\r\n\r\n\t\tif (position === 'top') {\r\n\t\t\ty = me.bottom - tl - tickPadding;\r\n\t\t\ttextAlign = !rotation ? 'center' : 'left';\r\n\t\t} else if (position === 'bottom') {\r\n\t\t\ty = me.top + tl + tickPadding;\r\n\t\t\ttextAlign = !rotation ? 'center' : 'right';\r\n\t\t} else if (position === 'left') {\r\n\t\t\tx = me.right - (isMirrored ? 0 : tl) - tickPadding;\r\n\t\t\ttextAlign = isMirrored ? 'left' : 'right';\r\n\t\t} else {\r\n\t\t\tx = me.left + (isMirrored ? 0 : tl) + tickPadding;\r\n\t\t\ttextAlign = isMirrored ? 'right' : 'left';\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\r\n\t\t\ttick = ticks[i];\r\n\t\t\tlabel = tick.label;\r\n\r\n\t\t\t// autoskipper skipped this tick (#4635)\r\n\t\t\tif (isNullOrUndef(label)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tpixel = me.getPixelForTick(tick._index || i) + optionTicks.labelOffset;\r\n\t\t\tfont = tick.major ? fonts.major : fonts.minor;\r\n\t\t\tlineHeight = font.lineHeight;\r\n\t\t\tlineCount = isArray(label) ? label.length : 1;\r\n\r\n\t\t\tif (isHorizontal) {\r\n\t\t\t\tx = pixel;\r\n\t\t\t\ttextOffset = position === 'top'\r\n\t\t\t\t\t? ((!rotation ? 0.5 : 1) - lineCount) * lineHeight\r\n\t\t\t\t\t: (!rotation ? 0.5 : 0) * lineHeight;\r\n\t\t\t} else {\r\n\t\t\t\ty = pixel;\r\n\t\t\t\ttextOffset = (1 - lineCount) * lineHeight / 2;\r\n\t\t\t}\r\n\r\n\t\t\titems.push({\r\n\t\t\t\tx: x,\r\n\t\t\t\ty: y,\r\n\t\t\t\trotation: rotation,\r\n\t\t\t\tlabel: label,\r\n\t\t\t\tfont: font,\r\n\t\t\t\ttextOffset: textOffset,\r\n\t\t\t\ttextAlign: textAlign\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn items;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawGrid: function(chartArea) {\r\n\t\tvar me = this;\r\n\t\tvar gridLines = me.options.gridLines;\r\n\r\n\t\tif (!gridLines.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar chart = me.chart;\r\n\t\tvar alignPixel = helpers$1._alignPixel;\r\n\t\tvar axisWidth = gridLines.drawBorder ? valueAtIndexOrDefault(gridLines.lineWidth, 0, 0) : 0;\r\n\t\tvar items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));\r\n\t\tvar width, color, i, ilen, item;\r\n\r\n\t\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\r\n\t\t\titem = items[i];\r\n\t\t\twidth = item.width;\r\n\t\t\tcolor = item.color;\r\n\r\n\t\t\tif (width && color) {\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.lineWidth = width;\r\n\t\t\t\tctx.strokeStyle = color;\r\n\t\t\t\tif (ctx.setLineDash) {\r\n\t\t\t\t\tctx.setLineDash(item.borderDash);\r\n\t\t\t\t\tctx.lineDashOffset = item.borderDashOffset;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tctx.beginPath();\r\n\r\n\t\t\t\tif (gridLines.drawTicks) {\r\n\t\t\t\t\tctx.moveTo(item.tx1, item.ty1);\r\n\t\t\t\t\tctx.lineTo(item.tx2, item.ty2);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (gridLines.drawOnChartArea) {\r\n\t\t\t\t\tctx.moveTo(item.x1, item.y1);\r\n\t\t\t\t\tctx.lineTo(item.x2, item.y2);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tctx.stroke();\r\n\t\t\t\tctx.restore();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (axisWidth) {\r\n\t\t\t// Draw the line at the edge of the axis\r\n\t\t\tvar firstLineWidth = axisWidth;\r\n\t\t\tvar lastLineWidth = valueAtIndexOrDefault(gridLines.lineWidth, items.ticksLength - 1, 1);\r\n\t\t\tvar borderValue = items.borderValue;\r\n\t\t\tvar x1, x2, y1, y2;\r\n\r\n\t\t\tif (me.isHorizontal()) {\r\n\t\t\t\tx1 = alignPixel(chart, me.left, firstLineWidth) - firstLineWidth / 2;\r\n\t\t\t\tx2 = alignPixel(chart, me.right, lastLineWidth) + lastLineWidth / 2;\r\n\t\t\t\ty1 = y2 = borderValue;\r\n\t\t\t} else {\r\n\t\t\t\ty1 = alignPixel(chart, me.top, firstLineWidth) - firstLineWidth / 2;\r\n\t\t\t\ty2 = alignPixel(chart, me.bottom, lastLineWidth) + lastLineWidth / 2;\r\n\t\t\t\tx1 = x2 = borderValue;\r\n\t\t\t}\r\n\r\n\t\t\tctx.lineWidth = axisWidth;\r\n\t\t\tctx.strokeStyle = valueAtIndexOrDefault(gridLines.color, 0);\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.moveTo(x1, y1);\r\n\t\t\tctx.lineTo(x2, y2);\r\n\t\t\tctx.stroke();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawLabels: function() {\r\n\t\tvar me = this;\r\n\t\tvar optionTicks = me.options.ticks;\r\n\r\n\t\tif (!optionTicks.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar items = me._labelItems || (me._labelItems = me._computeLabelItems());\r\n\t\tvar i, j, ilen, jlen, item, tickFont, label, y;\r\n\r\n\t\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\r\n\t\t\titem = items[i];\r\n\t\t\ttickFont = item.font;\r\n\r\n\t\t\t// Make sure we draw text in the correct color and font\r\n\t\t\tctx.save();\r\n\t\t\tctx.translate(item.x, item.y);\r\n\t\t\tctx.rotate(item.rotation);\r\n\t\t\tctx.font = tickFont.string;\r\n\t\t\tctx.fillStyle = tickFont.color;\r\n\t\t\tctx.textBaseline = 'middle';\r\n\t\t\tctx.textAlign = item.textAlign;\r\n\r\n\t\t\tlabel = item.label;\r\n\t\t\ty = item.textOffset;\r\n\t\t\tif (isArray(label)) {\r\n\t\t\t\tfor (j = 0, jlen = label.length; j < jlen; ++j) {\r\n\t\t\t\t\t// We just make sure the multiline element is a string here..\r\n\t\t\t\t\tctx.fillText('' + label[j], 0, y);\r\n\t\t\t\t\ty += tickFont.lineHeight;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tctx.fillText(label, 0, y);\r\n\t\t\t}\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawTitle: function() {\r\n\t\tvar me = this;\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar options = me.options;\r\n\t\tvar scaleLabel = options.scaleLabel;\r\n\r\n\t\tif (!scaleLabel.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar scaleLabelFontColor = valueOrDefault$a(scaleLabel.fontColor, core_defaults.global.defaultFontColor);\r\n\t\tvar scaleLabelFont = helpers$1.options._parseFont(scaleLabel);\r\n\t\tvar scaleLabelPadding = helpers$1.options.toPadding(scaleLabel.padding);\r\n\t\tvar halfLineHeight = scaleLabelFont.lineHeight / 2;\r\n\t\tvar position = options.position;\r\n\t\tvar rotation = 0;\r\n\t\tvar scaleLabelX, scaleLabelY;\r\n\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\tscaleLabelX = me.left + me.width / 2; // midpoint of the width\r\n\t\t\tscaleLabelY = position === 'bottom'\r\n\t\t\t\t? me.bottom - halfLineHeight - scaleLabelPadding.bottom\r\n\t\t\t\t: me.top + halfLineHeight + scaleLabelPadding.top;\r\n\t\t} else {\r\n\t\t\tvar isLeft = position === 'left';\r\n\t\t\tscaleLabelX = isLeft\r\n\t\t\t\t? me.left + halfLineHeight + scaleLabelPadding.top\r\n\t\t\t\t: me.right - halfLineHeight - scaleLabelPadding.top;\r\n\t\t\tscaleLabelY = me.top + me.height / 2;\r\n\t\t\trotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\t\tctx.translate(scaleLabelX, scaleLabelY);\r\n\t\tctx.rotate(rotation);\r\n\t\tctx.textAlign = 'center';\r\n\t\tctx.textBaseline = 'middle';\r\n\t\tctx.fillStyle = scaleLabelFontColor; // render in correct colour\r\n\t\tctx.font = scaleLabelFont.string;\r\n\t\tctx.fillText(scaleLabel.labelString, 0, 0);\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\tdraw: function(chartArea) {\r\n\t\tvar me = this;\r\n\r\n\t\tif (!me._isVisible()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tme._drawGrid(chartArea);\r\n\t\tme._drawTitle();\r\n\t\tme._drawLabels();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_layers: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar tz = opts.ticks && opts.ticks.z || 0;\r\n\t\tvar gz = opts.gridLines && opts.gridLines.z || 0;\r\n\r\n\t\tif (!me._isVisible() || tz === gz || me.draw !== me._draw) {\r\n\t\t\t// backward compatibility: draw has been overridden by custom scale\r\n\t\t\treturn [{\r\n\t\t\t\tz: tz,\r\n\t\t\t\tdraw: function() {\r\n\t\t\t\t\tme.draw.apply(me, arguments);\r\n\t\t\t\t}\r\n\t\t\t}];\r\n\t\t}\r\n\r\n\t\treturn [{\r\n\t\t\tz: gz,\r\n\t\t\tdraw: function() {\r\n\t\t\t\tme._drawGrid.apply(me, arguments);\r\n\t\t\t\tme._drawTitle.apply(me, arguments);\r\n\t\t\t}\r\n\t\t}, {\r\n\t\t\tz: tz,\r\n\t\t\tdraw: function() {\r\n\t\t\t\tme._drawLabels.apply(me, arguments);\r\n\t\t\t}\r\n\t\t}];\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getMatchingVisibleMetas: function(type) {\r\n\t\tvar me = this;\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\treturn me.chart._getSortedVisibleDatasetMetas()\r\n\t\t\t.filter(function(meta) {\r\n\t\t\t\treturn (!type || meta.type === type)\r\n\t\t\t\t\t&& (isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id);\r\n\t\t\t});\r\n\t}\r\n});\r\n\r\nScale.prototype._draw = Scale.prototype.draw;\r\n\r\nvar core_scale = Scale;\n\nvar isNullOrUndef$1 = helpers$1.isNullOrUndef;\r\n\r\nvar defaultConfig = {\r\n\tposition: 'bottom'\r\n};\r\n\r\nvar scale_category = core_scale.extend({\r\n\tdetermineDataLimits: function() {\r\n\t\tvar me = this;\r\n\t\tvar labels = me._getLabels();\r\n\t\tvar ticksOpts = me.options.ticks;\r\n\t\tvar min = ticksOpts.min;\r\n\t\tvar max = ticksOpts.max;\r\n\t\tvar minIndex = 0;\r\n\t\tvar maxIndex = labels.length - 1;\r\n\t\tvar findIndex;\r\n\r\n\t\tif (min !== undefined) {\r\n\t\t\t// user specified min value\r\n\t\t\tfindIndex = labels.indexOf(min);\r\n\t\t\tif (findIndex >= 0) {\r\n\t\t\t\tminIndex = findIndex;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (max !== undefined) {\r\n\t\t\t// user specified max value\r\n\t\t\tfindIndex = labels.indexOf(max);\r\n\t\t\tif (findIndex >= 0) {\r\n\t\t\t\tmaxIndex = findIndex;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme.minIndex = minIndex;\r\n\t\tme.maxIndex = maxIndex;\r\n\t\tme.min = labels[minIndex];\r\n\t\tme.max = labels[maxIndex];\r\n\t},\r\n\r\n\tbuildTicks: function() {\r\n\t\tvar me = this;\r\n\t\tvar labels = me._getLabels();\r\n\t\tvar minIndex = me.minIndex;\r\n\t\tvar maxIndex = me.maxIndex;\r\n\r\n\t\t// If we are viewing some subset of labels, slice the original array\r\n\t\tme.ticks = (minIndex === 0 && maxIndex === labels.length - 1) ? labels : labels.slice(minIndex, maxIndex + 1);\r\n\t},\r\n\r\n\tgetLabelForIndex: function(index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\r\n\t\tif (chart.getDatasetMeta(datasetIndex).controller._getValueScaleId() === me.id) {\r\n\t\t\treturn me.getRightValue(chart.data.datasets[datasetIndex].data[index]);\r\n\t\t}\r\n\r\n\t\treturn me._getLabels()[index];\r\n\t},\r\n\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tvar offset = me.options.offset;\r\n\t\tvar ticks = me.ticks;\r\n\r\n\t\tcore_scale.prototype._configure.call(me);\r\n\r\n\t\tif (!me.isHorizontal()) {\r\n\t\t\t// For backward compatibility, vertical category scale reverse is inverted.\r\n\t\t\tme._reversePixels = !me._reversePixels;\r\n\t\t}\r\n\r\n\t\tif (!ticks) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tme._startValue = me.minIndex - (offset ? 0.5 : 0);\r\n\t\tme._valueRange = Math.max(ticks.length - (offset ? 0 : 1), 1);\r\n\t},\r\n\r\n\t// Used to get data value locations. Value can either be an index or a numerical value\r\n\tgetPixelForValue: function(value, index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar valueCategory, labels, idx;\r\n\r\n\t\tif (!isNullOrUndef$1(index) && !isNullOrUndef$1(datasetIndex)) {\r\n\t\t\tvalue = me.chart.data.datasets[datasetIndex].data[index];\r\n\t\t}\r\n\r\n\t\t// If value is a data object, then index is the index in the data array,\r\n\t\t// not the index of the scale. We need to change that.\r\n\t\tif (!isNullOrUndef$1(value)) {\r\n\t\t\tvalueCategory = me.isHorizontal() ? value.x : value.y;\r\n\t\t}\r\n\t\tif (valueCategory !== undefined || (value !== undefined && isNaN(index))) {\r\n\t\t\tlabels = me._getLabels();\r\n\t\t\tvalue = helpers$1.valueOrDefault(valueCategory, value);\r\n\t\t\tidx = labels.indexOf(value);\r\n\t\t\tindex = idx !== -1 ? idx : index;\r\n\t\t\tif (isNaN(index)) {\r\n\t\t\t\tindex = value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn me.getPixelForDecimal((index - me._startValue) / me._valueRange);\r\n\t},\r\n\r\n\tgetPixelForTick: function(index) {\r\n\t\tvar ticks = this.ticks;\r\n\t\treturn index < 0 || index > ticks.length - 1\r\n\t\t\t? null\r\n\t\t\t: this.getPixelForValue(ticks[index], index + this.minIndex);\r\n\t},\r\n\r\n\tgetValueForPixel: function(pixel) {\r\n\t\tvar me = this;\r\n\t\tvar value = Math.round(me._startValue + me.getDecimalForPixel(pixel) * me._valueRange);\r\n\t\treturn Math.min(Math.max(value, 0), me.ticks.length - 1);\r\n\t},\r\n\r\n\tgetBasePixel: function() {\r\n\t\treturn this.bottom;\r\n\t}\r\n});\r\n\r\n// INTERNAL: static default options, registered in src/index.js\r\nvar _defaults = defaultConfig;\nscale_category._defaults = _defaults;\n\nvar noop = helpers$1.noop;\r\nvar isNullOrUndef$2 = helpers$1.isNullOrUndef;\r\n\r\n/**\r\n * Generate a set of linear ticks\r\n * @param generationOptions the options used to generate the ticks\r\n * @param dataRange the range of the data\r\n * @returns {number[]} array of tick values\r\n */\r\nfunction generateTicks(generationOptions, dataRange) {\r\n\tvar ticks = [];\r\n\t// To get a \"nice\" value for the tick spacing, we will use the appropriately named\r\n\t// \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\r\n\t// for details.\r\n\r\n\tvar MIN_SPACING = 1e-14;\r\n\tvar stepSize = generationOptions.stepSize;\r\n\tvar unit = stepSize || 1;\r\n\tvar maxNumSpaces = generationOptions.maxTicks - 1;\r\n\tvar min = generationOptions.min;\r\n\tvar max = generationOptions.max;\r\n\tvar precision = generationOptions.precision;\r\n\tvar rmin = dataRange.min;\r\n\tvar rmax = dataRange.max;\r\n\tvar spacing = helpers$1.niceNum((rmax - rmin) / maxNumSpaces / unit) * unit;\r\n\tvar factor, niceMin, niceMax, numSpaces;\r\n\r\n\t// Beyond MIN_SPACING floating point numbers being to lose precision\r\n\t// such that we can't do the math necessary to generate ticks\r\n\tif (spacing < MIN_SPACING && isNullOrUndef$2(min) && isNullOrUndef$2(max)) {\r\n\t\treturn [rmin, rmax];\r\n\t}\r\n\r\n\tnumSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\r\n\tif (numSpaces > maxNumSpaces) {\r\n\t\t// If the calculated num of spaces exceeds maxNumSpaces, recalculate it\r\n\t\tspacing = helpers$1.niceNum(numSpaces * spacing / maxNumSpaces / unit) * unit;\r\n\t}\r\n\r\n\tif (stepSize || isNullOrUndef$2(precision)) {\r\n\t\t// If a precision is not specified, calculate factor based on spacing\r\n\t\tfactor = Math.pow(10, helpers$1._decimalPlaces(spacing));\r\n\t} else {\r\n\t\t// If the user specified a precision, round to that number of decimal places\r\n\t\tfactor = Math.pow(10, precision);\r\n\t\tspacing = Math.ceil(spacing * factor) / factor;\r\n\t}\r\n\r\n\tniceMin = Math.floor(rmin / spacing) * spacing;\r\n\tniceMax = Math.ceil(rmax / spacing) * spacing;\r\n\r\n\t// If min, max and stepSize is set and they make an evenly spaced scale use it.\r\n\tif (stepSize) {\r\n\t\t// If very close to our whole number, use it.\r\n\t\tif (!isNullOrUndef$2(min) && helpers$1.almostWhole(min / spacing, spacing / 1000)) {\r\n\t\t\tniceMin = min;\r\n\t\t}\r\n\t\tif (!isNullOrUndef$2(max) && helpers$1.almostWhole(max / spacing, spacing / 1000)) {\r\n\t\t\tniceMax = max;\r\n\t\t}\r\n\t}\r\n\r\n\tnumSpaces = (niceMax - niceMin) / spacing;\r\n\t// If very close to our rounded value, use it.\r\n\tif (helpers$1.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\r\n\t\tnumSpaces = Math.round(numSpaces);\r\n\t} else {\r\n\t\tnumSpaces = Math.ceil(numSpaces);\r\n\t}\r\n\r\n\tniceMin = Math.round(niceMin * factor) / factor;\r\n\tniceMax = Math.round(niceMax * factor) / factor;\r\n\tticks.push(isNullOrUndef$2(min) ? niceMin : min);\r\n\tfor (var j = 1; j < numSpaces; ++j) {\r\n\t\tticks.push(Math.round((niceMin + j * spacing) * factor) / factor);\r\n\t}\r\n\tticks.push(isNullOrUndef$2(max) ? niceMax : max);\r\n\r\n\treturn ticks;\r\n}\r\n\r\nvar scale_linearbase = core_scale.extend({\r\n\tgetRightValue: function(value) {\r\n\t\tif (typeof value === 'string') {\r\n\t\t\treturn +value;\r\n\t\t}\r\n\t\treturn core_scale.prototype.getRightValue.call(this, value);\r\n\t},\r\n\r\n\thandleTickRangeOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar tickOpts = opts.ticks;\r\n\r\n\t\t// If we are forcing it to begin at 0, but 0 will already be rendered on the chart,\r\n\t\t// do nothing since that would make the chart weird. If the user really wants a weird chart\r\n\t\t// axis, they can manually override it\r\n\t\tif (tickOpts.beginAtZero) {\r\n\t\t\tvar minSign = helpers$1.sign(me.min);\r\n\t\t\tvar maxSign = helpers$1.sign(me.max);\r\n\r\n\t\t\tif (minSign < 0 && maxSign < 0) {\r\n\t\t\t\t// move the top up to 0\r\n\t\t\t\tme.max = 0;\r\n\t\t\t} else if (minSign > 0 && maxSign > 0) {\r\n\t\t\t\t// move the bottom down to 0\r\n\t\t\t\tme.min = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;\r\n\t\tvar setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;\r\n\r\n\t\tif (tickOpts.min !== undefined) {\r\n\t\t\tme.min = tickOpts.min;\r\n\t\t} else if (tickOpts.suggestedMin !== undefined) {\r\n\t\t\tif (me.min === null) {\r\n\t\t\t\tme.min = tickOpts.suggestedMin;\r\n\t\t\t} else {\r\n\t\t\t\tme.min = Math.min(me.min, tickOpts.suggestedMin);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tickOpts.max !== undefined) {\r\n\t\t\tme.max = tickOpts.max;\r\n\t\t} else if (tickOpts.suggestedMax !== undefined) {\r\n\t\t\tif (me.max === null) {\r\n\t\t\t\tme.max = tickOpts.suggestedMax;\r\n\t\t\t} else {\r\n\t\t\t\tme.max = Math.max(me.max, tickOpts.suggestedMax);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (setMin !== setMax) {\r\n\t\t\t// We set the min or the max but not both.\r\n\t\t\t// So ensure that our range is good\r\n\t\t\t// Inverted or 0 length range can happen when\r\n\t\t\t// ticks.min is set, and no datasets are visible\r\n\t\t\tif (me.min >= me.max) {\r\n\t\t\t\tif (setMin) {\r\n\t\t\t\t\tme.max = me.min + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tme.min = me.max - 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (me.min === me.max) {\r\n\t\t\tme.max++;\r\n\r\n\t\t\tif (!tickOpts.beginAtZero) {\r\n\t\t\t\tme.min--;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tgetTickLimit: function() {\r\n\t\tvar me = this;\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tvar stepSize = tickOpts.stepSize;\r\n\t\tvar maxTicksLimit = tickOpts.maxTicksLimit;\r\n\t\tvar maxTicks;\r\n\r\n\t\tif (stepSize) {\r\n\t\t\tmaxTicks = Math.ceil(me.max / stepSize) - Math.floor(me.min / stepSize) + 1;\r\n\t\t} else {\r\n\t\t\tmaxTicks = me._computeTickLimit();\r\n\t\t\tmaxTicksLimit = maxTicksLimit || 11;\r\n\t\t}\r\n\r\n\t\tif (maxTicksLimit) {\r\n\t\t\tmaxTicks = Math.min(maxTicksLimit, maxTicks);\r\n\t\t}\r\n\r\n\t\treturn maxTicks;\r\n\t},\r\n\r\n\t_computeTickLimit: function() {\r\n\t\treturn Number.POSITIVE_INFINITY;\r\n\t},\r\n\r\n\thandleDirectionalChanges: noop,\r\n\r\n\tbuildTicks: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar tickOpts = opts.ticks;\r\n\r\n\t\t// Figure out what the max number of ticks we can support it is based on the size of\r\n\t\t// the axis area. For now, we say that the minimum tick spacing in pixels must be 40\r\n\t\t// We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\r\n\t\t// the graph. Make sure we always have at least 2 ticks\r\n\t\tvar maxTicks = me.getTickLimit();\r\n\t\tmaxTicks = Math.max(2, maxTicks);\r\n\r\n\t\tvar numericGeneratorOptions = {\r\n\t\t\tmaxTicks: maxTicks,\r\n\t\t\tmin: tickOpts.min,\r\n\t\t\tmax: tickOpts.max,\r\n\t\t\tprecision: tickOpts.precision,\r\n\t\t\tstepSize: helpers$1.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)\r\n\t\t};\r\n\t\tvar ticks = me.ticks = generateTicks(numericGeneratorOptions, me);\r\n\r\n\t\tme.handleDirectionalChanges();\r\n\r\n\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\r\n\t\t// range of the scale\r\n\t\tme.max = helpers$1.max(ticks);\r\n\t\tme.min = helpers$1.min(ticks);\r\n\r\n\t\tif (tickOpts.reverse) {\r\n\t\t\tticks.reverse();\r\n\r\n\t\t\tme.start = me.max;\r\n\t\t\tme.end = me.min;\r\n\t\t} else {\r\n\t\t\tme.start = me.min;\r\n\t\t\tme.end = me.max;\r\n\t\t}\r\n\t},\r\n\r\n\tconvertTicksToLabels: function() {\r\n\t\tvar me = this;\r\n\t\tme.ticksAsNumbers = me.ticks.slice();\r\n\t\tme.zeroLineIndex = me.ticks.indexOf(0);\r\n\r\n\t\tcore_scale.prototype.convertTicksToLabels.call(me);\r\n\t},\r\n\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tvar ticks = me.getTicks();\r\n\t\tvar start = me.min;\r\n\t\tvar end = me.max;\r\n\t\tvar offset;\r\n\r\n\t\tcore_scale.prototype._configure.call(me);\r\n\r\n\t\tif (me.options.offset && ticks.length) {\r\n\t\t\toffset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\r\n\t\t\tstart -= offset;\r\n\t\t\tend += offset;\r\n\t\t}\r\n\t\tme._startValue = start;\r\n\t\tme._endValue = end;\r\n\t\tme._valueRange = end - start;\r\n\t}\r\n});\n\nvar defaultConfig$1 = {\r\n\tposition: 'left',\r\n\tticks: {\r\n\t\tcallback: core_ticks.formatters.linear\r\n\t}\r\n};\r\n\r\nvar DEFAULT_MIN = 0;\r\nvar DEFAULT_MAX = 1;\r\n\r\nfunction getOrCreateStack(stacks, stacked, meta) {\r\n\tvar key = [\r\n\t\tmeta.type,\r\n\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\r\n\t\tstacked === undefined && meta.stack === undefined ? meta.index : '',\r\n\t\tmeta.stack\r\n\t].join('.');\r\n\r\n\tif (stacks[key] === undefined) {\r\n\t\tstacks[key] = {\r\n\t\t\tpos: [],\r\n\t\t\tneg: []\r\n\t\t};\r\n\t}\r\n\r\n\treturn stacks[key];\r\n}\r\n\r\nfunction stackData(scale, stacks, meta, data) {\r\n\tvar opts = scale.options;\r\n\tvar stacked = opts.stacked;\r\n\tvar stack = getOrCreateStack(stacks, stacked, meta);\r\n\tvar pos = stack.pos;\r\n\tvar neg = stack.neg;\r\n\tvar ilen = data.length;\r\n\tvar i, value;\r\n\r\n\tfor (i = 0; i < ilen; ++i) {\r\n\t\tvalue = scale._parseValue(data[i]);\r\n\t\tif (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tpos[i] = pos[i] || 0;\r\n\t\tneg[i] = neg[i] || 0;\r\n\r\n\t\tif (opts.relativePoints) {\r\n\t\t\tpos[i] = 100;\r\n\t\t} else if (value.min < 0 || value.max < 0) {\r\n\t\t\tneg[i] += value.min;\r\n\t\t} else {\r\n\t\t\tpos[i] += value.max;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction updateMinMax(scale, meta, data) {\r\n\tvar ilen = data.length;\r\n\tvar i, value;\r\n\r\n\tfor (i = 0; i < ilen; ++i) {\r\n\t\tvalue = scale._parseValue(data[i]);\r\n\t\tif (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tscale.min = Math.min(scale.min, value.min);\r\n\t\tscale.max = Math.max(scale.max, value.max);\r\n\t}\r\n}\r\n\r\nvar scale_linear = scale_linearbase.extend({\r\n\tdetermineDataLimits: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar metasets = me._getMatchingVisibleMetas();\r\n\t\tvar hasStacks = opts.stacked;\r\n\t\tvar stacks = {};\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar i, meta, data, values;\r\n\r\n\t\tme.min = Number.POSITIVE_INFINITY;\r\n\t\tme.max = Number.NEGATIVE_INFINITY;\r\n\r\n\t\tif (hasStacks === undefined) {\r\n\t\t\tfor (i = 0; !hasStacks && i < ilen; ++i) {\r\n\t\t\t\tmeta = metasets[i];\r\n\t\t\t\thasStacks = meta.stack !== undefined;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tmeta = metasets[i];\r\n\t\t\tdata = datasets[meta.index].data;\r\n\t\t\tif (hasStacks) {\r\n\t\t\t\tstackData(me, stacks, meta, data);\r\n\t\t\t} else {\r\n\t\t\t\tupdateMinMax(me, meta, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thelpers$1.each(stacks, function(stackValues) {\r\n\t\t\tvalues = stackValues.pos.concat(stackValues.neg);\r\n\t\t\tme.min = Math.min(me.min, helpers$1.min(values));\r\n\t\t\tme.max = Math.max(me.max, helpers$1.max(values));\r\n\t\t});\r\n\r\n\t\tme.min = helpers$1.isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;\r\n\t\tme.max = helpers$1.isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;\r\n\r\n\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\r\n\t\tme.handleTickRangeOptions();\r\n\t},\r\n\r\n\t// Returns the maximum number of ticks based on the scale dimension\r\n\t_computeTickLimit: function() {\r\n\t\tvar me = this;\r\n\t\tvar tickFont;\r\n\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\treturn Math.ceil(me.width / 40);\r\n\t\t}\r\n\t\ttickFont = helpers$1.options._parseFont(me.options.ticks);\r\n\t\treturn Math.ceil(me.height / tickFont.lineHeight);\r\n\t},\r\n\r\n\t// Called after the ticks are built. We need\r\n\thandleDirectionalChanges: function() {\r\n\t\tif (!this.isHorizontal()) {\r\n\t\t\t// We are in a vertical orientation. The top value is the highest. So reverse the array\r\n\t\t\tthis.ticks.reverse();\r\n\t\t}\r\n\t},\r\n\r\n\tgetLabelForIndex: function(index, datasetIndex) {\r\n\t\treturn this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index]);\r\n\t},\r\n\r\n\t// Utils\r\n\tgetPixelForValue: function(value) {\r\n\t\tvar me = this;\r\n\t\treturn me.getPixelForDecimal((+me.getRightValue(value) - me._startValue) / me._valueRange);\r\n\t},\r\n\r\n\tgetValueForPixel: function(pixel) {\r\n\t\treturn this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\r\n\t},\r\n\r\n\tgetPixelForTick: function(index) {\r\n\t\tvar ticks = this.ticksAsNumbers;\r\n\t\tif (index < 0 || index > ticks.length - 1) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn this.getPixelForValue(ticks[index]);\r\n\t}\r\n});\r\n\r\n// INTERNAL: static default options, registered in src/index.js\r\nvar _defaults$1 = defaultConfig$1;\nscale_linear._defaults = _defaults$1;\n\nvar valueOrDefault$b = helpers$1.valueOrDefault;\r\nvar log10 = helpers$1.math.log10;\r\n\r\n/**\r\n * Generate a set of logarithmic ticks\r\n * @param generationOptions the options used to generate the ticks\r\n * @param dataRange the range of the data\r\n * @returns {number[]} array of tick values\r\n */\r\nfunction generateTicks$1(generationOptions, dataRange) {\r\n\tvar ticks = [];\r\n\r\n\tvar tickVal = valueOrDefault$b(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));\r\n\r\n\tvar endExp = Math.floor(log10(dataRange.max));\r\n\tvar endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\r\n\tvar exp, significand;\r\n\r\n\tif (tickVal === 0) {\r\n\t\texp = Math.floor(log10(dataRange.minNotZero));\r\n\t\tsignificand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));\r\n\r\n\t\tticks.push(tickVal);\r\n\t\ttickVal = significand * Math.pow(10, exp);\r\n\t} else {\r\n\t\texp = Math.floor(log10(tickVal));\r\n\t\tsignificand = Math.floor(tickVal / Math.pow(10, exp));\r\n\t}\r\n\tvar precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\r\n\r\n\tdo {\r\n\t\tticks.push(tickVal);\r\n\r\n\t\t++significand;\r\n\t\tif (significand === 10) {\r\n\t\t\tsignificand = 1;\r\n\t\t\t++exp;\r\n\t\t\tprecision = exp >= 0 ? 1 : precision;\r\n\t\t}\r\n\r\n\t\ttickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\r\n\t} while (exp < endExp || (exp === endExp && significand < endSignificand));\r\n\r\n\tvar lastTick = valueOrDefault$b(generationOptions.max, tickVal);\r\n\tticks.push(lastTick);\r\n\r\n\treturn ticks;\r\n}\r\n\r\nvar defaultConfig$2 = {\r\n\tposition: 'left',\r\n\r\n\t// label settings\r\n\tticks: {\r\n\t\tcallback: core_ticks.formatters.logarithmic\r\n\t}\r\n};\r\n\r\n// TODO(v3): change this to positiveOrDefault\r\nfunction nonNegativeOrDefault(value, defaultValue) {\r\n\treturn helpers$1.isFinite(value) && value >= 0 ? value : defaultValue;\r\n}\r\n\r\nvar scale_logarithmic = core_scale.extend({\r\n\tdetermineDataLimits: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\tfunction IDMatches(meta) {\r\n\t\t\treturn isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\r\n\t\t}\r\n\t\tvar datasetIndex, meta, value, data, i, ilen;\r\n\r\n\t\t// Calculate Range\r\n\t\tme.min = Number.POSITIVE_INFINITY;\r\n\t\tme.max = Number.NEGATIVE_INFINITY;\r\n\t\tme.minNotZero = Number.POSITIVE_INFINITY;\r\n\r\n\t\tvar hasStacks = opts.stacked;\r\n\t\tif (hasStacks === undefined) {\r\n\t\t\tfor (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(datasetIndex);\r\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\r\n\t\t\t\t\tmeta.stack !== undefined) {\r\n\t\t\t\t\thasStacks = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (opts.stacked || hasStacks) {\r\n\t\t\tvar valuesPerStack = {};\r\n\r\n\t\t\tfor (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(datasetIndex);\r\n\t\t\t\tvar key = [\r\n\t\t\t\t\tmeta.type,\r\n\t\t\t\t\t// we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\r\n\t\t\t\t\t((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\r\n\t\t\t\t\tmeta.stack\r\n\t\t\t\t].join('.');\r\n\r\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\r\n\t\t\t\t\tif (valuesPerStack[key] === undefined) {\r\n\t\t\t\t\t\tvaluesPerStack[key] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdata = datasets[datasetIndex].data;\r\n\t\t\t\t\tfor (i = 0, ilen = data.length; i < ilen; i++) {\r\n\t\t\t\t\t\tvar values = valuesPerStack[key];\r\n\t\t\t\t\t\tvalue = me._parseValue(data[i]);\r\n\t\t\t\t\t\t// invalid, hidden and negative values are ignored\r\n\t\t\t\t\t\tif (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvalues[i] = values[i] || 0;\r\n\t\t\t\t\t\tvalues[i] += value.max;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\thelpers$1.each(valuesPerStack, function(valuesForType) {\r\n\t\t\t\tif (valuesForType.length > 0) {\r\n\t\t\t\t\tvar minVal = helpers$1.min(valuesForType);\r\n\t\t\t\t\tvar maxVal = helpers$1.max(valuesForType);\r\n\t\t\t\t\tme.min = Math.min(me.min, minVal);\r\n\t\t\t\t\tme.max = Math.max(me.max, maxVal);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t} else {\r\n\t\t\tfor (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(datasetIndex);\r\n\t\t\t\tif (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\r\n\t\t\t\t\tdata = datasets[datasetIndex].data;\r\n\t\t\t\t\tfor (i = 0, ilen = data.length; i < ilen; i++) {\r\n\t\t\t\t\t\tvalue = me._parseValue(data[i]);\r\n\t\t\t\t\t\t// invalid, hidden and negative values are ignored\r\n\t\t\t\t\t\tif (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tme.min = Math.min(value.min, me.min);\r\n\t\t\t\t\t\tme.max = Math.max(value.max, me.max);\r\n\r\n\t\t\t\t\t\tif (value.min !== 0) {\r\n\t\t\t\t\t\t\tme.minNotZero = Math.min(value.min, me.minNotZero);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme.min = helpers$1.isFinite(me.min) ? me.min : null;\r\n\t\tme.max = helpers$1.isFinite(me.max) ? me.max : null;\r\n\t\tme.minNotZero = helpers$1.isFinite(me.minNotZero) ? me.minNotZero : null;\r\n\r\n\t\t// Common base implementation to handle ticks.min, ticks.max\r\n\t\tthis.handleTickRangeOptions();\r\n\t},\r\n\r\n\thandleTickRangeOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tvar DEFAULT_MIN = 1;\r\n\t\tvar DEFAULT_MAX = 10;\r\n\r\n\t\tme.min = nonNegativeOrDefault(tickOpts.min, me.min);\r\n\t\tme.max = nonNegativeOrDefault(tickOpts.max, me.max);\r\n\r\n\t\tif (me.min === me.max) {\r\n\t\t\tif (me.min !== 0 && me.min !== null) {\r\n\t\t\t\tme.min = Math.pow(10, Math.floor(log10(me.min)) - 1);\r\n\t\t\t\tme.max = Math.pow(10, Math.floor(log10(me.max)) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tme.min = DEFAULT_MIN;\r\n\t\t\t\tme.max = DEFAULT_MAX;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (me.min === null) {\r\n\t\t\tme.min = Math.pow(10, Math.floor(log10(me.max)) - 1);\r\n\t\t}\r\n\t\tif (me.max === null) {\r\n\t\t\tme.max = me.min !== 0\r\n\t\t\t\t? Math.pow(10, Math.floor(log10(me.min)) + 1)\r\n\t\t\t\t: DEFAULT_MAX;\r\n\t\t}\r\n\t\tif (me.minNotZero === null) {\r\n\t\t\tif (me.min > 0) {\r\n\t\t\t\tme.minNotZero = me.min;\r\n\t\t\t} else if (me.max < 1) {\r\n\t\t\t\tme.minNotZero = Math.pow(10, Math.floor(log10(me.max)));\r\n\t\t\t} else {\r\n\t\t\t\tme.minNotZero = DEFAULT_MIN;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbuildTicks: function() {\r\n\t\tvar me = this;\r\n\t\tvar tickOpts = me.options.ticks;\r\n\t\tvar reverse = !me.isHorizontal();\r\n\r\n\t\tvar generationOptions = {\r\n\t\t\tmin: nonNegativeOrDefault(tickOpts.min),\r\n\t\t\tmax: nonNegativeOrDefault(tickOpts.max)\r\n\t\t};\r\n\t\tvar ticks = me.ticks = generateTicks$1(generationOptions, me);\r\n\r\n\t\t// At this point, we need to update our max and min given the tick values since we have expanded the\r\n\t\t// range of the scale\r\n\t\tme.max = helpers$1.max(ticks);\r\n\t\tme.min = helpers$1.min(ticks);\r\n\r\n\t\tif (tickOpts.reverse) {\r\n\t\t\treverse = !reverse;\r\n\t\t\tme.start = me.max;\r\n\t\t\tme.end = me.min;\r\n\t\t} else {\r\n\t\t\tme.start = me.min;\r\n\t\t\tme.end = me.max;\r\n\t\t}\r\n\t\tif (reverse) {\r\n\t\t\tticks.reverse();\r\n\t\t}\r\n\t},\r\n\r\n\tconvertTicksToLabels: function() {\r\n\t\tthis.tickValues = this.ticks.slice();\r\n\r\n\t\tcore_scale.prototype.convertTicksToLabels.call(this);\r\n\t},\r\n\r\n\t// Get the correct tooltip label\r\n\tgetLabelForIndex: function(index, datasetIndex) {\r\n\t\treturn this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index]);\r\n\t},\r\n\r\n\tgetPixelForTick: function(index) {\r\n\t\tvar ticks = this.tickValues;\r\n\t\tif (index < 0 || index > ticks.length - 1) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn this.getPixelForValue(ticks[index]);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the value of the first tick.\r\n\t * @param {number} value - The minimum not zero value.\r\n\t * @return {number} The first tick value.\r\n\t * @private\r\n\t */\r\n\t_getFirstTickValue: function(value) {\r\n\t\tvar exp = Math.floor(log10(value));\r\n\t\tvar significand = Math.floor(value / Math.pow(10, exp));\r\n\r\n\t\treturn significand * Math.pow(10, exp);\r\n\t},\r\n\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tvar start = me.min;\r\n\t\tvar offset = 0;\r\n\r\n\t\tcore_scale.prototype._configure.call(me);\r\n\r\n\t\tif (start === 0) {\r\n\t\t\tstart = me._getFirstTickValue(me.minNotZero);\r\n\t\t\toffset = valueOrDefault$b(me.options.ticks.fontSize, core_defaults.global.defaultFontSize) / me._length;\r\n\t\t}\r\n\r\n\t\tme._startValue = log10(start);\r\n\t\tme._valueOffset = offset;\r\n\t\tme._valueRange = (log10(me.max) - log10(start)) / (1 - offset);\r\n\t},\r\n\r\n\tgetPixelForValue: function(value) {\r\n\t\tvar me = this;\r\n\t\tvar decimal = 0;\r\n\r\n\t\tvalue = +me.getRightValue(value);\r\n\r\n\t\tif (value > me.min && value > 0) {\r\n\t\t\tdecimal = (log10(value) - me._startValue) / me._valueRange + me._valueOffset;\r\n\t\t}\r\n\t\treturn me.getPixelForDecimal(decimal);\r\n\t},\r\n\r\n\tgetValueForPixel: function(pixel) {\r\n\t\tvar me = this;\r\n\t\tvar decimal = me.getDecimalForPixel(pixel);\r\n\t\treturn decimal === 0 && me.min === 0\r\n\t\t\t? 0\r\n\t\t\t: Math.pow(10, me._startValue + (decimal - me._valueOffset) * me._valueRange);\r\n\t}\r\n});\r\n\r\n// INTERNAL: static default options, registered in src/index.js\r\nvar _defaults$2 = defaultConfig$2;\nscale_logarithmic._defaults = _defaults$2;\n\nvar valueOrDefault$c = helpers$1.valueOrDefault;\r\nvar valueAtIndexOrDefault$1 = helpers$1.valueAtIndexOrDefault;\r\nvar resolve$4 = helpers$1.options.resolve;\r\n\r\nvar defaultConfig$3 = {\r\n\tdisplay: true,\r\n\r\n\t// Boolean - Whether to animate scaling the chart from the centre\r\n\tanimate: true,\r\n\tposition: 'chartArea',\r\n\r\n\tangleLines: {\r\n\t\tdisplay: true,\r\n\t\tcolor: 'rgba(0,0,0,0.1)',\r\n\t\tlineWidth: 1,\r\n\t\tborderDash: [],\r\n\t\tborderDashOffset: 0.0\r\n\t},\r\n\r\n\tgridLines: {\r\n\t\tcircular: false\r\n\t},\r\n\r\n\t// label settings\r\n\tticks: {\r\n\t\t// Boolean - Show a backdrop to the scale label\r\n\t\tshowLabelBackdrop: true,\r\n\r\n\t\t// String - The colour of the label backdrop\r\n\t\tbackdropColor: 'rgba(255,255,255,0.75)',\r\n\r\n\t\t// Number - The backdrop padding above & below the label in pixels\r\n\t\tbackdropPaddingY: 2,\r\n\r\n\t\t// Number - The backdrop padding to the side of the label in pixels\r\n\t\tbackdropPaddingX: 2,\r\n\r\n\t\tcallback: core_ticks.formatters.linear\r\n\t},\r\n\r\n\tpointLabels: {\r\n\t\t// Boolean - if true, show point labels\r\n\t\tdisplay: true,\r\n\r\n\t\t// Number - Point label font size in pixels\r\n\t\tfontSize: 10,\r\n\r\n\t\t// Function - Used to convert point labels\r\n\t\tcallback: function(label) {\r\n\t\t\treturn label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction getTickBackdropHeight(opts) {\r\n\tvar tickOpts = opts.ticks;\r\n\r\n\tif (tickOpts.display && opts.display) {\r\n\t\treturn valueOrDefault$c(tickOpts.fontSize, core_defaults.global.defaultFontSize) + tickOpts.backdropPaddingY * 2;\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nfunction measureLabelSize(ctx, lineHeight, label) {\r\n\tif (helpers$1.isArray(label)) {\r\n\t\treturn {\r\n\t\t\tw: helpers$1.longestText(ctx, ctx.font, label),\r\n\t\t\th: label.length * lineHeight\r\n\t\t};\r\n\t}\r\n\r\n\treturn {\r\n\t\tw: ctx.measureText(label).width,\r\n\t\th: lineHeight\r\n\t};\r\n}\r\n\r\nfunction determineLimits(angle, pos, size, min, max) {\r\n\tif (angle === min || angle === max) {\r\n\t\treturn {\r\n\t\t\tstart: pos - (size / 2),\r\n\t\t\tend: pos + (size / 2)\r\n\t\t};\r\n\t} else if (angle < min || angle > max) {\r\n\t\treturn {\r\n\t\t\tstart: pos - size,\r\n\t\t\tend: pos\r\n\t\t};\r\n\t}\r\n\r\n\treturn {\r\n\t\tstart: pos,\r\n\t\tend: pos + size\r\n\t};\r\n}\r\n\r\n/**\r\n * Helper function to fit a radial linear scale with point labels\r\n */\r\nfunction fitWithPointLabels(scale) {\r\n\r\n\t// Right, this is really confusing and there is a lot of maths going on here\r\n\t// The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\r\n\t//\r\n\t// Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\r\n\t//\r\n\t// Solution:\r\n\t//\r\n\t// We assume the radius of the polygon is half the size of the canvas at first\r\n\t// at each index we check if the text overlaps.\r\n\t//\r\n\t// Where it does, we store that angle and that index.\r\n\t//\r\n\t// After finding the largest index and angle we calculate how much we need to remove\r\n\t// from the shape radius to move the point inwards by that x.\r\n\t//\r\n\t// We average the left and right distances to get the maximum shape radius that can fit in the box\r\n\t// along with labels.\r\n\t//\r\n\t// Once we have that, we can find the centre point for the chart, by taking the x text protrusion\r\n\t// on each side, removing that from the size, halving it and adding the left x protrusion width.\r\n\t//\r\n\t// This will mean we have a shape fitted to the canvas, as large as it can be with the labels\r\n\t// and position it in the most space efficient manner\r\n\t//\r\n\t// https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\r\n\r\n\tvar plFont = helpers$1.options._parseFont(scale.options.pointLabels);\r\n\r\n\t// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\r\n\t// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\r\n\tvar furthestLimits = {\r\n\t\tl: 0,\r\n\t\tr: scale.width,\r\n\t\tt: 0,\r\n\t\tb: scale.height - scale.paddingTop\r\n\t};\r\n\tvar furthestAngles = {};\r\n\tvar i, textSize, pointPosition;\r\n\r\n\tscale.ctx.font = plFont.string;\r\n\tscale._pointLabelSizes = [];\r\n\r\n\tvar valueCount = scale.chart.data.labels.length;\r\n\tfor (i = 0; i < valueCount; i++) {\r\n\t\tpointPosition = scale.getPointPosition(i, scale.drawingArea + 5);\r\n\t\ttextSize = measureLabelSize(scale.ctx, plFont.lineHeight, scale.pointLabels[i]);\r\n\t\tscale._pointLabelSizes[i] = textSize;\r\n\r\n\t\t// Add quarter circle to make degree 0 mean top of circle\r\n\t\tvar angleRadians = scale.getIndexAngle(i);\r\n\t\tvar angle = helpers$1.toDegrees(angleRadians) % 360;\r\n\t\tvar hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\r\n\t\tvar vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\r\n\r\n\t\tif (hLimits.start < furthestLimits.l) {\r\n\t\t\tfurthestLimits.l = hLimits.start;\r\n\t\t\tfurthestAngles.l = angleRadians;\r\n\t\t}\r\n\r\n\t\tif (hLimits.end > furthestLimits.r) {\r\n\t\t\tfurthestLimits.r = hLimits.end;\r\n\t\t\tfurthestAngles.r = angleRadians;\r\n\t\t}\r\n\r\n\t\tif (vLimits.start < furthestLimits.t) {\r\n\t\t\tfurthestLimits.t = vLimits.start;\r\n\t\t\tfurthestAngles.t = angleRadians;\r\n\t\t}\r\n\r\n\t\tif (vLimits.end > furthestLimits.b) {\r\n\t\t\tfurthestLimits.b = vLimits.end;\r\n\t\t\tfurthestAngles.b = angleRadians;\r\n\t\t}\r\n\t}\r\n\r\n\tscale.setReductions(scale.drawingArea, furthestLimits, furthestAngles);\r\n}\r\n\r\nfunction getTextAlignForAngle(angle) {\r\n\tif (angle === 0 || angle === 180) {\r\n\t\treturn 'center';\r\n\t} else if (angle < 180) {\r\n\t\treturn 'left';\r\n\t}\r\n\r\n\treturn 'right';\r\n}\r\n\r\nfunction fillText(ctx, text, position, lineHeight) {\r\n\tvar y = position.y + lineHeight / 2;\r\n\tvar i, ilen;\r\n\r\n\tif (helpers$1.isArray(text)) {\r\n\t\tfor (i = 0, ilen = text.length; i < ilen; ++i) {\r\n\t\t\tctx.fillText(text[i], position.x, y);\r\n\t\t\ty += lineHeight;\r\n\t\t}\r\n\t} else {\r\n\t\tctx.fillText(text, position.x, y);\r\n\t}\r\n}\r\n\r\nfunction adjustPointPositionForLabelHeight(angle, textSize, position) {\r\n\tif (angle === 90 || angle === 270) {\r\n\t\tposition.y -= (textSize.h / 2);\r\n\t} else if (angle > 270 || angle < 90) {\r\n\t\tposition.y -= textSize.h;\r\n\t}\r\n}\r\n\r\nfunction drawPointLabels(scale) {\r\n\tvar ctx = scale.ctx;\r\n\tvar opts = scale.options;\r\n\tvar pointLabelOpts = opts.pointLabels;\r\n\tvar tickBackdropHeight = getTickBackdropHeight(opts);\r\n\tvar outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);\r\n\tvar plFont = helpers$1.options._parseFont(pointLabelOpts);\r\n\r\n\tctx.save();\r\n\r\n\tctx.font = plFont.string;\r\n\tctx.textBaseline = 'middle';\r\n\r\n\tfor (var i = scale.chart.data.labels.length - 1; i >= 0; i--) {\r\n\t\t// Extra pixels out for some label spacing\r\n\t\tvar extra = (i === 0 ? tickBackdropHeight / 2 : 0);\r\n\t\tvar pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + 5);\r\n\r\n\t\t// Keep this in loop since we may support array properties here\r\n\t\tvar pointLabelFontColor = valueAtIndexOrDefault$1(pointLabelOpts.fontColor, i, core_defaults.global.defaultFontColor);\r\n\t\tctx.fillStyle = pointLabelFontColor;\r\n\r\n\t\tvar angleRadians = scale.getIndexAngle(i);\r\n\t\tvar angle = helpers$1.toDegrees(angleRadians);\r\n\t\tctx.textAlign = getTextAlignForAngle(angle);\r\n\t\tadjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);\r\n\t\tfillText(ctx, scale.pointLabels[i], pointLabelPosition, plFont.lineHeight);\r\n\t}\r\n\tctx.restore();\r\n}\r\n\r\nfunction drawRadiusLine(scale, gridLineOpts, radius, index) {\r\n\tvar ctx = scale.ctx;\r\n\tvar circular = gridLineOpts.circular;\r\n\tvar valueCount = scale.chart.data.labels.length;\r\n\tvar lineColor = valueAtIndexOrDefault$1(gridLineOpts.color, index - 1);\r\n\tvar lineWidth = valueAtIndexOrDefault$1(gridLineOpts.lineWidth, index - 1);\r\n\tvar pointPosition;\r\n\r\n\tif ((!circular && !valueCount) || !lineColor || !lineWidth) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tctx.save();\r\n\tctx.strokeStyle = lineColor;\r\n\tctx.lineWidth = lineWidth;\r\n\tif (ctx.setLineDash) {\r\n\t\tctx.setLineDash(gridLineOpts.borderDash || []);\r\n\t\tctx.lineDashOffset = gridLineOpts.borderDashOffset || 0.0;\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tif (circular) {\r\n\t\t// Draw circular arcs between the points\r\n\t\tctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);\r\n\t} else {\r\n\t\t// Draw straight lines connecting each index\r\n\t\tpointPosition = scale.getPointPosition(0, radius);\r\n\t\tctx.moveTo(pointPosition.x, pointPosition.y);\r\n\r\n\t\tfor (var i = 1; i < valueCount; i++) {\r\n\t\t\tpointPosition = scale.getPointPosition(i, radius);\r\n\t\t\tctx.lineTo(pointPosition.x, pointPosition.y);\r\n\t\t}\r\n\t}\r\n\tctx.closePath();\r\n\tctx.stroke();\r\n\tctx.restore();\r\n}\r\n\r\nfunction numberOrZero(param) {\r\n\treturn helpers$1.isNumber(param) ? param : 0;\r\n}\r\n\r\nvar scale_radialLinear = scale_linearbase.extend({\r\n\tsetDimensions: function() {\r\n\t\tvar me = this;\r\n\r\n\t\t// Set the unconstrained dimension before label rotation\r\n\t\tme.width = me.maxWidth;\r\n\t\tme.height = me.maxHeight;\r\n\t\tme.paddingTop = getTickBackdropHeight(me.options) / 2;\r\n\t\tme.xCenter = Math.floor(me.width / 2);\r\n\t\tme.yCenter = Math.floor((me.height - me.paddingTop) / 2);\r\n\t\tme.drawingArea = Math.min(me.height - me.paddingTop, me.width) / 2;\r\n\t},\r\n\r\n\tdetermineDataLimits: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar min = Number.POSITIVE_INFINITY;\r\n\t\tvar max = Number.NEGATIVE_INFINITY;\r\n\r\n\t\thelpers$1.each(chart.data.datasets, function(dataset, datasetIndex) {\r\n\t\t\tif (chart.isDatasetVisible(datasetIndex)) {\r\n\t\t\t\tvar meta = chart.getDatasetMeta(datasetIndex);\r\n\r\n\t\t\t\thelpers$1.each(dataset.data, function(rawValue, index) {\r\n\t\t\t\t\tvar value = +me.getRightValue(rawValue);\r\n\t\t\t\t\tif (isNaN(value) || meta.data[index].hidden) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tmin = Math.min(value, min);\r\n\t\t\t\t\tmax = Math.max(value, max);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tme.min = (min === Number.POSITIVE_INFINITY ? 0 : min);\r\n\t\tme.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);\r\n\r\n\t\t// Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\r\n\t\tme.handleTickRangeOptions();\r\n\t},\r\n\r\n\t// Returns the maximum number of ticks based on the scale dimension\r\n\t_computeTickLimit: function() {\r\n\t\treturn Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\r\n\t},\r\n\r\n\tconvertTicksToLabels: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tscale_linearbase.prototype.convertTicksToLabels.call(me);\r\n\r\n\t\t// Point labels\r\n\t\tme.pointLabels = me.chart.data.labels.map(function() {\r\n\t\t\tvar label = helpers$1.callback(me.options.pointLabels.callback, arguments, me);\r\n\t\t\treturn label || label === 0 ? label : '';\r\n\t\t});\r\n\t},\r\n\r\n\tgetLabelForIndex: function(index, datasetIndex) {\r\n\t\treturn +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\r\n\t},\r\n\r\n\tfit: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\r\n\t\tif (opts.display && opts.pointLabels.display) {\r\n\t\t\tfitWithPointLabels(me);\r\n\t\t} else {\r\n\t\t\tme.setCenterPoint(0, 0, 0, 0);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Set radius reductions and determine new radius and center point\r\n\t * @private\r\n\t */\r\n\tsetReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {\r\n\t\tvar me = this;\r\n\t\tvar radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);\r\n\t\tvar radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);\r\n\t\tvar radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);\r\n\t\tvar radiusReductionBottom = -Math.max(furthestLimits.b - (me.height - me.paddingTop), 0) / Math.cos(furthestAngles.b);\r\n\r\n\t\tradiusReductionLeft = numberOrZero(radiusReductionLeft);\r\n\t\tradiusReductionRight = numberOrZero(radiusReductionRight);\r\n\t\tradiusReductionTop = numberOrZero(radiusReductionTop);\r\n\t\tradiusReductionBottom = numberOrZero(radiusReductionBottom);\r\n\r\n\t\tme.drawingArea = Math.min(\r\n\t\t\tMath.floor(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),\r\n\t\t\tMath.floor(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));\r\n\t\tme.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);\r\n\t},\r\n\r\n\tsetCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {\r\n\t\tvar me = this;\r\n\t\tvar maxRight = me.width - rightMovement - me.drawingArea;\r\n\t\tvar maxLeft = leftMovement + me.drawingArea;\r\n\t\tvar maxTop = topMovement + me.drawingArea;\r\n\t\tvar maxBottom = (me.height - me.paddingTop) - bottomMovement - me.drawingArea;\r\n\r\n\t\tme.xCenter = Math.floor(((maxLeft + maxRight) / 2) + me.left);\r\n\t\tme.yCenter = Math.floor(((maxTop + maxBottom) / 2) + me.top + me.paddingTop);\r\n\t},\r\n\r\n\tgetIndexAngle: function(index) {\r\n\t\tvar chart = this.chart;\r\n\t\tvar angleMultiplier = 360 / chart.data.labels.length;\r\n\t\tvar options = chart.options || {};\r\n\t\tvar startAngle = options.startAngle || 0;\r\n\r\n\t\t// Start from the top instead of right, so remove a quarter of the circle\r\n\t\tvar angle = (index * angleMultiplier + startAngle) % 360;\r\n\r\n\t\treturn (angle < 0 ? angle + 360 : angle) * Math.PI * 2 / 360;\r\n\t},\r\n\r\n\tgetDistanceFromCenterForValue: function(value) {\r\n\t\tvar me = this;\r\n\r\n\t\tif (helpers$1.isNullOrUndef(value)) {\r\n\t\t\treturn NaN;\r\n\t\t}\r\n\r\n\t\t// Take into account half font size + the yPadding of the top value\r\n\t\tvar scalingFactor = me.drawingArea / (me.max - me.min);\r\n\t\tif (me.options.ticks.reverse) {\r\n\t\t\treturn (me.max - value) * scalingFactor;\r\n\t\t}\r\n\t\treturn (value - me.min) * scalingFactor;\r\n\t},\r\n\r\n\tgetPointPosition: function(index, distanceFromCenter) {\r\n\t\tvar me = this;\r\n\t\tvar thisAngle = me.getIndexAngle(index) - (Math.PI / 2);\r\n\t\treturn {\r\n\t\t\tx: Math.cos(thisAngle) * distanceFromCenter + me.xCenter,\r\n\t\t\ty: Math.sin(thisAngle) * distanceFromCenter + me.yCenter\r\n\t\t};\r\n\t},\r\n\r\n\tgetPointPositionForValue: function(index, value) {\r\n\t\treturn this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\r\n\t},\r\n\r\n\tgetBasePosition: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar min = me.min;\r\n\t\tvar max = me.max;\r\n\r\n\t\treturn me.getPointPositionForValue(index || 0,\r\n\t\t\tme.beginAtZero ? 0 :\r\n\t\t\tmin < 0 && max < 0 ? max :\r\n\t\t\tmin > 0 && max > 0 ? min :\r\n\t\t\t0);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawGrid: function() {\r\n\t\tvar me = this;\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar opts = me.options;\r\n\t\tvar gridLineOpts = opts.gridLines;\r\n\t\tvar angleLineOpts = opts.angleLines;\r\n\t\tvar lineWidth = valueOrDefault$c(angleLineOpts.lineWidth, gridLineOpts.lineWidth);\r\n\t\tvar lineColor = valueOrDefault$c(angleLineOpts.color, gridLineOpts.color);\r\n\t\tvar i, offset, position;\r\n\r\n\t\tif (opts.pointLabels.display) {\r\n\t\t\tdrawPointLabels(me);\r\n\t\t}\r\n\r\n\t\tif (gridLineOpts.display) {\r\n\t\t\thelpers$1.each(me.ticks, function(label, index) {\r\n\t\t\t\tif (index !== 0) {\r\n\t\t\t\t\toffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\r\n\t\t\t\t\tdrawRadiusLine(me, gridLineOpts, offset, index);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (angleLineOpts.display && lineWidth && lineColor) {\r\n\t\t\tctx.save();\r\n\t\t\tctx.lineWidth = lineWidth;\r\n\t\t\tctx.strokeStyle = lineColor;\r\n\t\t\tif (ctx.setLineDash) {\r\n\t\t\t\tctx.setLineDash(resolve$4([angleLineOpts.borderDash, gridLineOpts.borderDash, []]));\r\n\t\t\t\tctx.lineDashOffset = resolve$4([angleLineOpts.borderDashOffset, gridLineOpts.borderDashOffset, 0.0]);\r\n\t\t\t}\r\n\r\n\t\t\tfor (i = me.chart.data.labels.length - 1; i >= 0; i--) {\r\n\t\t\t\toffset = me.getDistanceFromCenterForValue(opts.ticks.reverse ? me.min : me.max);\r\n\t\t\t\tposition = me.getPointPosition(i, offset);\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.moveTo(me.xCenter, me.yCenter);\r\n\t\t\t\tctx.lineTo(position.x, position.y);\r\n\t\t\t\tctx.stroke();\r\n\t\t\t}\r\n\r\n\t\t\tctx.restore();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawLabels: function() {\r\n\t\tvar me = this;\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar opts = me.options;\r\n\t\tvar tickOpts = opts.ticks;\r\n\r\n\t\tif (!tickOpts.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar startAngle = me.getIndexAngle(0);\r\n\t\tvar tickFont = helpers$1.options._parseFont(tickOpts);\r\n\t\tvar tickFontColor = valueOrDefault$c(tickOpts.fontColor, core_defaults.global.defaultFontColor);\r\n\t\tvar offset, width;\r\n\r\n\t\tctx.save();\r\n\t\tctx.font = tickFont.string;\r\n\t\tctx.translate(me.xCenter, me.yCenter);\r\n\t\tctx.rotate(startAngle);\r\n\t\tctx.textAlign = 'center';\r\n\t\tctx.textBaseline = 'middle';\r\n\r\n\t\thelpers$1.each(me.ticks, function(label, index) {\r\n\t\t\tif (index === 0 && !tickOpts.reverse) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\toffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\r\n\r\n\t\t\tif (tickOpts.showLabelBackdrop) {\r\n\t\t\t\twidth = ctx.measureText(label).width;\r\n\t\t\t\tctx.fillStyle = tickOpts.backdropColor;\r\n\r\n\t\t\t\tctx.fillRect(\r\n\t\t\t\t\t-width / 2 - tickOpts.backdropPaddingX,\r\n\t\t\t\t\t-offset - tickFont.size / 2 - tickOpts.backdropPaddingY,\r\n\t\t\t\t\twidth + tickOpts.backdropPaddingX * 2,\r\n\t\t\t\t\ttickFont.size + tickOpts.backdropPaddingY * 2\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tctx.fillStyle = tickFontColor;\r\n\t\t\tctx.fillText(label, 0, -offset);\r\n\t\t});\r\n\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_drawTitle: helpers$1.noop\r\n});\r\n\r\n// INTERNAL: static default options, registered in src/index.js\r\nvar _defaults$3 = defaultConfig$3;\nscale_radialLinear._defaults = _defaults$3;\n\nvar deprecated$1 = helpers$1._deprecated;\r\nvar resolve$5 = helpers$1.options.resolve;\r\nvar valueOrDefault$d = helpers$1.valueOrDefault;\r\n\r\n// Integer constants are from the ES6 spec.\r\nvar MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\r\nvar MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\r\n\r\nvar INTERVALS = {\r\n\tmillisecond: {\r\n\t\tcommon: true,\r\n\t\tsize: 1,\r\n\t\tsteps: 1000\r\n\t},\r\n\tsecond: {\r\n\t\tcommon: true,\r\n\t\tsize: 1000,\r\n\t\tsteps: 60\r\n\t},\r\n\tminute: {\r\n\t\tcommon: true,\r\n\t\tsize: 60000,\r\n\t\tsteps: 60\r\n\t},\r\n\thour: {\r\n\t\tcommon: true,\r\n\t\tsize: 3600000,\r\n\t\tsteps: 24\r\n\t},\r\n\tday: {\r\n\t\tcommon: true,\r\n\t\tsize: 86400000,\r\n\t\tsteps: 30\r\n\t},\r\n\tweek: {\r\n\t\tcommon: false,\r\n\t\tsize: 604800000,\r\n\t\tsteps: 4\r\n\t},\r\n\tmonth: {\r\n\t\tcommon: true,\r\n\t\tsize: 2.628e9,\r\n\t\tsteps: 12\r\n\t},\r\n\tquarter: {\r\n\t\tcommon: false,\r\n\t\tsize: 7.884e9,\r\n\t\tsteps: 4\r\n\t},\r\n\tyear: {\r\n\t\tcommon: true,\r\n\t\tsize: 3.154e10\r\n\t}\r\n};\r\n\r\nvar UNITS = Object.keys(INTERVALS);\r\n\r\nfunction sorter(a, b) {\r\n\treturn a - b;\r\n}\r\n\r\nfunction arrayUnique(items) {\r\n\tvar hash = {};\r\n\tvar out = [];\r\n\tvar i, ilen, item;\r\n\r\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\r\n\t\titem = items[i];\r\n\t\tif (!hash[item]) {\r\n\t\t\thash[item] = true;\r\n\t\t\tout.push(item);\r\n\t\t}\r\n\t}\r\n\r\n\treturn out;\r\n}\r\n\r\nfunction getMin(options) {\r\n\treturn helpers$1.valueOrDefault(options.time.min, options.ticks.min);\r\n}\r\n\r\nfunction getMax(options) {\r\n\treturn helpers$1.valueOrDefault(options.time.max, options.ticks.max);\r\n}\r\n\r\n/**\r\n * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\r\n * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\r\n * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\r\n * extremity (left + width or top + height). Note that it would be more optimized to directly\r\n * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\r\n * to create the lookup table. The table ALWAYS contains at least two items: min and max.\r\n *\r\n * @param {number[]} timestamps - timestamps sorted from lowest to highest.\r\n * @param {string} distribution - If 'linear', timestamps will be spread linearly along the min\r\n * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.\r\n * If 'series', timestamps will be positioned at the same distance from each other. In this\r\n * case, only timestamps that break the time linearity are registered, meaning that in the\r\n * best case, all timestamps are linear, the table contains only min and max.\r\n */\r\nfunction buildLookupTable(timestamps, min, max, distribution) {\r\n\tif (distribution === 'linear' || !timestamps.length) {\r\n\t\treturn [\r\n\t\t\t{time: min, pos: 0},\r\n\t\t\t{time: max, pos: 1}\r\n\t\t];\r\n\t}\r\n\r\n\tvar table = [];\r\n\tvar items = [min];\r\n\tvar i, ilen, prev, curr, next;\r\n\r\n\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\r\n\t\tcurr = timestamps[i];\r\n\t\tif (curr > min && curr < max) {\r\n\t\t\titems.push(curr);\r\n\t\t}\r\n\t}\r\n\r\n\titems.push(max);\r\n\r\n\tfor (i = 0, ilen = items.length; i < ilen; ++i) {\r\n\t\tnext = items[i + 1];\r\n\t\tprev = items[i - 1];\r\n\t\tcurr = items[i];\r\n\r\n\t\t// only add points that breaks the scale linearity\r\n\t\tif (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {\r\n\t\t\ttable.push({time: curr, pos: i / (ilen - 1)});\r\n\t\t}\r\n\t}\r\n\r\n\treturn table;\r\n}\r\n\r\n// @see adapted from https://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/\r\nfunction lookup(table, key, value) {\r\n\tvar lo = 0;\r\n\tvar hi = table.length - 1;\r\n\tvar mid, i0, i1;\r\n\r\n\twhile (lo >= 0 && lo <= hi) {\r\n\t\tmid = (lo + hi) >> 1;\r\n\t\ti0 = table[mid - 1] || null;\r\n\t\ti1 = table[mid];\r\n\r\n\t\tif (!i0) {\r\n\t\t\t// given value is outside table (before first item)\r\n\t\t\treturn {lo: null, hi: i1};\r\n\t\t} else if (i1[key] < value) {\r\n\t\t\tlo = mid + 1;\r\n\t\t} else if (i0[key] > value) {\r\n\t\t\thi = mid - 1;\r\n\t\t} else {\r\n\t\t\treturn {lo: i0, hi: i1};\r\n\t\t}\r\n\t}\r\n\r\n\t// given value is outside table (after last item)\r\n\treturn {lo: i1, hi: null};\r\n}\r\n\r\n/**\r\n * Linearly interpolates the given source `value` using the table items `skey` values and\r\n * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')\r\n * returns the position for a timestamp equal to 42. If value is out of bounds, values at\r\n * index [0, 1] or [n - 1, n] are used for the interpolation.\r\n */\r\nfunction interpolate$1(table, skey, sval, tkey) {\r\n\tvar range = lookup(table, skey, sval);\r\n\r\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\r\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\r\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\r\n\r\n\tvar span = next[skey] - prev[skey];\r\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\r\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\r\n\r\n\treturn prev[tkey] + offset;\r\n}\r\n\r\nfunction toTimestamp(scale, input) {\r\n\tvar adapter = scale._adapter;\r\n\tvar options = scale.options.time;\r\n\tvar parser = options.parser;\r\n\tvar format = parser || options.format;\r\n\tvar value = input;\r\n\r\n\tif (typeof parser === 'function') {\r\n\t\tvalue = parser(value);\r\n\t}\r\n\r\n\t// Only parse if its not a timestamp already\r\n\tif (!helpers$1.isFinite(value)) {\r\n\t\tvalue = typeof format === 'string'\r\n\t\t\t? adapter.parse(value, format)\r\n\t\t\t: adapter.parse(value);\r\n\t}\r\n\r\n\tif (value !== null) {\r\n\t\treturn +value;\r\n\t}\r\n\r\n\t// Labels are in an incompatible format and no `parser` has been provided.\r\n\t// The user might still use the deprecated `format` option for parsing.\r\n\tif (!parser && typeof format === 'function') {\r\n\t\tvalue = format(input);\r\n\r\n\t\t// `format` could return something else than a timestamp, if so, parse it\r\n\t\tif (!helpers$1.isFinite(value)) {\r\n\t\t\tvalue = adapter.parse(value);\r\n\t\t}\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\nfunction parse(scale, input) {\r\n\tif (helpers$1.isNullOrUndef(input)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar options = scale.options.time;\r\n\tvar value = toTimestamp(scale, scale.getRightValue(input));\r\n\tif (value === null) {\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif (options.round) {\r\n\t\tvalue = +scale._adapter.startOf(value, options.round);\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\n/**\r\n * Figures out what unit results in an appropriate number of auto-generated ticks\r\n */\r\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\r\n\tvar ilen = UNITS.length;\r\n\tvar i, interval, factor;\r\n\r\n\tfor (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\r\n\t\tinterval = INTERVALS[UNITS[i]];\r\n\t\tfactor = interval.steps ? interval.steps : MAX_INTEGER;\r\n\r\n\t\tif (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\r\n\t\t\treturn UNITS[i];\r\n\t\t}\r\n\t}\r\n\r\n\treturn UNITS[ilen - 1];\r\n}\r\n\r\n/**\r\n * Figures out what unit to format a set of ticks with\r\n */\r\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\r\n\tvar i, unit;\r\n\r\n\tfor (i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\r\n\t\tunit = UNITS[i];\r\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\r\n\t\t\treturn unit;\r\n\t\t}\r\n\t}\r\n\r\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\r\n}\r\n\r\nfunction determineMajorUnit(unit) {\r\n\tfor (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\r\n\t\tif (INTERVALS[UNITS[i]].common) {\r\n\t\t\treturn UNITS[i];\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Generates a maximum of `capacity` timestamps between min and max, rounded to the\r\n * `minor` unit using the given scale time `options`.\r\n * Important: this method can return ticks outside the min and max range, it's the\r\n * responsibility of the calling code to clamp values if needed.\r\n */\r\nfunction generate(scale, min, max, capacity) {\r\n\tvar adapter = scale._adapter;\r\n\tvar options = scale.options;\r\n\tvar timeOpts = options.time;\r\n\tvar minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);\r\n\tvar stepSize = resolve$5([timeOpts.stepSize, timeOpts.unitStepSize, 1]);\r\n\tvar weekday = minor === 'week' ? timeOpts.isoWeekday : false;\r\n\tvar first = min;\r\n\tvar ticks = [];\r\n\tvar time;\r\n\r\n\t// For 'week' unit, handle the first day of week option\r\n\tif (weekday) {\r\n\t\tfirst = +adapter.startOf(first, 'isoWeek', weekday);\r\n\t}\r\n\r\n\t// Align first ticks on unit\r\n\tfirst = +adapter.startOf(first, weekday ? 'day' : minor);\r\n\r\n\t// Prevent browser from freezing in case user options request millions of milliseconds\r\n\tif (adapter.diff(max, min, minor) > 100000 * stepSize) {\r\n\t\tthrow min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor;\r\n\t}\r\n\r\n\tfor (time = first; time < max; time = +adapter.add(time, stepSize, minor)) {\r\n\t\tticks.push(time);\r\n\t}\r\n\r\n\tif (time === max || options.bounds === 'ticks') {\r\n\t\tticks.push(time);\r\n\t}\r\n\r\n\treturn ticks;\r\n}\r\n\r\n/**\r\n * Returns the start and end offsets from edges in the form of {start, end}\r\n * where each value is a relative width to the scale and ranges between 0 and 1.\r\n * They add extra margins on the both sides by scaling down the original scale.\r\n * Offsets are added when the `offset` option is true.\r\n */\r\nfunction computeOffsets(table, ticks, min, max, options) {\r\n\tvar start = 0;\r\n\tvar end = 0;\r\n\tvar first, last;\r\n\r\n\tif (options.offset && ticks.length) {\r\n\t\tfirst = interpolate$1(table, 'time', ticks[0], 'pos');\r\n\t\tif (ticks.length === 1) {\r\n\t\t\tstart = 1 - first;\r\n\t\t} else {\r\n\t\t\tstart = (interpolate$1(table, 'time', ticks[1], 'pos') - first) / 2;\r\n\t\t}\r\n\t\tlast = interpolate$1(table, 'time', ticks[ticks.length - 1], 'pos');\r\n\t\tif (ticks.length === 1) {\r\n\t\t\tend = last;\r\n\t\t} else {\r\n\t\t\tend = (last - interpolate$1(table, 'time', ticks[ticks.length - 2], 'pos')) / 2;\r\n\t\t}\r\n\t}\r\n\r\n\treturn {start: start, end: end, factor: 1 / (start + 1 + end)};\r\n}\r\n\r\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\r\n\tvar adapter = scale._adapter;\r\n\tvar first = +adapter.startOf(ticks[0].value, majorUnit);\r\n\tvar last = ticks[ticks.length - 1].value;\r\n\tvar major, index;\r\n\r\n\tfor (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\r\n\t\tindex = map[major];\r\n\t\tif (index >= 0) {\r\n\t\t\tticks[index].major = true;\r\n\t\t}\r\n\t}\r\n\treturn ticks;\r\n}\r\n\r\nfunction ticksFromTimestamps(scale, values, majorUnit) {\r\n\tvar ticks = [];\r\n\tvar map = {};\r\n\tvar ilen = values.length;\r\n\tvar i, value;\r\n\r\n\tfor (i = 0; i < ilen; ++i) {\r\n\t\tvalue = values[i];\r\n\t\tmap[value] = i;\r\n\r\n\t\tticks.push({\r\n\t\t\tvalue: value,\r\n\t\t\tmajor: false\r\n\t\t});\r\n\t}\r\n\r\n\t// We set the major ticks separately from the above loop because calling startOf for every tick\r\n\t// is expensive when there is a large number of ticks\r\n\treturn (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\r\n}\r\n\r\nvar defaultConfig$4 = {\r\n\tposition: 'bottom',\r\n\r\n\t/**\r\n\t * Data distribution along the scale:\r\n\t * - 'linear': data are spread according to their time (distances can vary),\r\n\t * - 'series': data are spread at the same distance from each other.\r\n\t * @see https://github.com/chartjs/Chart.js/pull/4507\r\n\t * @since 2.7.0\r\n\t */\r\n\tdistribution: 'linear',\r\n\r\n\t/**\r\n\t * Scale boundary strategy (bypassed by min/max time options)\r\n\t * - `data`: make sure data are fully visible, ticks outside are removed\r\n\t * - `ticks`: make sure ticks are fully visible, data outside are truncated\r\n\t * @see https://github.com/chartjs/Chart.js/pull/4556\r\n\t * @since 2.7.0\r\n\t */\r\n\tbounds: 'data',\r\n\r\n\tadapters: {},\r\n\ttime: {\r\n\t\tparser: false, // false == a pattern string from https://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment\r\n\t\tunit: false, // false == automatic or override with week, month, year, etc.\r\n\t\tround: false, // none, or override with week, month, year, etc.\r\n\t\tdisplayFormat: false, // DEPRECATED\r\n\t\tisoWeekday: false, // override week start day - see https://momentjs.com/docs/#/get-set/iso-weekday/\r\n\t\tminUnit: 'millisecond',\r\n\t\tdisplayFormats: {}\r\n\t},\r\n\tticks: {\r\n\t\tautoSkip: false,\r\n\r\n\t\t/**\r\n\t\t * Ticks generation input values:\r\n\t\t * - 'auto': generates \"optimal\" ticks based on scale size and time options.\r\n\t\t * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\r\n\t\t * - 'labels': generates ticks from user given `data.labels` values ONLY.\r\n\t\t * @see https://github.com/chartjs/Chart.js/pull/4507\r\n\t\t * @since 2.7.0\r\n\t\t */\r\n\t\tsource: 'auto',\r\n\r\n\t\tmajor: {\r\n\t\t\tenabled: false\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar scale_time = core_scale.extend({\r\n\tinitialize: function() {\r\n\t\tthis.mergeTicksOptions();\r\n\t\tcore_scale.prototype.initialize.call(this);\r\n\t},\r\n\r\n\tupdate: function() {\r\n\t\tvar me = this;\r\n\t\tvar options = me.options;\r\n\t\tvar time = options.time || (options.time = {});\r\n\t\tvar adapter = me._adapter = new core_adapters._date(options.adapters.date);\r\n\r\n\t\t// DEPRECATIONS: output a message only one time per update\r\n\t\tdeprecated$1('time scale', time.format, 'time.format', 'time.parser');\r\n\t\tdeprecated$1('time scale', time.min, 'time.min', 'ticks.min');\r\n\t\tdeprecated$1('time scale', time.max, 'time.max', 'ticks.max');\r\n\r\n\t\t// Backward compatibility: before introducing adapter, `displayFormats` was\r\n\t\t// supposed to contain *all* unit/string pairs but this can't be resolved\r\n\t\t// when loading the scale (adapters are loaded afterward), so let's populate\r\n\t\t// missing formats on update\r\n\t\thelpers$1.mergeIf(time.displayFormats, adapter.formats());\r\n\r\n\t\treturn core_scale.prototype.update.apply(me, arguments);\r\n\t},\r\n\r\n\t/**\r\n\t * Allows data to be referenced via 't' attribute\r\n\t */\r\n\tgetRightValue: function(rawValue) {\r\n\t\tif (rawValue && rawValue.t !== undefined) {\r\n\t\t\trawValue = rawValue.t;\r\n\t\t}\r\n\t\treturn core_scale.prototype.getRightValue.call(this, rawValue);\r\n\t},\r\n\r\n\tdetermineDataLimits: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar adapter = me._adapter;\r\n\t\tvar options = me.options;\r\n\t\tvar unit = options.time.unit || 'day';\r\n\t\tvar min = MAX_INTEGER;\r\n\t\tvar max = MIN_INTEGER;\r\n\t\tvar timestamps = [];\r\n\t\tvar datasets = [];\r\n\t\tvar labels = [];\r\n\t\tvar i, j, ilen, jlen, data, timestamp, labelsAdded;\r\n\t\tvar dataLabels = me._getLabels();\r\n\r\n\t\tfor (i = 0, ilen = dataLabels.length; i < ilen; ++i) {\r\n\t\t\tlabels.push(parse(me, dataLabels[i]));\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\tif (chart.isDatasetVisible(i)) {\r\n\t\t\t\tdata = chart.data.datasets[i].data;\r\n\r\n\t\t\t\t// Let's consider that all data have the same format.\r\n\t\t\t\tif (helpers$1.isObject(data[0])) {\r\n\t\t\t\t\tdatasets[i] = [];\r\n\r\n\t\t\t\t\tfor (j = 0, jlen = data.length; j < jlen; ++j) {\r\n\t\t\t\t\t\ttimestamp = parse(me, data[j]);\r\n\t\t\t\t\t\ttimestamps.push(timestamp);\r\n\t\t\t\t\t\tdatasets[i][j] = timestamp;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdatasets[i] = labels.slice(0);\r\n\t\t\t\t\tif (!labelsAdded) {\r\n\t\t\t\t\t\ttimestamps = timestamps.concat(labels);\r\n\t\t\t\t\t\tlabelsAdded = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tdatasets[i] = [];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (labels.length) {\r\n\t\t\tmin = Math.min(min, labels[0]);\r\n\t\t\tmax = Math.max(max, labels[labels.length - 1]);\r\n\t\t}\r\n\r\n\t\tif (timestamps.length) {\r\n\t\t\ttimestamps = ilen > 1 ? arrayUnique(timestamps).sort(sorter) : timestamps.sort(sorter);\r\n\t\t\tmin = Math.min(min, timestamps[0]);\r\n\t\t\tmax = Math.max(max, timestamps[timestamps.length - 1]);\r\n\t\t}\r\n\r\n\t\tmin = parse(me, getMin(options)) || min;\r\n\t\tmax = parse(me, getMax(options)) || max;\r\n\r\n\t\t// In case there is no valid min/max, set limits based on unit time option\r\n\t\tmin = min === MAX_INTEGER ? +adapter.startOf(Date.now(), unit) : min;\r\n\t\tmax = max === MIN_INTEGER ? +adapter.endOf(Date.now(), unit) + 1 : max;\r\n\r\n\t\t// Make sure that max is strictly higher than min (required by the lookup table)\r\n\t\tme.min = Math.min(min, max);\r\n\t\tme.max = Math.max(min + 1, max);\r\n\r\n\t\t// PRIVATE\r\n\t\tme._table = [];\r\n\t\tme._timestamps = {\r\n\t\t\tdata: timestamps,\r\n\t\t\tdatasets: datasets,\r\n\t\t\tlabels: labels\r\n\t\t};\r\n\t},\r\n\r\n\tbuildTicks: function() {\r\n\t\tvar me = this;\r\n\t\tvar min = me.min;\r\n\t\tvar max = me.max;\r\n\t\tvar options = me.options;\r\n\t\tvar tickOpts = options.ticks;\r\n\t\tvar timeOpts = options.time;\r\n\t\tvar timestamps = me._timestamps;\r\n\t\tvar ticks = [];\r\n\t\tvar capacity = me.getLabelCapacity(min);\r\n\t\tvar source = tickOpts.source;\r\n\t\tvar distribution = options.distribution;\r\n\t\tvar i, ilen, timestamp;\r\n\r\n\t\tif (source === 'data' || (source === 'auto' && distribution === 'series')) {\r\n\t\t\ttimestamps = timestamps.data;\r\n\t\t} else if (source === 'labels') {\r\n\t\t\ttimestamps = timestamps.labels;\r\n\t\t} else {\r\n\t\t\ttimestamps = generate(me, min, max, capacity);\r\n\t\t}\r\n\r\n\t\tif (options.bounds === 'ticks' && timestamps.length) {\r\n\t\t\tmin = timestamps[0];\r\n\t\t\tmax = timestamps[timestamps.length - 1];\r\n\t\t}\r\n\r\n\t\t// Enforce limits with user min/max options\r\n\t\tmin = parse(me, getMin(options)) || min;\r\n\t\tmax = parse(me, getMax(options)) || max;\r\n\r\n\t\t// Remove ticks outside the min/max range\r\n\t\tfor (i = 0, ilen = timestamps.length; i < ilen; ++i) {\r\n\t\t\ttimestamp = timestamps[i];\r\n\t\t\tif (timestamp >= min && timestamp <= max) {\r\n\t\t\t\tticks.push(timestamp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tme.min = min;\r\n\t\tme.max = max;\r\n\r\n\t\t// PRIVATE\r\n\t\t// determineUnitForFormatting relies on the number of ticks so we don't use it when\r\n\t\t// autoSkip is enabled because we don't yet know what the final number of ticks will be\r\n\t\tme._unit = timeOpts.unit || (tickOpts.autoSkip\r\n\t\t\t? determineUnitForAutoTicks(timeOpts.minUnit, me.min, me.max, capacity)\r\n\t\t\t: determineUnitForFormatting(me, ticks.length, timeOpts.minUnit, me.min, me.max));\r\n\t\tme._majorUnit = !tickOpts.major.enabled || me._unit === 'year' ? undefined\r\n\t\t\t: determineMajorUnit(me._unit);\r\n\t\tme._table = buildLookupTable(me._timestamps.data, min, max, distribution);\r\n\t\tme._offsets = computeOffsets(me._table, ticks, min, max, options);\r\n\r\n\t\tif (tickOpts.reverse) {\r\n\t\t\tticks.reverse();\r\n\t\t}\r\n\r\n\t\treturn ticksFromTimestamps(me, ticks, me._majorUnit);\r\n\t},\r\n\r\n\tgetLabelForIndex: function(index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar adapter = me._adapter;\r\n\t\tvar data = me.chart.data;\r\n\t\tvar timeOpts = me.options.time;\r\n\t\tvar label = data.labels && index < data.labels.length ? data.labels[index] : '';\r\n\t\tvar value = data.datasets[datasetIndex].data[index];\r\n\r\n\t\tif (helpers$1.isObject(value)) {\r\n\t\t\tlabel = me.getRightValue(value);\r\n\t\t}\r\n\t\tif (timeOpts.tooltipFormat) {\r\n\t\t\treturn adapter.format(toTimestamp(me, label), timeOpts.tooltipFormat);\r\n\t\t}\r\n\t\tif (typeof label === 'string') {\r\n\t\t\treturn label;\r\n\t\t}\r\n\t\treturn adapter.format(toTimestamp(me, label), timeOpts.displayFormats.datetime);\r\n\t},\r\n\r\n\t/**\r\n\t * Function to format an individual tick mark\r\n\t * @private\r\n\t */\r\n\ttickFormatFunction: function(time, index, ticks, format) {\r\n\t\tvar me = this;\r\n\t\tvar adapter = me._adapter;\r\n\t\tvar options = me.options;\r\n\t\tvar formats = options.time.displayFormats;\r\n\t\tvar minorFormat = formats[me._unit];\r\n\t\tvar majorUnit = me._majorUnit;\r\n\t\tvar majorFormat = formats[majorUnit];\r\n\t\tvar tick = ticks[index];\r\n\t\tvar tickOpts = options.ticks;\r\n\t\tvar major = majorUnit && majorFormat && tick && tick.major;\r\n\t\tvar label = adapter.format(time, format ? format : major ? majorFormat : minorFormat);\r\n\t\tvar nestedTickOpts = major ? tickOpts.major : tickOpts.minor;\r\n\t\tvar formatter = resolve$5([\r\n\t\t\tnestedTickOpts.callback,\r\n\t\t\tnestedTickOpts.userCallback,\r\n\t\t\ttickOpts.callback,\r\n\t\t\ttickOpts.userCallback\r\n\t\t]);\r\n\r\n\t\treturn formatter ? formatter(label, index, ticks) : label;\r\n\t},\r\n\r\n\tconvertTicksToLabels: function(ticks) {\r\n\t\tvar labels = [];\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = ticks.length; i < ilen; ++i) {\r\n\t\t\tlabels.push(this.tickFormatFunction(ticks[i].value, i, ticks));\r\n\t\t}\r\n\r\n\t\treturn labels;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tgetPixelForOffset: function(time) {\r\n\t\tvar me = this;\r\n\t\tvar offsets = me._offsets;\r\n\t\tvar pos = interpolate$1(me._table, 'time', time, 'pos');\r\n\t\treturn me.getPixelForDecimal((offsets.start + pos) * offsets.factor);\r\n\t},\r\n\r\n\tgetPixelForValue: function(value, index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar time = null;\r\n\r\n\t\tif (index !== undefined && datasetIndex !== undefined) {\r\n\t\t\ttime = me._timestamps.datasets[datasetIndex][index];\r\n\t\t}\r\n\r\n\t\tif (time === null) {\r\n\t\t\ttime = parse(me, value);\r\n\t\t}\r\n\r\n\t\tif (time !== null) {\r\n\t\t\treturn me.getPixelForOffset(time);\r\n\t\t}\r\n\t},\r\n\r\n\tgetPixelForTick: function(index) {\r\n\t\tvar ticks = this.getTicks();\r\n\t\treturn index >= 0 && index < ticks.length ?\r\n\t\t\tthis.getPixelForOffset(ticks[index].value) :\r\n\t\t\tnull;\r\n\t},\r\n\r\n\tgetValueForPixel: function(pixel) {\r\n\t\tvar me = this;\r\n\t\tvar offsets = me._offsets;\r\n\t\tvar pos = me.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\r\n\t\tvar time = interpolate$1(me._table, 'pos', pos, 'time');\r\n\r\n\t\t// DEPRECATION, we should return time directly\r\n\t\treturn me._adapter._create(time);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getLabelSize: function(label) {\r\n\t\tvar me = this;\r\n\t\tvar ticksOpts = me.options.ticks;\r\n\t\tvar tickLabelWidth = me.ctx.measureText(label).width;\r\n\t\tvar angle = helpers$1.toRadians(me.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\r\n\t\tvar cosRotation = Math.cos(angle);\r\n\t\tvar sinRotation = Math.sin(angle);\r\n\t\tvar tickFontSize = valueOrDefault$d(ticksOpts.fontSize, core_defaults.global.defaultFontSize);\r\n\r\n\t\treturn {\r\n\t\t\tw: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\r\n\t\t\th: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Crude approximation of what the label width might be\r\n\t * @private\r\n\t */\r\n\tgetLabelWidth: function(label) {\r\n\t\treturn this._getLabelSize(label).w;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tgetLabelCapacity: function(exampleTime) {\r\n\t\tvar me = this;\r\n\t\tvar timeOpts = me.options.time;\r\n\t\tvar displayFormats = timeOpts.displayFormats;\r\n\r\n\t\t// pick the longest format (milliseconds) for guestimation\r\n\t\tvar format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\r\n\t\tvar exampleLabel = me.tickFormatFunction(exampleTime, 0, ticksFromTimestamps(me, [exampleTime], me._majorUnit), format);\r\n\t\tvar size = me._getLabelSize(exampleLabel);\r\n\t\tvar capacity = Math.floor(me.isHorizontal() ? me.width / size.w : me.height / size.h);\r\n\r\n\t\tif (me.options.offset) {\r\n\t\t\tcapacity--;\r\n\t\t}\r\n\r\n\t\treturn capacity > 0 ? capacity : 1;\r\n\t}\r\n});\r\n\r\n// INTERNAL: static default options, registered in src/index.js\r\nvar _defaults$4 = defaultConfig$4;\nscale_time._defaults = _defaults$4;\n\nvar scales = {\r\n\tcategory: scale_category,\r\n\tlinear: scale_linear,\r\n\tlogarithmic: scale_logarithmic,\r\n\tradialLinear: scale_radialLinear,\r\n\ttime: scale_time\r\n};\n\nvar FORMATS = {\r\n\tdatetime: 'MMM D, YYYY, h:mm:ss a',\r\n\tmillisecond: 'h:mm:ss.SSS a',\r\n\tsecond: 'h:mm:ss a',\r\n\tminute: 'h:mm a',\r\n\thour: 'hA',\r\n\tday: 'MMM D',\r\n\tweek: 'll',\r\n\tmonth: 'MMM YYYY',\r\n\tquarter: '[Q]Q - YYYY',\r\n\tyear: 'YYYY'\r\n};\r\n\r\ncore_adapters._date.override(typeof moment === 'function' ? {\r\n\t_id: 'moment', // DEBUG ONLY\r\n\r\n\tformats: function() {\r\n\t\treturn FORMATS;\r\n\t},\r\n\r\n\tparse: function(value, format) {\r\n\t\tif (typeof value === 'string' && typeof format === 'string') {\r\n\t\t\tvalue = moment(value, format);\r\n\t\t} else if (!(value instanceof moment)) {\r\n\t\t\tvalue = moment(value);\r\n\t\t}\r\n\t\treturn value.isValid() ? value.valueOf() : null;\r\n\t},\r\n\r\n\tformat: function(time, format) {\r\n\t\treturn moment(time).format(format);\r\n\t},\r\n\r\n\tadd: function(time, amount, unit) {\r\n\t\treturn moment(time).add(amount, unit).valueOf();\r\n\t},\r\n\r\n\tdiff: function(max, min, unit) {\r\n\t\treturn moment(max).diff(moment(min), unit);\r\n\t},\r\n\r\n\tstartOf: function(time, unit, weekday) {\r\n\t\ttime = moment(time);\r\n\t\tif (unit === 'isoWeek') {\r\n\t\t\treturn time.isoWeekday(weekday).valueOf();\r\n\t\t}\r\n\t\treturn time.startOf(unit).valueOf();\r\n\t},\r\n\r\n\tendOf: function(time, unit) {\r\n\t\treturn moment(time).endOf(unit).valueOf();\r\n\t},\r\n\r\n\t// DEPRECATIONS\r\n\r\n\t/**\r\n\t * Provided for backward compatibility with scale.getValueForPixel().\r\n\t * @deprecated since version 2.8.0\r\n\t * @todo remove at version 3\r\n\t * @private\r\n\t */\r\n\t_create: function(time) {\r\n\t\treturn moment(time);\r\n\t},\r\n} : {});\n\ncore_defaults._set('global', {\r\n\tplugins: {\r\n\t\tfiller: {\r\n\t\t\tpropagate: true\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar mappers = {\r\n\tdataset: function(source) {\r\n\t\tvar index = source.fill;\r\n\t\tvar chart = source.chart;\r\n\t\tvar meta = chart.getDatasetMeta(index);\r\n\t\tvar visible = meta && chart.isDatasetVisible(index);\r\n\t\tvar points = (visible && meta.dataset._children) || [];\r\n\t\tvar length = points.length || 0;\r\n\r\n\t\treturn !length ? null : function(point, i) {\r\n\t\t\treturn (i < length && points[i]._view) || null;\r\n\t\t};\r\n\t},\r\n\r\n\tboundary: function(source) {\r\n\t\tvar boundary = source.boundary;\r\n\t\tvar x = boundary ? boundary.x : null;\r\n\t\tvar y = boundary ? boundary.y : null;\r\n\r\n\t\tif (helpers$1.isArray(boundary)) {\r\n\t\t\treturn function(point, i) {\r\n\t\t\t\treturn boundary[i];\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn function(point) {\r\n\t\t\treturn {\r\n\t\t\t\tx: x === null ? point.x : x,\r\n\t\t\t\ty: y === null ? point.y : y,\r\n\t\t\t};\r\n\t\t};\r\n\t}\r\n};\r\n\r\n// @todo if (fill[0] === '#')\r\nfunction decodeFill(el, index, count) {\r\n\tvar model = el._model || {};\r\n\tvar fill = model.fill;\r\n\tvar target;\r\n\r\n\tif (fill === undefined) {\r\n\t\tfill = !!model.backgroundColor;\r\n\t}\r\n\r\n\tif (fill === false || fill === null) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (fill === true) {\r\n\t\treturn 'origin';\r\n\t}\r\n\r\n\ttarget = parseFloat(fill, 10);\r\n\tif (isFinite(target) && Math.floor(target) === target) {\r\n\t\tif (fill[0] === '-' || fill[0] === '+') {\r\n\t\t\ttarget = index + target;\r\n\t\t}\r\n\r\n\t\tif (target === index || target < 0 || target >= count) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t}\r\n\r\n\tswitch (fill) {\r\n\t// compatibility\r\n\tcase 'bottom':\r\n\t\treturn 'start';\r\n\tcase 'top':\r\n\t\treturn 'end';\r\n\tcase 'zero':\r\n\t\treturn 'origin';\r\n\t// supported boundaries\r\n\tcase 'origin':\r\n\tcase 'start':\r\n\tcase 'end':\r\n\t\treturn fill;\r\n\t// invalid fill values\r\n\tdefault:\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction computeLinearBoundary(source) {\r\n\tvar model = source.el._model || {};\r\n\tvar scale = source.el._scale || {};\r\n\tvar fill = source.fill;\r\n\tvar target = null;\r\n\tvar horizontal;\r\n\r\n\tif (isFinite(fill)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t// Backward compatibility: until v3, we still need to support boundary values set on\r\n\t// the model (scaleTop, scaleBottom and scaleZero) because some external plugins and\r\n\t// controllers might still use it (e.g. the Smith chart).\r\n\r\n\tif (fill === 'start') {\r\n\t\ttarget = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;\r\n\t} else if (fill === 'end') {\r\n\t\ttarget = model.scaleTop === undefined ? scale.top : model.scaleTop;\r\n\t} else if (model.scaleZero !== undefined) {\r\n\t\ttarget = model.scaleZero;\r\n\t} else if (scale.getBasePixel) {\r\n\t\ttarget = scale.getBasePixel();\r\n\t}\r\n\r\n\tif (target !== undefined && target !== null) {\r\n\t\tif (target.x !== undefined && target.y !== undefined) {\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\tif (helpers$1.isFinite(target)) {\r\n\t\t\thorizontal = scale.isHorizontal();\r\n\t\t\treturn {\r\n\t\t\t\tx: horizontal ? target : null,\r\n\t\t\t\ty: horizontal ? null : target\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\treturn null;\r\n}\r\n\r\nfunction computeCircularBoundary(source) {\r\n\tvar scale = source.el._scale;\r\n\tvar options = scale.options;\r\n\tvar length = scale.chart.data.labels.length;\r\n\tvar fill = source.fill;\r\n\tvar target = [];\r\n\tvar start, end, center, i, point;\r\n\r\n\tif (!length) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tstart = options.ticks.reverse ? scale.max : scale.min;\r\n\tend = options.ticks.reverse ? scale.min : scale.max;\r\n\tcenter = scale.getPointPositionForValue(0, start);\r\n\tfor (i = 0; i < length; ++i) {\r\n\t\tpoint = fill === 'start' || fill === 'end'\r\n\t\t\t? scale.getPointPositionForValue(i, fill === 'start' ? start : end)\r\n\t\t\t: scale.getBasePosition(i);\r\n\t\tif (options.gridLines.circular) {\r\n\t\t\tpoint.cx = center.x;\r\n\t\t\tpoint.cy = center.y;\r\n\t\t\tpoint.angle = scale.getIndexAngle(i) - Math.PI / 2;\r\n\t\t}\r\n\t\ttarget.push(point);\r\n\t}\r\n\treturn target;\r\n}\r\n\r\nfunction computeBoundary(source) {\r\n\tvar scale = source.el._scale || {};\r\n\r\n\tif (scale.getPointPositionForValue) {\r\n\t\treturn computeCircularBoundary(source);\r\n\t}\r\n\treturn computeLinearBoundary(source);\r\n}\r\n\r\nfunction resolveTarget(sources, index, propagate) {\r\n\tvar source = sources[index];\r\n\tvar fill = source.fill;\r\n\tvar visited = [index];\r\n\tvar target;\r\n\r\n\tif (!propagate) {\r\n\t\treturn fill;\r\n\t}\r\n\r\n\twhile (fill !== false && visited.indexOf(fill) === -1) {\r\n\t\tif (!isFinite(fill)) {\r\n\t\t\treturn fill;\r\n\t\t}\r\n\r\n\t\ttarget = sources[fill];\r\n\t\tif (!target) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (target.visible) {\r\n\t\t\treturn fill;\r\n\t\t}\r\n\r\n\t\tvisited.push(fill);\r\n\t\tfill = target.fill;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\nfunction createMapper(source) {\r\n\tvar fill = source.fill;\r\n\tvar type = 'dataset';\r\n\r\n\tif (fill === false) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (!isFinite(fill)) {\r\n\t\ttype = 'boundary';\r\n\t}\r\n\r\n\treturn mappers[type](source);\r\n}\r\n\r\nfunction isDrawable(point) {\r\n\treturn point && !point.skip;\r\n}\r\n\r\nfunction drawArea(ctx, curve0, curve1, len0, len1) {\r\n\tvar i, cx, cy, r;\r\n\r\n\tif (!len0 || !len1) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// building first area curve (normal)\r\n\tctx.moveTo(curve0[0].x, curve0[0].y);\r\n\tfor (i = 1; i < len0; ++i) {\r\n\t\thelpers$1.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);\r\n\t}\r\n\r\n\tif (curve1[0].angle !== undefined) {\r\n\t\tcx = curve1[0].cx;\r\n\t\tcy = curve1[0].cy;\r\n\t\tr = Math.sqrt(Math.pow(curve1[0].x - cx, 2) + Math.pow(curve1[0].y - cy, 2));\r\n\t\tfor (i = len1 - 1; i > 0; --i) {\r\n\t\t\tctx.arc(cx, cy, r, curve1[i].angle, curve1[i - 1].angle, true);\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\r\n\t// joining the two area curves\r\n\tctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);\r\n\r\n\t// building opposite area curve (reverse)\r\n\tfor (i = len1 - 1; i > 0; --i) {\r\n\t\thelpers$1.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);\r\n\t}\r\n}\r\n\r\nfunction doFill(ctx, points, mapper, view, color, loop) {\r\n\tvar count = points.length;\r\n\tvar span = view.spanGaps;\r\n\tvar curve0 = [];\r\n\tvar curve1 = [];\r\n\tvar len0 = 0;\r\n\tvar len1 = 0;\r\n\tvar i, ilen, index, p0, p1, d0, d1, loopOffset;\r\n\r\n\tctx.beginPath();\r\n\r\n\tfor (i = 0, ilen = count; i < ilen; ++i) {\r\n\t\tindex = i % count;\r\n\t\tp0 = points[index]._view;\r\n\t\tp1 = mapper(p0, index, view);\r\n\t\td0 = isDrawable(p0);\r\n\t\td1 = isDrawable(p1);\r\n\r\n\t\tif (loop && loopOffset === undefined && d0) {\r\n\t\t\tloopOffset = i + 1;\r\n\t\t\tilen = count + loopOffset;\r\n\t\t}\r\n\r\n\t\tif (d0 && d1) {\r\n\t\t\tlen0 = curve0.push(p0);\r\n\t\t\tlen1 = curve1.push(p1);\r\n\t\t} else if (len0 && len1) {\r\n\t\t\tif (!span) {\r\n\t\t\t\tdrawArea(ctx, curve0, curve1, len0, len1);\r\n\t\t\t\tlen0 = len1 = 0;\r\n\t\t\t\tcurve0 = [];\r\n\t\t\t\tcurve1 = [];\r\n\t\t\t} else {\r\n\t\t\t\tif (d0) {\r\n\t\t\t\t\tcurve0.push(p0);\r\n\t\t\t\t}\r\n\t\t\t\tif (d1) {\r\n\t\t\t\t\tcurve1.push(p1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdrawArea(ctx, curve0, curve1, len0, len1);\r\n\r\n\tctx.closePath();\r\n\tctx.fillStyle = color;\r\n\tctx.fill();\r\n}\r\n\r\nvar plugin_filler = {\r\n\tid: 'filler',\r\n\r\n\tafterDatasetsUpdate: function(chart, options) {\r\n\t\tvar count = (chart.data.datasets || []).length;\r\n\t\tvar propagate = options.propagate;\r\n\t\tvar sources = [];\r\n\t\tvar meta, i, el, source;\r\n\r\n\t\tfor (i = 0; i < count; ++i) {\r\n\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\tel = meta.dataset;\r\n\t\t\tsource = null;\r\n\r\n\t\t\tif (el && el._model && el instanceof elements.Line) {\r\n\t\t\t\tsource = {\r\n\t\t\t\t\tvisible: chart.isDatasetVisible(i),\r\n\t\t\t\t\tfill: decodeFill(el, i, count),\r\n\t\t\t\t\tchart: chart,\r\n\t\t\t\t\tel: el\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tmeta.$filler = source;\r\n\t\t\tsources.push(source);\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < count; ++i) {\r\n\t\t\tsource = sources[i];\r\n\t\t\tif (!source) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tsource.fill = resolveTarget(sources, i, propagate);\r\n\t\t\tsource.boundary = computeBoundary(source);\r\n\t\t\tsource.mapper = createMapper(source);\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeDatasetsDraw: function(chart) {\r\n\t\tvar metasets = chart._getSortedVisibleDatasetMetas();\r\n\t\tvar ctx = chart.ctx;\r\n\t\tvar meta, i, el, view, points, mapper, color;\r\n\r\n\t\tfor (i = metasets.length - 1; i >= 0; --i) {\r\n\t\t\tmeta = metasets[i].$filler;\r\n\r\n\t\t\tif (!meta || !meta.visible) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tel = meta.el;\r\n\t\t\tview = el._view;\r\n\t\t\tpoints = el._children || [];\r\n\t\t\tmapper = meta.mapper;\r\n\t\t\tcolor = view.backgroundColor || core_defaults.global.defaultColor;\r\n\r\n\t\t\tif (mapper && color && points.length) {\r\n\t\t\t\thelpers$1.canvas.clipArea(ctx, chart.chartArea);\r\n\t\t\t\tdoFill(ctx, points, mapper, view, color, el._loop);\r\n\t\t\t\thelpers$1.canvas.unclipArea(ctx);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\n\nvar getRtlHelper$1 = helpers$1.rtl.getRtlAdapter;\r\nvar noop$1 = helpers$1.noop;\r\nvar valueOrDefault$e = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('global', {\r\n\tlegend: {\r\n\t\tdisplay: true,\r\n\t\tposition: 'top',\r\n\t\talign: 'center',\r\n\t\tfullWidth: true,\r\n\t\treverse: false,\r\n\t\tweight: 1000,\r\n\r\n\t\t// a callback that will handle\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.datasetIndex;\r\n\t\t\tvar ci = this.chart;\r\n\t\t\tvar meta = ci.getDatasetMeta(index);\r\n\r\n\t\t\t// See controller.isDatasetVisible comment\r\n\t\t\tmeta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;\r\n\r\n\t\t\t// We hid a dataset ... rerender the chart\r\n\t\t\tci.update();\r\n\t\t},\r\n\r\n\t\tonHover: null,\r\n\t\tonLeave: null,\r\n\r\n\t\tlabels: {\r\n\t\t\tboxWidth: 40,\r\n\t\t\tpadding: 10,\r\n\t\t\t// Generates labels shown in the legend\r\n\t\t\t// Valid properties to return:\r\n\t\t\t// text : text to display\r\n\t\t\t// fillStyle : fill of coloured box\r\n\t\t\t// strokeStyle: stroke of coloured box\r\n\t\t\t// hidden : if this legend item refers to a hidden item\r\n\t\t\t// lineCap : cap style for line\r\n\t\t\t// lineDash\r\n\t\t\t// lineDashOffset :\r\n\t\t\t// lineJoin :\r\n\t\t\t// lineWidth :\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar datasets = chart.data.datasets;\r\n\t\t\t\tvar options = chart.options.legend || {};\r\n\t\t\t\tvar usePointStyle = options.labels && options.labels.usePointStyle;\r\n\r\n\t\t\t\treturn chart._getSortedDatasetMetas().map(function(meta) {\r\n\t\t\t\t\tvar style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttext: datasets[meta.index].label,\r\n\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\thidden: !chart.isDatasetVisible(meta.index),\r\n\t\t\t\t\t\tlineCap: style.borderCapStyle,\r\n\t\t\t\t\t\tlineDash: style.borderDash,\r\n\t\t\t\t\t\tlineDashOffset: style.borderDashOffset,\r\n\t\t\t\t\t\tlineJoin: style.borderJoinStyle,\r\n\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\tpointStyle: style.pointStyle,\r\n\t\t\t\t\t\trotation: style.rotation,\r\n\r\n\t\t\t\t\t\t// Below is extra data used for toggling the datasets\r\n\t\t\t\t\t\tdatasetIndex: meta.index\r\n\t\t\t\t\t};\r\n\t\t\t\t}, this);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\r\n\t\tfor (i = 0, ilen = datasets.length; i < ilen; i++) {\r\n\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\tlistItemSpan.style.backgroundColor = datasets[i].backgroundColor;\r\n\t\t\tif (datasets[i].label) {\r\n\t\t\t\tlistItem.appendChild(document.createTextNode(datasets[i].label));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t}\r\n});\r\n\r\n/**\r\n * Helper function to get the box width based on the usePointStyle option\r\n * @param {object} labelopts - the label options on the legend\r\n * @param {number} fontSize - the label font size\r\n * @return {number} width of the color box area\r\n */\r\nfunction getBoxWidth(labelOpts, fontSize) {\r\n\treturn labelOpts.usePointStyle && labelOpts.boxWidth > fontSize ?\r\n\t\tfontSize :\r\n\t\tlabelOpts.boxWidth;\r\n}\r\n\r\n/**\r\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\r\n */\r\nvar Legend = core_element.extend({\r\n\r\n\tinitialize: function(config) {\r\n\t\tvar me = this;\r\n\t\thelpers$1.extend(me, config);\r\n\r\n\t\t// Contains hit boxes for each dataset (in dataset order)\r\n\t\tme.legendHitBoxes = [];\r\n\r\n\t\t/**\r\n \t\t * @private\r\n \t\t */\r\n\t\tme._hoveredItem = null;\r\n\r\n\t\t// Are we in doughnut mode which has a different data type\r\n\t\tme.doughnutMode = false;\r\n\t},\r\n\r\n\t// These methods are ordered by lifecycle. Utilities then follow.\r\n\t// Any function defined here is inherited by all legend types.\r\n\t// Any function can be extended by the legend type\r\n\r\n\tbeforeUpdate: noop$1,\r\n\tupdate: function(maxWidth, maxHeight, margins) {\r\n\t\tvar me = this;\r\n\r\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\r\n\t\tme.beforeUpdate();\r\n\r\n\t\t// Absorb the master measurements\r\n\t\tme.maxWidth = maxWidth;\r\n\t\tme.maxHeight = maxHeight;\r\n\t\tme.margins = margins;\r\n\r\n\t\t// Dimensions\r\n\t\tme.beforeSetDimensions();\r\n\t\tme.setDimensions();\r\n\t\tme.afterSetDimensions();\r\n\t\t// Labels\r\n\t\tme.beforeBuildLabels();\r\n\t\tme.buildLabels();\r\n\t\tme.afterBuildLabels();\r\n\r\n\t\t// Fit\r\n\t\tme.beforeFit();\r\n\t\tme.fit();\r\n\t\tme.afterFit();\r\n\t\t//\r\n\t\tme.afterUpdate();\r\n\r\n\t\treturn me.minSize;\r\n\t},\r\n\tafterUpdate: noop$1,\r\n\r\n\t//\r\n\r\n\tbeforeSetDimensions: noop$1,\r\n\tsetDimensions: function() {\r\n\t\tvar me = this;\r\n\t\t// Set the unconstrained dimension before label rotation\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.width = me.maxWidth;\r\n\t\t\tme.left = 0;\r\n\t\t\tme.right = me.width;\r\n\t\t} else {\r\n\t\t\tme.height = me.maxHeight;\r\n\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.top = 0;\r\n\t\t\tme.bottom = me.height;\r\n\t\t}\r\n\r\n\t\t// Reset padding\r\n\t\tme.paddingLeft = 0;\r\n\t\tme.paddingTop = 0;\r\n\t\tme.paddingRight = 0;\r\n\t\tme.paddingBottom = 0;\r\n\r\n\t\t// Reset minSize\r\n\t\tme.minSize = {\r\n\t\t\twidth: 0,\r\n\t\t\theight: 0\r\n\t\t};\r\n\t},\r\n\tafterSetDimensions: noop$1,\r\n\r\n\t//\r\n\r\n\tbeforeBuildLabels: noop$1,\r\n\tbuildLabels: function() {\r\n\t\tvar me = this;\r\n\t\tvar labelOpts = me.options.labels || {};\r\n\t\tvar legendItems = helpers$1.callback(labelOpts.generateLabels, [me.chart], me) || [];\r\n\r\n\t\tif (labelOpts.filter) {\r\n\t\t\tlegendItems = legendItems.filter(function(item) {\r\n\t\t\t\treturn labelOpts.filter(item, me.chart.data);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (me.options.reverse) {\r\n\t\t\tlegendItems.reverse();\r\n\t\t}\r\n\r\n\t\tme.legendItems = legendItems;\r\n\t},\r\n\tafterBuildLabels: noop$1,\r\n\r\n\t//\r\n\r\n\tbeforeFit: noop$1,\r\n\tfit: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar labelOpts = opts.labels;\r\n\t\tvar display = opts.display;\r\n\r\n\t\tvar ctx = me.ctx;\r\n\r\n\t\tvar labelFont = helpers$1.options._parseFont(labelOpts);\r\n\t\tvar fontSize = labelFont.size;\r\n\r\n\t\t// Reset hit boxes\r\n\t\tvar hitboxes = me.legendHitBoxes = [];\r\n\r\n\t\tvar minSize = me.minSize;\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\r\n\t\tif (isHorizontal) {\r\n\t\t\tminSize.width = me.maxWidth; // fill all the width\r\n\t\t\tminSize.height = display ? 10 : 0;\r\n\t\t} else {\r\n\t\t\tminSize.width = display ? 10 : 0;\r\n\t\t\tminSize.height = me.maxHeight; // fill all the height\r\n\t\t}\r\n\r\n\t\t// Increase sizes here\r\n\t\tif (!display) {\r\n\t\t\tme.width = minSize.width = me.height = minSize.height = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tctx.font = labelFont.string;\r\n\r\n\t\tif (isHorizontal) {\r\n\t\t\t// Labels\r\n\r\n\t\t\t// Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\r\n\t\t\tvar lineWidths = me.lineWidths = [0];\r\n\t\t\tvar totalHeight = 0;\r\n\r\n\t\t\tctx.textAlign = 'left';\r\n\t\t\tctx.textBaseline = 'middle';\r\n\r\n\t\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\r\n\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\r\n\t\t\t\tvar width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\r\n\r\n\t\t\t\tif (i === 0 || lineWidths[lineWidths.length - 1] + width + 2 * labelOpts.padding > minSize.width) {\r\n\t\t\t\t\ttotalHeight += fontSize + labelOpts.padding;\r\n\t\t\t\t\tlineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\r\n\t\t\t\thitboxes[i] = {\r\n\t\t\t\t\tleft: 0,\r\n\t\t\t\t\ttop: 0,\r\n\t\t\t\t\twidth: width,\r\n\t\t\t\t\theight: fontSize\r\n\t\t\t\t};\r\n\r\n\t\t\t\tlineWidths[lineWidths.length - 1] += width + labelOpts.padding;\r\n\t\t\t});\r\n\r\n\t\t\tminSize.height += totalHeight;\r\n\r\n\t\t} else {\r\n\t\t\tvar vPadding = labelOpts.padding;\r\n\t\t\tvar columnWidths = me.columnWidths = [];\r\n\t\t\tvar columnHeights = me.columnHeights = [];\r\n\t\t\tvar totalWidth = labelOpts.padding;\r\n\t\t\tvar currentColWidth = 0;\r\n\t\t\tvar currentColHeight = 0;\r\n\r\n\t\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\r\n\t\t\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\r\n\t\t\t\tvar itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\r\n\r\n\t\t\t\t// If too tall, go to new column\r\n\t\t\t\tif (i > 0 && currentColHeight + fontSize + 2 * vPadding > minSize.height) {\r\n\t\t\t\t\ttotalWidth += currentColWidth + labelOpts.padding;\r\n\t\t\t\t\tcolumnWidths.push(currentColWidth); // previous column width\r\n\t\t\t\t\tcolumnHeights.push(currentColHeight);\r\n\t\t\t\t\tcurrentColWidth = 0;\r\n\t\t\t\t\tcurrentColHeight = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Get max width\r\n\t\t\t\tcurrentColWidth = Math.max(currentColWidth, itemWidth);\r\n\t\t\t\tcurrentColHeight += fontSize + vPadding;\r\n\r\n\t\t\t\t// Store the hitbox width and height here. Final position will be updated in `draw`\r\n\t\t\t\thitboxes[i] = {\r\n\t\t\t\t\tleft: 0,\r\n\t\t\t\t\ttop: 0,\r\n\t\t\t\t\twidth: itemWidth,\r\n\t\t\t\t\theight: fontSize\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\ttotalWidth += currentColWidth;\r\n\t\t\tcolumnWidths.push(currentColWidth);\r\n\t\t\tcolumnHeights.push(currentColHeight);\r\n\t\t\tminSize.width += totalWidth;\r\n\t\t}\r\n\r\n\t\tme.width = minSize.width;\r\n\t\tme.height = minSize.height;\r\n\t},\r\n\tafterFit: noop$1,\r\n\r\n\t// Shared Methods\r\n\tisHorizontal: function() {\r\n\t\treturn this.options.position === 'top' || this.options.position === 'bottom';\r\n\t},\r\n\r\n\t// Actually draw the legend on the canvas\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar labelOpts = opts.labels;\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar defaultColor = globalDefaults.defaultColor;\r\n\t\tvar lineDefault = globalDefaults.elements.line;\r\n\t\tvar legendHeight = me.height;\r\n\t\tvar columnHeights = me.columnHeights;\r\n\t\tvar legendWidth = me.width;\r\n\t\tvar lineWidths = me.lineWidths;\r\n\r\n\t\tif (!opts.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar rtlHelper = getRtlHelper$1(opts.rtl, me.left, me.minSize.width);\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar fontColor = valueOrDefault$e(labelOpts.fontColor, globalDefaults.defaultFontColor);\r\n\t\tvar labelFont = helpers$1.options._parseFont(labelOpts);\r\n\t\tvar fontSize = labelFont.size;\r\n\t\tvar cursor;\r\n\r\n\t\t// Canvas setup\r\n\t\tctx.textAlign = rtlHelper.textAlign('left');\r\n\t\tctx.textBaseline = 'middle';\r\n\t\tctx.lineWidth = 0.5;\r\n\t\tctx.strokeStyle = fontColor; // for strikethrough effect\r\n\t\tctx.fillStyle = fontColor; // render in correct colour\r\n\t\tctx.font = labelFont.string;\r\n\r\n\t\tvar boxWidth = getBoxWidth(labelOpts, fontSize);\r\n\t\tvar hitboxes = me.legendHitBoxes;\r\n\r\n\t\t// current position\r\n\t\tvar drawLegendBox = function(x, y, legendItem) {\r\n\t\t\tif (isNaN(boxWidth) || boxWidth <= 0) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Set the ctx for the box\r\n\t\t\tctx.save();\r\n\r\n\t\t\tvar lineWidth = valueOrDefault$e(legendItem.lineWidth, lineDefault.borderWidth);\r\n\t\t\tctx.fillStyle = valueOrDefault$e(legendItem.fillStyle, defaultColor);\r\n\t\t\tctx.lineCap = valueOrDefault$e(legendItem.lineCap, lineDefault.borderCapStyle);\r\n\t\t\tctx.lineDashOffset = valueOrDefault$e(legendItem.lineDashOffset, lineDefault.borderDashOffset);\r\n\t\t\tctx.lineJoin = valueOrDefault$e(legendItem.lineJoin, lineDefault.borderJoinStyle);\r\n\t\t\tctx.lineWidth = lineWidth;\r\n\t\t\tctx.strokeStyle = valueOrDefault$e(legendItem.strokeStyle, defaultColor);\r\n\r\n\t\t\tif (ctx.setLineDash) {\r\n\t\t\t\t// IE 9 and 10 do not support line dash\r\n\t\t\t\tctx.setLineDash(valueOrDefault$e(legendItem.lineDash, lineDefault.borderDash));\r\n\t\t\t}\r\n\r\n\t\t\tif (labelOpts && labelOpts.usePointStyle) {\r\n\t\t\t\t// Recalculate x and y for drawPoint() because its expecting\r\n\t\t\t\t// x and y to be center of figure (instead of top left)\r\n\t\t\t\tvar radius = boxWidth * Math.SQRT2 / 2;\r\n\t\t\t\tvar centerX = rtlHelper.xPlus(x, boxWidth / 2);\r\n\t\t\t\tvar centerY = y + fontSize / 2;\r\n\r\n\t\t\t\t// Draw pointStyle as legend symbol\r\n\t\t\t\thelpers$1.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY, legendItem.rotation);\r\n\t\t\t} else {\r\n\t\t\t\t// Draw box as legend symbol\r\n\t\t\t\tctx.fillRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);\r\n\t\t\t\tif (lineWidth !== 0) {\r\n\t\t\t\t\tctx.strokeRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tctx.restore();\r\n\t\t};\r\n\r\n\t\tvar fillText = function(x, y, legendItem, textWidth) {\r\n\t\t\tvar halfFontSize = fontSize / 2;\r\n\t\t\tvar xLeft = rtlHelper.xPlus(x, boxWidth + halfFontSize);\r\n\t\t\tvar yMiddle = y + halfFontSize;\r\n\r\n\t\t\tctx.fillText(legendItem.text, xLeft, yMiddle);\r\n\r\n\t\t\tif (legendItem.hidden) {\r\n\t\t\t\t// Strikethrough the text if hidden\r\n\t\t\t\tctx.beginPath();\r\n\t\t\t\tctx.lineWidth = 2;\r\n\t\t\t\tctx.moveTo(xLeft, yMiddle);\r\n\t\t\t\tctx.lineTo(rtlHelper.xPlus(xLeft, textWidth), yMiddle);\r\n\t\t\t\tctx.stroke();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar alignmentOffset = function(dimension, blockSize) {\r\n\t\t\tswitch (opts.align) {\r\n\t\t\tcase 'start':\r\n\t\t\t\treturn labelOpts.padding;\r\n\t\t\tcase 'end':\r\n\t\t\t\treturn dimension - blockSize;\r\n\t\t\tdefault: // center\r\n\t\t\t\treturn (dimension - blockSize + labelOpts.padding) / 2;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Horizontal\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\tif (isHorizontal) {\r\n\t\t\tcursor = {\r\n\t\t\t\tx: me.left + alignmentOffset(legendWidth, lineWidths[0]),\r\n\t\t\t\ty: me.top + labelOpts.padding,\r\n\t\t\t\tline: 0\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tcursor = {\r\n\t\t\t\tx: me.left + labelOpts.padding,\r\n\t\t\t\ty: me.top + alignmentOffset(legendHeight, columnHeights[0]),\r\n\t\t\t\tline: 0\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\thelpers$1.rtl.overrideTextDirection(me.ctx, opts.textDirection);\r\n\r\n\t\tvar itemHeight = fontSize + labelOpts.padding;\r\n\t\thelpers$1.each(me.legendItems, function(legendItem, i) {\r\n\t\t\tvar textWidth = ctx.measureText(legendItem.text).width;\r\n\t\t\tvar width = boxWidth + (fontSize / 2) + textWidth;\r\n\t\t\tvar x = cursor.x;\r\n\t\t\tvar y = cursor.y;\r\n\r\n\t\t\trtlHelper.setWidth(me.minSize.width);\r\n\r\n\t\t\t// Use (me.left + me.minSize.width) and (me.top + me.minSize.height)\r\n\t\t\t// instead of me.right and me.bottom because me.width and me.height\r\n\t\t\t// may have been changed since me.minSize was calculated\r\n\t\t\tif (isHorizontal) {\r\n\t\t\t\tif (i > 0 && x + width + labelOpts.padding > me.left + me.minSize.width) {\r\n\t\t\t\t\ty = cursor.y += itemHeight;\r\n\t\t\t\t\tcursor.line++;\r\n\t\t\t\t\tx = cursor.x = me.left + alignmentOffset(legendWidth, lineWidths[cursor.line]);\r\n\t\t\t\t}\r\n\t\t\t} else if (i > 0 && y + itemHeight > me.top + me.minSize.height) {\r\n\t\t\t\tx = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;\r\n\t\t\t\tcursor.line++;\r\n\t\t\t\ty = cursor.y = me.top + alignmentOffset(legendHeight, columnHeights[cursor.line]);\r\n\t\t\t}\r\n\r\n\t\t\tvar realX = rtlHelper.x(x);\r\n\r\n\t\t\tdrawLegendBox(realX, y, legendItem);\r\n\r\n\t\t\thitboxes[i].left = rtlHelper.leftForLtr(realX, hitboxes[i].width);\r\n\t\t\thitboxes[i].top = y;\r\n\r\n\t\t\t// Fill the actual label\r\n\t\t\tfillText(realX, y, legendItem, textWidth);\r\n\r\n\t\t\tif (isHorizontal) {\r\n\t\t\t\tcursor.x += width + labelOpts.padding;\r\n\t\t\t} else {\r\n\t\t\t\tcursor.y += itemHeight;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\thelpers$1.rtl.restoreTextDirection(me.ctx, opts.textDirection);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getLegendItemAt: function(x, y) {\r\n\t\tvar me = this;\r\n\t\tvar i, hitBox, lh;\r\n\r\n\t\tif (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {\r\n\t\t\t// See if we are touching one of the dataset boxes\r\n\t\t\tlh = me.legendHitBoxes;\r\n\t\t\tfor (i = 0; i < lh.length; ++i) {\r\n\t\t\t\thitBox = lh[i];\r\n\r\n\t\t\t\tif (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {\r\n\t\t\t\t\t// Touching an element\r\n\t\t\t\t\treturn me.legendItems[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\t/**\r\n\t * Handle an event\r\n\t * @private\r\n\t * @param {IEvent} event - The event to handle\r\n\t */\r\n\thandleEvent: function(e) {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar type = e.type === 'mouseup' ? 'click' : e.type;\r\n\t\tvar hoveredItem;\r\n\r\n\t\tif (type === 'mousemove') {\r\n\t\t\tif (!opts.onHover && !opts.onLeave) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} else if (type === 'click') {\r\n\t\t\tif (!opts.onClick) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Chart event already has relative position in it\r\n\t\thoveredItem = me._getLegendItemAt(e.x, e.y);\r\n\r\n\t\tif (type === 'click') {\r\n\t\t\tif (hoveredItem && opts.onClick) {\r\n\t\t\t\t// use e.native for backwards compatibility\r\n\t\t\t\topts.onClick.call(me, e.native, hoveredItem);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (opts.onLeave && hoveredItem !== me._hoveredItem) {\r\n\t\t\t\tif (me._hoveredItem) {\r\n\t\t\t\t\topts.onLeave.call(me, e.native, me._hoveredItem);\r\n\t\t\t\t}\r\n\t\t\t\tme._hoveredItem = hoveredItem;\r\n\t\t\t}\r\n\r\n\t\t\tif (opts.onHover && hoveredItem) {\r\n\t\t\t\t// use e.native for backwards compatibility\r\n\t\t\t\topts.onHover.call(me, e.native, hoveredItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction createNewLegendAndAttach(chart, legendOpts) {\r\n\tvar legend = new Legend({\r\n\t\tctx: chart.ctx,\r\n\t\toptions: legendOpts,\r\n\t\tchart: chart\r\n\t});\r\n\r\n\tcore_layouts.configure(chart, legend, legendOpts);\r\n\tcore_layouts.addBox(chart, legend);\r\n\tchart.legend = legend;\r\n}\r\n\r\nvar plugin_legend = {\r\n\tid: 'legend',\r\n\r\n\t/**\r\n\t * Backward compatibility: since 2.1.5, the legend is registered as a plugin, making\r\n\t * Chart.Legend obsolete. To avoid a breaking change, we export the Legend as part of\r\n\t * the plugin, which one will be re-exposed in the chart.js file.\r\n\t * https://github.com/chartjs/Chart.js/pull/2640\r\n\t * @private\r\n\t */\r\n\t_element: Legend,\r\n\r\n\tbeforeInit: function(chart) {\r\n\t\tvar legendOpts = chart.options.legend;\r\n\r\n\t\tif (legendOpts) {\r\n\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeUpdate: function(chart) {\r\n\t\tvar legendOpts = chart.options.legend;\r\n\t\tvar legend = chart.legend;\r\n\r\n\t\tif (legendOpts) {\r\n\t\t\thelpers$1.mergeIf(legendOpts, core_defaults.global.legend);\r\n\r\n\t\t\tif (legend) {\r\n\t\t\t\tcore_layouts.configure(chart, legend, legendOpts);\r\n\t\t\t\tlegend.options = legendOpts;\r\n\t\t\t} else {\r\n\t\t\t\tcreateNewLegendAndAttach(chart, legendOpts);\r\n\t\t\t}\r\n\t\t} else if (legend) {\r\n\t\t\tcore_layouts.removeBox(chart, legend);\r\n\t\t\tdelete chart.legend;\r\n\t\t}\r\n\t},\r\n\r\n\tafterEvent: function(chart, e) {\r\n\t\tvar legend = chart.legend;\r\n\t\tif (legend) {\r\n\t\t\tlegend.handleEvent(e);\r\n\t\t}\r\n\t}\r\n};\n\nvar noop$2 = helpers$1.noop;\r\n\r\ncore_defaults._set('global', {\r\n\ttitle: {\r\n\t\tdisplay: false,\r\n\t\tfontStyle: 'bold',\r\n\t\tfullWidth: true,\r\n\t\tpadding: 10,\r\n\t\tposition: 'top',\r\n\t\ttext: '',\r\n\t\tweight: 2000 // by default greater than legend (1000) to be above\r\n\t}\r\n});\r\n\r\n/**\r\n * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!\r\n */\r\nvar Title = core_element.extend({\r\n\tinitialize: function(config) {\r\n\t\tvar me = this;\r\n\t\thelpers$1.extend(me, config);\r\n\r\n\t\t// Contains hit boxes for each dataset (in dataset order)\r\n\t\tme.legendHitBoxes = [];\r\n\t},\r\n\r\n\t// These methods are ordered by lifecycle. Utilities then follow.\r\n\r\n\tbeforeUpdate: noop$2,\r\n\tupdate: function(maxWidth, maxHeight, margins) {\r\n\t\tvar me = this;\r\n\r\n\t\t// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\r\n\t\tme.beforeUpdate();\r\n\r\n\t\t// Absorb the master measurements\r\n\t\tme.maxWidth = maxWidth;\r\n\t\tme.maxHeight = maxHeight;\r\n\t\tme.margins = margins;\r\n\r\n\t\t// Dimensions\r\n\t\tme.beforeSetDimensions();\r\n\t\tme.setDimensions();\r\n\t\tme.afterSetDimensions();\r\n\t\t// Labels\r\n\t\tme.beforeBuildLabels();\r\n\t\tme.buildLabels();\r\n\t\tme.afterBuildLabels();\r\n\r\n\t\t// Fit\r\n\t\tme.beforeFit();\r\n\t\tme.fit();\r\n\t\tme.afterFit();\r\n\t\t//\r\n\t\tme.afterUpdate();\r\n\r\n\t\treturn me.minSize;\r\n\r\n\t},\r\n\tafterUpdate: noop$2,\r\n\r\n\t//\r\n\r\n\tbeforeSetDimensions: noop$2,\r\n\tsetDimensions: function() {\r\n\t\tvar me = this;\r\n\t\t// Set the unconstrained dimension before label rotation\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.width = me.maxWidth;\r\n\t\t\tme.left = 0;\r\n\t\t\tme.right = me.width;\r\n\t\t} else {\r\n\t\t\tme.height = me.maxHeight;\r\n\r\n\t\t\t// Reset position before calculating rotation\r\n\t\t\tme.top = 0;\r\n\t\t\tme.bottom = me.height;\r\n\t\t}\r\n\r\n\t\t// Reset padding\r\n\t\tme.paddingLeft = 0;\r\n\t\tme.paddingTop = 0;\r\n\t\tme.paddingRight = 0;\r\n\t\tme.paddingBottom = 0;\r\n\r\n\t\t// Reset minSize\r\n\t\tme.minSize = {\r\n\t\t\twidth: 0,\r\n\t\t\theight: 0\r\n\t\t};\r\n\t},\r\n\tafterSetDimensions: noop$2,\r\n\r\n\t//\r\n\r\n\tbeforeBuildLabels: noop$2,\r\n\tbuildLabels: noop$2,\r\n\tafterBuildLabels: noop$2,\r\n\r\n\t//\r\n\r\n\tbeforeFit: noop$2,\r\n\tfit: function() {\r\n\t\tvar me = this;\r\n\t\tvar opts = me.options;\r\n\t\tvar minSize = me.minSize = {};\r\n\t\tvar isHorizontal = me.isHorizontal();\r\n\t\tvar lineCount, textSize;\r\n\r\n\t\tif (!opts.display) {\r\n\t\t\tme.width = minSize.width = me.height = minSize.height = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlineCount = helpers$1.isArray(opts.text) ? opts.text.length : 1;\r\n\t\ttextSize = lineCount * helpers$1.options._parseFont(opts).lineHeight + opts.padding * 2;\r\n\r\n\t\tme.width = minSize.width = isHorizontal ? me.maxWidth : textSize;\r\n\t\tme.height = minSize.height = isHorizontal ? textSize : me.maxHeight;\r\n\t},\r\n\tafterFit: noop$2,\r\n\r\n\t// Shared Methods\r\n\tisHorizontal: function() {\r\n\t\tvar pos = this.options.position;\r\n\t\treturn pos === 'top' || pos === 'bottom';\r\n\t},\r\n\r\n\t// Actually draw the title block on the canvas\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar ctx = me.ctx;\r\n\t\tvar opts = me.options;\r\n\r\n\t\tif (!opts.display) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar fontOpts = helpers$1.options._parseFont(opts);\r\n\t\tvar lineHeight = fontOpts.lineHeight;\r\n\t\tvar offset = lineHeight / 2 + opts.padding;\r\n\t\tvar rotation = 0;\r\n\t\tvar top = me.top;\r\n\t\tvar left = me.left;\r\n\t\tvar bottom = me.bottom;\r\n\t\tvar right = me.right;\r\n\t\tvar maxWidth, titleX, titleY;\r\n\r\n\t\tctx.fillStyle = helpers$1.valueOrDefault(opts.fontColor, core_defaults.global.defaultFontColor); // render in correct colour\r\n\t\tctx.font = fontOpts.string;\r\n\r\n\t\t// Horizontal\r\n\t\tif (me.isHorizontal()) {\r\n\t\t\ttitleX = left + ((right - left) / 2); // midpoint of the width\r\n\t\t\ttitleY = top + offset;\r\n\t\t\tmaxWidth = right - left;\r\n\t\t} else {\r\n\t\t\ttitleX = opts.position === 'left' ? left + offset : right - offset;\r\n\t\t\ttitleY = top + ((bottom - top) / 2);\r\n\t\t\tmaxWidth = bottom - top;\r\n\t\t\trotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\t\tctx.translate(titleX, titleY);\r\n\t\tctx.rotate(rotation);\r\n\t\tctx.textAlign = 'center';\r\n\t\tctx.textBaseline = 'middle';\r\n\r\n\t\tvar text = opts.text;\r\n\t\tif (helpers$1.isArray(text)) {\r\n\t\t\tvar y = 0;\r\n\t\t\tfor (var i = 0; i < text.length; ++i) {\r\n\t\t\t\tctx.fillText(text[i], 0, y, maxWidth);\r\n\t\t\t\ty += lineHeight;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tctx.fillText(text, 0, 0, maxWidth);\r\n\t\t}\r\n\r\n\t\tctx.restore();\r\n\t}\r\n});\r\n\r\nfunction createNewTitleBlockAndAttach(chart, titleOpts) {\r\n\tvar title = new Title({\r\n\t\tctx: chart.ctx,\r\n\t\toptions: titleOpts,\r\n\t\tchart: chart\r\n\t});\r\n\r\n\tcore_layouts.configure(chart, title, titleOpts);\r\n\tcore_layouts.addBox(chart, title);\r\n\tchart.titleBlock = title;\r\n}\r\n\r\nvar plugin_title = {\r\n\tid: 'title',\r\n\r\n\t/**\r\n\t * Backward compatibility: since 2.1.5, the title is registered as a plugin, making\r\n\t * Chart.Title obsolete. To avoid a breaking change, we export the Title as part of\r\n\t * the plugin, which one will be re-exposed in the chart.js file.\r\n\t * https://github.com/chartjs/Chart.js/pull/2640\r\n\t * @private\r\n\t */\r\n\t_element: Title,\r\n\r\n\tbeforeInit: function(chart) {\r\n\t\tvar titleOpts = chart.options.title;\r\n\r\n\t\tif (titleOpts) {\r\n\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeUpdate: function(chart) {\r\n\t\tvar titleOpts = chart.options.title;\r\n\t\tvar titleBlock = chart.titleBlock;\r\n\r\n\t\tif (titleOpts) {\r\n\t\t\thelpers$1.mergeIf(titleOpts, core_defaults.global.title);\r\n\r\n\t\t\tif (titleBlock) {\r\n\t\t\t\tcore_layouts.configure(chart, titleBlock, titleOpts);\r\n\t\t\t\ttitleBlock.options = titleOpts;\r\n\t\t\t} else {\r\n\t\t\t\tcreateNewTitleBlockAndAttach(chart, titleOpts);\r\n\t\t\t}\r\n\t\t} else if (titleBlock) {\r\n\t\t\tcore_layouts.removeBox(chart, titleBlock);\r\n\t\t\tdelete chart.titleBlock;\r\n\t\t}\r\n\t}\r\n};\n\nvar plugins = {};\r\nvar filler = plugin_filler;\r\nvar legend = plugin_legend;\r\nvar title = plugin_title;\nplugins.filler = filler;\nplugins.legend = legend;\nplugins.title = title;\n\n/**\r\n * @namespace Chart\r\n */\r\n\r\n\r\ncore_controller.helpers = helpers$1;\r\n\r\n// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!\r\ncore_helpers();\r\n\r\ncore_controller._adapters = core_adapters;\r\ncore_controller.Animation = core_animation;\r\ncore_controller.animationService = core_animations;\r\ncore_controller.controllers = controllers;\r\ncore_controller.DatasetController = core_datasetController;\r\ncore_controller.defaults = core_defaults;\r\ncore_controller.Element = core_element;\r\ncore_controller.elements = elements;\r\ncore_controller.Interaction = core_interaction;\r\ncore_controller.layouts = core_layouts;\r\ncore_controller.platform = platform;\r\ncore_controller.plugins = core_plugins;\r\ncore_controller.Scale = core_scale;\r\ncore_controller.scaleService = core_scaleService;\r\ncore_controller.Ticks = core_ticks;\r\ncore_controller.Tooltip = core_tooltip;\r\n\r\n// Register built-in scales\r\n\r\ncore_controller.helpers.each(scales, function(scale, type) {\r\n\tcore_controller.scaleService.registerScaleType(type, scale, scale._defaults);\r\n});\r\n\r\n// Load to register built-in adapters (as side effects)\r\n\r\n\r\n// Loading built-in plugins\r\n\r\nfor (var k in plugins) {\r\n\tif (plugins.hasOwnProperty(k)) {\r\n\t\tcore_controller.plugins.register(plugins[k]);\r\n\t}\r\n}\r\n\r\ncore_controller.platform.initialize();\r\n\r\nvar src = core_controller;\r\nif (typeof window !== 'undefined') {\r\n\twindow.Chart = core_controller;\r\n}\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore\r\n * @namespace Chart.Chart\r\n * @deprecated since version 2.8.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.Chart = core_controller;\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore\r\n * @namespace Chart.Legend\r\n * @deprecated since version 2.1.5\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.Legend = plugins.legend._element;\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore\r\n * @namespace Chart.Title\r\n * @deprecated since version 2.1.5\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.Title = plugins.title._element;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.plugins instead\r\n * @namespace Chart.pluginService\r\n * @deprecated since version 2.1.5\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.pluginService = core_controller.plugins;\r\n\r\n/**\r\n * Provided for backward compatibility, inheriting from Chart.PlugingBase has no\r\n * effect, instead simply create/register plugins via plain JavaScript objects.\r\n * @interface Chart.PluginBase\r\n * @deprecated since version 2.5.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.PluginBase = core_controller.Element.extend({});\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas instead.\r\n * @namespace Chart.canvasHelpers\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.canvasHelpers = core_controller.helpers.canvas;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.layouts instead.\r\n * @namespace Chart.layoutService\r\n * @deprecated since version 2.7.3\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.layoutService = core_controller.layouts;\r\n\r\n/**\r\n * Provided for backward compatibility, not available anymore.\r\n * @namespace Chart.LinearScaleBase\r\n * @deprecated since version 2.8\r\n * @todo remove at version 3\r\n * @private\r\n */\r\ncore_controller.LinearScaleBase = scale_linearbase;\r\n\r\n/**\r\n * Provided for backward compatibility, instead we should create a new Chart\r\n * by setting the type in the config (`new Chart(id, {type: '{chart-type}'}`).\r\n * @deprecated since version 2.8.0\r\n * @todo remove at version 3\r\n */\r\ncore_controller.helpers.each(\r\n\t[\r\n\t\t'Bar',\r\n\t\t'Bubble',\r\n\t\t'Doughnut',\r\n\t\t'Line',\r\n\t\t'PolarArea',\r\n\t\t'Radar',\r\n\t\t'Scatter'\r\n\t],\r\n\tfunction(klass) {\r\n\t\tcore_controller[klass] = function(ctx, cfg) {\r\n\t\t\treturn new core_controller(ctx, core_controller.helpers.merge(cfg || {}, {\r\n\t\t\t\ttype: klass.charAt(0).toLowerCase() + klass.slice(1)\r\n\t\t\t}));\r\n\t\t};\r\n\t}\r\n);\n\nreturn src;\n\n})));\n\n\n//# sourceURL=webpack:///./node_modules/chart.js/dist/Chart.js?");
/***/ }),
/***/ "./node_modules/codemirror/addon/hint/show-hint.css":
/*!**********************************************************!*\
!*** ./node_modules/codemirror/addon/hint/show-hint.css ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../../css-loader!./show-hint.css */ \"./node_modules/css-loader/index.js!./node_modules/codemirror/addon/hint/show-hint.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../../style-loader/addStyles.js */ \"./node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/hint/show-hint.css?");
/***/ }),
/***/ "./node_modules/codemirror/addon/hint/show-hint.js":
/*!*********************************************************!*\
!*** ./node_modules/codemirror/addon/hint/show-hint.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// declare global: DOMRect\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n if (this.options.updateOnCursorActivity) {\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n if (this.options.updateOnCursorActivity) {\n this.cm.off(\"cursorActivity\", this.activityFunc);\n }\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i], self = this;\n this.cm.operation(function() {\n if (completion.hint)\n completion.hint(self.cm, data, completion);\n else\n self.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n self.cm.scrollIntoView();\n });\n if (this.options.closeOnPick) {\n this.close();\n }\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var identStart = this.startPos;\n if(this.data) {\n identStart = this.data.from;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < identStart.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var container = completion.options.container || ownerDocument.body;\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n var offsetLeft = 0, offsetTop = 0;\n if (container !== ownerDocument.body) {\n // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n var offsetParent = isContainerPositioned ? container : container.offsetParent;\n var offsetParentPosition = offsetParent.getBoundingClientRect();\n var bodyPosition = ownerDocument.body.getBoundingClientRect();\n offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n }\n hints.style.left = (left - offsetLeft) + \"px\";\n hints.style.top = (top - offsetTop) + \"px\";\n\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n container.appendChild(hints);\n\n var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();\n var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;\n\n // Compute in the timeout to avoid reflow on init\n var startScroll;\n setTimeout(function() { startScroll = cm.getScrollInfo(); });\n\n var overlapY = box.bottom - winH;\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height - offsetTop) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top - offsetTop) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left - offsetLeft) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (scrolls) overlapX += cm.display.nativeBarWidth;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX - offsetLeft) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n if (!startScroll) startScroll = cm.getScrollInfo();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n // The first hint doesn't need to be scrolled to on init\n var selectedHintRange = this.getSelectedHintRange();\n if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {\n this.scrollToActive();\n }\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n this.scrollToActive()\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n scrollToActive: function() {\n var selectedHintRange = this.getSelectedHintRange();\n var node1 = this.hints.childNodes[selectedHintRange.from];\n var node2 = this.hints.childNodes[selectedHintRange.to];\n var firstNode = this.hints.firstChild;\n if (node1.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;\n else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n },\n\n getSelectedHintRange: function() {\n var margin = this.completion.options.scrollMargin || 0;\n return {\n from: Math.max(0, this.selectedHint - margin),\n to: Math.min(this.data.list.length - 1, this.selectedHint + margin),\n };\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnPick: true,\n closeOnUnfocus: true,\n updateOnCursorActivity: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null,\n paddingForScrollbar: true,\n moveOnOverlap: true,\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/hint/show-hint.js?");
/***/ }),
/***/ "./node_modules/codemirror/addon/lint/lint.css":
/*!*****************************************************!*\
!*** ./node_modules/codemirror/addon/lint/lint.css ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../../css-loader!./lint.css */ \"./node_modules/css-loader/index.js!./node_modules/codemirror/addon/lint/lint.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../../style-loader/addStyles.js */ \"./node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/lint/lint.css?");
/***/ }),
/***/ "./node_modules/codemirror/addon/lint/lint.js":
/*!****************************************************!*\
!*** ./node_modules/codemirror/addon/lint/lint.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n \"use strict\";\n var GUTTER_ID = \"CodeMirror-lint-markers\";\n\n function showTooltip(cm, e, content) {\n var tt = document.createElement(\"div\");\n tt.className = \"CodeMirror-lint-tooltip cm-s-\" + cm.options.theme;\n tt.appendChild(content.cloneNode(true));\n if (cm.state.lint.options.selfContain)\n cm.getWrapperElement().appendChild(tt);\n else\n document.body.appendChild(tt);\n\n function position(e) {\n if (!tt.parentNode) return CodeMirror.off(document, \"mousemove\", position);\n tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + \"px\";\n tt.style.left = (e.clientX + 5) + \"px\";\n }\n CodeMirror.on(document, \"mousemove\", position);\n position(e);\n if (tt.style.opacity != null) tt.style.opacity = 1;\n return tt;\n }\n function rm(elt) {\n if (elt.parentNode) elt.parentNode.removeChild(elt);\n }\n function hideTooltip(tt) {\n if (!tt.parentNode) return;\n if (tt.style.opacity == null) rm(tt);\n tt.style.opacity = 0;\n setTimeout(function() { rm(tt); }, 600);\n }\n\n function showTooltipFor(cm, e, content, node) {\n var tooltip = showTooltip(cm, e, content);\n function hide() {\n CodeMirror.off(node, \"mouseout\", hide);\n if (tooltip) { hideTooltip(tooltip); tooltip = null; }\n }\n var poll = setInterval(function() {\n if (tooltip) for (var n = node;; n = n.parentNode) {\n if (n && n.nodeType == 11) n = n.host;\n if (n == document.body) return;\n if (!n) { hide(); break; }\n }\n if (!tooltip) return clearInterval(poll);\n }, 400);\n CodeMirror.on(node, \"mouseout\", hide);\n }\n\n function LintState(cm, options, hasGutter) {\n this.marked = [];\n this.options = options;\n this.timeout = null;\n this.hasGutter = hasGutter;\n this.onMouseOver = function(e) { onMouseOver(cm, e); };\n this.waitingFor = 0\n }\n\n function parseOptions(_cm, options) {\n if (options instanceof Function) return {getAnnotations: options};\n if (!options || options === true) options = {};\n return options;\n }\n\n function clearMarks(cm) {\n var state = cm.state.lint;\n if (state.hasGutter) cm.clearGutter(GUTTER_ID);\n for (var i = 0; i < state.marked.length; ++i)\n state.marked[i].clear();\n state.marked.length = 0;\n }\n\n function makeMarker(cm, labels, severity, multiple, tooltips) {\n var marker = document.createElement(\"div\"), inner = marker;\n marker.className = \"CodeMirror-lint-marker CodeMirror-lint-marker-\" + severity;\n if (multiple) {\n inner = marker.appendChild(document.createElement(\"div\"));\n inner.className = \"CodeMirror-lint-marker CodeMirror-lint-marker-multiple\";\n }\n\n if (tooltips != false) CodeMirror.on(inner, \"mouseover\", function(e) {\n showTooltipFor(cm, e, labels, inner);\n });\n\n return marker;\n }\n\n function getMaxSeverity(a, b) {\n if (a == \"error\") return a;\n else return b;\n }\n\n function groupByLine(annotations) {\n var lines = [];\n for (var i = 0; i < annotations.length; ++i) {\n var ann = annotations[i], line = ann.from.line;\n (lines[line] || (lines[line] = [])).push(ann);\n }\n return lines;\n }\n\n function annotationTooltip(ann) {\n var severity = ann.severity;\n if (!severity) severity = \"error\";\n var tip = document.createElement(\"div\");\n tip.className = \"CodeMirror-lint-message CodeMirror-lint-message-\" + severity;\n if (typeof ann.messageHTML != 'undefined') {\n tip.innerHTML = ann.messageHTML;\n } else {\n tip.appendChild(document.createTextNode(ann.message));\n }\n return tip;\n }\n\n function lintAsync(cm, getAnnotations, passOptions) {\n var state = cm.state.lint\n var id = ++state.waitingFor\n function abort() {\n id = -1\n cm.off(\"change\", abort)\n }\n cm.on(\"change\", abort)\n getAnnotations(cm.getValue(), function(annotations, arg2) {\n cm.off(\"change\", abort)\n if (state.waitingFor != id) return\n if (arg2 && annotations instanceof CodeMirror) annotations = arg2\n cm.operation(function() {updateLinting(cm, annotations)})\n }, passOptions, cm);\n }\n\n function startLinting(cm) {\n var state = cm.state.lint, options = state.options;\n /*\n * Passing rules in `options` property prevents JSHint (and other linters) from complaining\n * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.\n */\n var passOptions = options.options || options;\n var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), \"lint\");\n if (!getAnnotations) return;\n if (options.async || getAnnotations.async) {\n lintAsync(cm, getAnnotations, passOptions)\n } else {\n var annotations = getAnnotations(cm.getValue(), passOptions, cm);\n if (!annotations) return;\n if (annotations.then) annotations.then(function(issues) {\n cm.operation(function() {updateLinting(cm, issues)})\n });\n else cm.operation(function() {updateLinting(cm, annotations)})\n }\n }\n\n function updateLinting(cm, annotationsNotSorted) {\n clearMarks(cm);\n var state = cm.state.lint, options = state.options;\n\n var annotations = groupByLine(annotationsNotSorted);\n\n for (var line = 0; line < annotations.length; ++line) {\n var anns = annotations[line];\n if (!anns) continue;\n\n // filter out duplicate messages\n var message = [];\n anns = anns.filter(function(item) { return message.indexOf(item.message) > -1 ? false : message.push(item.message) });\n\n var maxSeverity = null;\n var tipLabel = state.hasGutter && document.createDocumentFragment();\n\n for (var i = 0; i < anns.length; ++i) {\n var ann = anns[i];\n var severity = ann.severity;\n if (!severity) severity = \"error\";\n maxSeverity = getMaxSeverity(maxSeverity, severity);\n\n if (options.formatAnnotation) ann = options.formatAnnotation(ann);\n if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));\n\n if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {\n className: \"CodeMirror-lint-mark CodeMirror-lint-mark-\" + severity,\n __annotation: ann\n }));\n }\n // use original annotations[line] to show multiple messages\n if (state.hasGutter)\n cm.setGutterMarker(line, GUTTER_ID, makeMarker(cm, tipLabel, maxSeverity, annotations[line].length > 1,\n state.options.tooltips));\n }\n if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);\n }\n\n function onChange(cm) {\n var state = cm.state.lint;\n if (!state) return;\n clearTimeout(state.timeout);\n state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);\n }\n\n function popupTooltips(cm, annotations, e) {\n var target = e.target || e.srcElement;\n var tooltip = document.createDocumentFragment();\n for (var i = 0; i < annotations.length; i++) {\n var ann = annotations[i];\n tooltip.appendChild(annotationTooltip(ann));\n }\n showTooltipFor(cm, e, tooltip, target);\n }\n\n function onMouseOver(cm, e) {\n var target = e.target || e.srcElement;\n if (!/\\bCodeMirror-lint-mark-/.test(target.className)) return;\n var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;\n var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, \"client\"));\n\n var annotations = [];\n for (var i = 0; i < spans.length; ++i) {\n var ann = spans[i].__annotation;\n if (ann) annotations.push(ann);\n }\n if (annotations.length) popupTooltips(cm, annotations, e);\n }\n\n CodeMirror.defineOption(\"lint\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n clearMarks(cm);\n if (cm.state.lint.options.lintOnChange !== false)\n cm.off(\"change\", onChange);\n CodeMirror.off(cm.getWrapperElement(), \"mouseover\", cm.state.lint.onMouseOver);\n clearTimeout(cm.state.lint.timeout);\n delete cm.state.lint;\n }\n\n if (val) {\n var gutters = cm.getOption(\"gutters\"), hasLintGutter = false;\n for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;\n var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);\n if (state.options.lintOnChange !== false)\n cm.on(\"change\", onChange);\n if (state.options.tooltips != false && state.options.tooltips != \"gutter\")\n CodeMirror.on(cm.getWrapperElement(), \"mouseover\", state.onMouseOver);\n\n startLinting(cm);\n }\n });\n\n CodeMirror.defineExtension(\"performLint\", function() {\n if (this.state.lint) startLinting(this);\n });\n});\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/lint/lint.js?");
/***/ }),
/***/ "./node_modules/codemirror/lib/codemirror.css":
/*!****************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.css ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(/*! !../../css-loader!./codemirror.css */ \"./node_modules/css-loader/index.js!./node_modules/codemirror/lib/codemirror.css\");\nif(typeof content === 'string') content = [[module.i, content, '']];\n// add the styles to the DOM\nvar update = __webpack_require__(/*! ../../style-loader/addStyles.js */ \"./node_modules/style-loader/addStyles.js\")(content, {});\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {}\n\n//# sourceURL=webpack:///./node_modules/codemirror/lib/codemirror.css?");
/***/ }),
/***/ "./node_modules/codemirror/lib/codemirror.js":
/*!***************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range = document.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt();\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt() == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt() != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.61.0\";\n\n return CodeMirror;\n\n})));\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/lib/codemirror.js?");
/***/ }),
/***/ "./node_modules/codemirror/mode/javascript/javascript.js":
/*!***************************************************************!*\
!*** ./node_modules/codemirror/mode/javascript/javascript.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (true) // CommonJS\n mod(__webpack_require__(/*! ../../lib/codemirror */ \"./node_modules/codemirror/lib/codemirror.js\"));\n else {}\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(expression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n var top = state.cc[state.cc.length - 1]\n if (top == expression || top == expressionNoComma) state.cc.pop()\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/mode/javascript/javascript.js?");
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/codemirror/addon/hint/show-hint.css":
/*!************************************************************************************!*\
!*** ./node_modules/css-loader!./node_modules/codemirror/addon/hint/show-hint.css ***!
\************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("exports = module.exports = __webpack_require__(/*! ../../../css-loader/lib/css-base.js */ \"./node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \".CodeMirror-hints {\\n position: absolute;\\n z-index: 10;\\n overflow: hidden;\\n list-style: none;\\n\\n margin: 0;\\n padding: 2px;\\n\\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\\n border-radius: 3px;\\n border: 1px solid silver;\\n\\n background: white;\\n font-size: 90%;\\n font-family: monospace;\\n\\n max-height: 20em;\\n overflow-y: auto;\\n}\\n\\n.CodeMirror-hint {\\n margin: 0;\\n padding: 0 4px;\\n border-radius: 2px;\\n white-space: pre;\\n color: black;\\n cursor: pointer;\\n}\\n\\nli.CodeMirror-hint-active {\\n background: #08f;\\n color: white;\\n}\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/hint/show-hint.css?./node_modules/css-loader");
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/codemirror/addon/lint/lint.css":
/*!*******************************************************************************!*\
!*** ./node_modules/css-loader!./node_modules/codemirror/addon/lint/lint.css ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("exports = module.exports = __webpack_require__(/*! ../../../css-loader/lib/css-base.js */ \"./node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \"/* The lint marker gutter */\\n.CodeMirror-lint-markers {\\n width: 16px;\\n}\\n\\n.CodeMirror-lint-tooltip {\\n background-color: #ffd;\\n border: 1px solid black;\\n border-radius: 4px 4px 4px 4px;\\n color: black;\\n font-family: monospace;\\n font-size: 10pt;\\n overflow: hidden;\\n padding: 2px 5px;\\n position: fixed;\\n white-space: pre;\\n white-space: pre-wrap;\\n z-index: 100;\\n max-width: 600px;\\n opacity: 0;\\n transition: opacity .4s;\\n -moz-transition: opacity .4s;\\n -webkit-transition: opacity .4s;\\n -o-transition: opacity .4s;\\n -ms-transition: opacity .4s;\\n}\\n\\n.CodeMirror-lint-mark {\\n background-position: left bottom;\\n background-repeat: repeat-x;\\n}\\n\\n.CodeMirror-lint-mark-warning {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-mark-error {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\\\");\\n}\\n\\n.CodeMirror-lint-marker {\\n background-position: center center;\\n background-repeat: no-repeat;\\n cursor: pointer;\\n display: inline-block;\\n height: 16px;\\n width: 16px;\\n vertical-align: middle;\\n position: relative;\\n}\\n\\n.CodeMirror-lint-message {\\n padding-left: 18px;\\n background-position: top left;\\n background-repeat: no-repeat;\\n}\\n\\n.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\\\");\\n}\\n\\n.CodeMirror-lint-marker-multiple {\\n background-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\\\");\\n background-repeat: no-repeat;\\n background-position: right bottom;\\n width: 100%; height: 100%;\\n}\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/addon/lint/lint.css?./node_modules/css-loader");
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/codemirror/lib/codemirror.css":
/*!******************************************************************************!*\
!*** ./node_modules/css-loader!./node_modules/codemirror/lib/codemirror.css ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("exports = module.exports = __webpack_require__(/*! ../../css-loader/lib/css-base.js */ \"./node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.i, \"/* BASICS */\\n\\n.CodeMirror {\\n /* Set height, width, borders, and global font properties here */\\n font-family: monospace;\\n height: 300px;\\n color: black;\\n direction: ltr;\\n}\\n\\n/* PADDING */\\n\\n.CodeMirror-lines {\\n padding: 4px 0; /* Vertical padding around content */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n padding: 0 4px; /* Horizontal padding of content */\\n}\\n\\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n background-color: white; /* The little square between H and V scrollbars */\\n}\\n\\n/* GUTTER */\\n\\n.CodeMirror-gutters {\\n border-right: 1px solid #ddd;\\n background-color: #f7f7f7;\\n white-space: nowrap;\\n}\\n.CodeMirror-linenumbers {}\\n.CodeMirror-linenumber {\\n padding: 0 3px 0 5px;\\n min-width: 20px;\\n text-align: right;\\n color: #999;\\n white-space: nowrap;\\n}\\n\\n.CodeMirror-guttermarker { color: black; }\\n.CodeMirror-guttermarker-subtle { color: #999; }\\n\\n/* CURSOR */\\n\\n.CodeMirror-cursor {\\n border-left: 1px solid black;\\n border-right: none;\\n width: 0;\\n}\\n/* Shown when moving in bi-directional text */\\n.CodeMirror div.CodeMirror-secondarycursor {\\n border-left: 1px solid silver;\\n}\\n.cm-fat-cursor .CodeMirror-cursor {\\n width: auto;\\n border: 0 !important;\\n background: #7e7;\\n}\\n.cm-fat-cursor div.CodeMirror-cursors {\\n z-index: 1;\\n}\\n.cm-fat-cursor-mark {\\n background-color: rgba(20, 255, 20, 0.5);\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n}\\n.cm-animate-fat-cursor {\\n width: auto;\\n border: 0;\\n -webkit-animation: blink 1.06s steps(1) infinite;\\n -moz-animation: blink 1.06s steps(1) infinite;\\n animation: blink 1.06s steps(1) infinite;\\n background-color: #7e7;\\n}\\n@-moz-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@-webkit-keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n@keyframes blink {\\n 0% {}\\n 50% { background-color: transparent; }\\n 100% {}\\n}\\n\\n/* Can style cursor different in overwrite (non-insert) mode */\\n.CodeMirror-overwrite .CodeMirror-cursor {}\\n\\n.cm-tab { display: inline-block; text-decoration: inherit; }\\n\\n.CodeMirror-rulers {\\n position: absolute;\\n left: 0; right: 0; top: -50px; bottom: 0;\\n overflow: hidden;\\n}\\n.CodeMirror-ruler {\\n border-left: 1px solid #ccc;\\n top: 0; bottom: 0;\\n position: absolute;\\n}\\n\\n/* DEFAULT THEME */\\n\\n.cm-s-default .cm-header {color: blue;}\\n.cm-s-default .cm-quote {color: #090;}\\n.cm-negative {color: #d44;}\\n.cm-positive {color: #292;}\\n.cm-header, .cm-strong {font-weight: bold;}\\n.cm-em {font-style: italic;}\\n.cm-link {text-decoration: underline;}\\n.cm-strikethrough {text-decoration: line-through;}\\n\\n.cm-s-default .cm-keyword {color: #708;}\\n.cm-s-default .cm-atom {color: #219;}\\n.cm-s-default .cm-number {color: #164;}\\n.cm-s-default .cm-def {color: #00f;}\\n.cm-s-default .cm-variable,\\n.cm-s-default .cm-punctuation,\\n.cm-s-default .cm-property,\\n.cm-s-default .cm-operator {}\\n.cm-s-default .cm-variable-2 {color: #05a;}\\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\\n.cm-s-default .cm-comment {color: #a50;}\\n.cm-s-default .cm-string {color: #a11;}\\n.cm-s-default .cm-string-2 {color: #f50;}\\n.cm-s-default .cm-meta {color: #555;}\\n.cm-s-default .cm-qualifier {color: #555;}\\n.cm-s-default .cm-builtin {color: #30a;}\\n.cm-s-default .cm-bracket {color: #997;}\\n.cm-s-default .cm-tag {color: #170;}\\n.cm-s-default .cm-attribute {color: #00c;}\\n.cm-s-default .cm-hr {color: #999;}\\n.cm-s-default .cm-link {color: #00c;}\\n\\n.cm-s-default .cm-error {color: #f00;}\\n.cm-invalidchar {color: #f00;}\\n\\n.CodeMirror-composing { border-bottom: 2px solid; }\\n\\n/* Default styles for common addons */\\n\\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\\n.CodeMirror-activeline-background {background: #e8f2ff;}\\n\\n/* STOP */\\n\\n/* The rest of this file contains styles related to the mechanics of\\n the editor. You probably shouldn't touch them. */\\n\\n.CodeMirror {\\n position: relative;\\n overflow: hidden;\\n background: white;\\n}\\n\\n.CodeMirror-scroll {\\n overflow: scroll !important; /* Things will break if this is overridden */\\n /* 50px is the magic margin used to hide the element's real scrollbars */\\n /* See overflow: hidden in .CodeMirror */\\n margin-bottom: -50px; margin-right: -50px;\\n padding-bottom: 50px;\\n height: 100%;\\n outline: none; /* Prevent dragging from highlighting the element */\\n position: relative;\\n}\\n.CodeMirror-sizer {\\n position: relative;\\n border-right: 50px solid transparent;\\n}\\n\\n/* The fake, visible scrollbars. Used to force redraw during scrolling\\n before actual scrolling happens, thus preventing shaking and\\n flickering artifacts. */\\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\\n position: absolute;\\n z-index: 6;\\n display: none;\\n outline: none;\\n}\\n.CodeMirror-vscrollbar {\\n right: 0; top: 0;\\n overflow-x: hidden;\\n overflow-y: scroll;\\n}\\n.CodeMirror-hscrollbar {\\n bottom: 0; left: 0;\\n overflow-y: hidden;\\n overflow-x: scroll;\\n}\\n.CodeMirror-scrollbar-filler {\\n right: 0; bottom: 0;\\n}\\n.CodeMirror-gutter-filler {\\n left: 0; bottom: 0;\\n}\\n\\n.CodeMirror-gutters {\\n position: absolute; left: 0; top: 0;\\n min-height: 100%;\\n z-index: 3;\\n}\\n.CodeMirror-gutter {\\n white-space: normal;\\n height: 100%;\\n display: inline-block;\\n vertical-align: top;\\n margin-bottom: -50px;\\n}\\n.CodeMirror-gutter-wrapper {\\n position: absolute;\\n z-index: 4;\\n background: none !important;\\n border: none !important;\\n}\\n.CodeMirror-gutter-background {\\n position: absolute;\\n top: 0; bottom: 0;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-elt {\\n position: absolute;\\n cursor: default;\\n z-index: 4;\\n}\\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\\n\\n.CodeMirror-lines {\\n cursor: text;\\n min-height: 1px; /* prevents collapsing before first draw */\\n}\\n.CodeMirror pre.CodeMirror-line,\\n.CodeMirror pre.CodeMirror-line-like {\\n /* Reset some styles that the rest of the page might have set */\\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\\n border-width: 0;\\n background: transparent;\\n font-family: inherit;\\n font-size: inherit;\\n margin: 0;\\n white-space: pre;\\n word-wrap: normal;\\n line-height: inherit;\\n color: inherit;\\n z-index: 2;\\n position: relative;\\n overflow: visible;\\n -webkit-tap-highlight-color: transparent;\\n -webkit-font-variant-ligatures: contextual;\\n font-variant-ligatures: contextual;\\n}\\n.CodeMirror-wrap pre.CodeMirror-line,\\n.CodeMirror-wrap pre.CodeMirror-line-like {\\n word-wrap: break-word;\\n white-space: pre-wrap;\\n word-break: normal;\\n}\\n\\n.CodeMirror-linebackground {\\n position: absolute;\\n left: 0; right: 0; top: 0; bottom: 0;\\n z-index: 0;\\n}\\n\\n.CodeMirror-linewidget {\\n position: relative;\\n z-index: 2;\\n padding: 0.1px; /* Force widget margins to stay inside of the container */\\n}\\n\\n.CodeMirror-widget {}\\n\\n.CodeMirror-rtl pre { direction: rtl; }\\n\\n.CodeMirror-code {\\n outline: none;\\n}\\n\\n/* Force content-box sizing for the elements where we expect it */\\n.CodeMirror-scroll,\\n.CodeMirror-sizer,\\n.CodeMirror-gutter,\\n.CodeMirror-gutters,\\n.CodeMirror-linenumber {\\n -moz-box-sizing: content-box;\\n box-sizing: content-box;\\n}\\n\\n.CodeMirror-measure {\\n position: absolute;\\n width: 100%;\\n height: 0;\\n overflow: hidden;\\n visibility: hidden;\\n}\\n\\n.CodeMirror-cursor {\\n position: absolute;\\n pointer-events: none;\\n}\\n.CodeMirror-measure pre { position: static; }\\n\\ndiv.CodeMirror-cursors {\\n visibility: hidden;\\n position: relative;\\n z-index: 3;\\n}\\ndiv.CodeMirror-dragcursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-focused div.CodeMirror-cursors {\\n visibility: visible;\\n}\\n\\n.CodeMirror-selected { background: #d9d9d9; }\\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\\n.CodeMirror-crosshair { cursor: crosshair; }\\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\\n\\n.cm-searching {\\n background-color: #ffa;\\n background-color: rgba(255, 255, 0, .4);\\n}\\n\\n/* Used to force a border model for a node */\\n.cm-force-border { padding-right: .1px; }\\n\\n@media print {\\n /* Hide the cursor when printing */\\n .CodeMirror div.CodeMirror-cursors {\\n visibility: hidden;\\n }\\n}\\n\\n/* See issue #2901 */\\n.cm-tab-wrap-hack:after { content: ''; }\\n\\n/* Help users use markselection to safely style text background */\\nspan.CodeMirror-selectedtext { background: none; }\\n\", \"\"]);\n\n// exports\n\n\n//# sourceURL=webpack:///./node_modules/codemirror/lib/codemirror.css?./node_modules/css-loader");
/***/ }),
/***/ "./node_modules/handsontable/dist/handsontable.js":
/*!********************************************************!*\
!*** ./node_modules/handsontable/dist/handsontable.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/*!\n * (The MIT License)\n * \n * Copyright (c) 2012-2014 Marcin Warpechowski\n * Copyright (c) 2015 Handsoncode sp. z o.o. <hello@handsoncode.net>\n * \n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * 'Software'), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n * \n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * \n * Version: 0.32.0\n * Date: Tue May 30 2017 12:18:32 GMT+0200 (CEST)\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\"), __webpack_require__(/*! numbro */ \"./node_modules/numbro/numbro.js\"), __webpack_require__(/*! pikaday */ \"./node_modules/pikaday/pikaday.js\"), __webpack_require__(/*! zeroclipboard */ \"./node_modules/zeroclipboard/dist/ZeroClipboard.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_62__, __WEBPACK_EXTERNAL_MODULE_86__, __WEBPACK_EXTERNAL_MODULE_299__, __WEBPACK_EXTERNAL_MODULE_300__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 209);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.HTML_CHARACTERS = undefined;\nexports.getParent = getParent;\nexports.closest = closest;\nexports.closestDown = closestDown;\nexports.isChildOf = isChildOf;\nexports.isChildOfWebComponentTable = isChildOfWebComponentTable;\nexports.polymerWrap = polymerWrap;\nexports.polymerUnwrap = polymerUnwrap;\nexports.index = index;\nexports.overlayContainsElement = overlayContainsElement;\nexports.hasClass = hasClass;\nexports.addClass = addClass;\nexports.removeClass = removeClass;\nexports.removeTextNodes = removeTextNodes;\nexports.empty = empty;\nexports.fastInnerHTML = fastInnerHTML;\nexports.fastInnerText = fastInnerText;\nexports.isVisible = isVisible;\nexports.offset = offset;\nexports.getWindowScrollTop = getWindowScrollTop;\nexports.getWindowScrollLeft = getWindowScrollLeft;\nexports.getScrollTop = getScrollTop;\nexports.getScrollLeft = getScrollLeft;\nexports.getScrollableElement = getScrollableElement;\nexports.getTrimmingContainer = getTrimmingContainer;\nexports.getStyle = getStyle;\nexports.getComputedStyle = getComputedStyle;\nexports.outerWidth = outerWidth;\nexports.outerHeight = outerHeight;\nexports.innerHeight = innerHeight;\nexports.innerWidth = innerWidth;\nexports.addEvent = addEvent;\nexports.removeEvent = removeEvent;\nexports.getCaretPosition = getCaretPosition;\nexports.getSelectionEndPosition = getSelectionEndPosition;\nexports.getSelectionText = getSelectionText;\nexports.setCaretPosition = setCaretPosition;\nexports.getScrollbarWidth = getScrollbarWidth;\nexports.hasVerticalScrollbar = hasVerticalScrollbar;\nexports.hasHorizontalScrollbar = hasHorizontalScrollbar;\nexports.setOverlayPosition = setOverlayPosition;\nexports.getCssTransform = getCssTransform;\nexports.resetCssTransform = resetCssTransform;\nexports.isInput = isInput;\nexports.isOutsideInput = isOutsideInput;\n\nvar _browser = __webpack_require__(25);\n\nvar _feature = __webpack_require__(34);\n\n/**\n * Get the parent of the specified node in the DOM tree.\n *\n * @param {HTMLElement} element Element from which traversing is started.\n * @param {Number} [level=0] Traversing deep level.\n * @return {HTMLElement|null}\n */\nfunction getParent(element) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var iteration = -1;\n var parent = null;\n\n while (element != null) {\n if (iteration === level) {\n parent = element;\n break;\n }\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n iteration++;\n element = element.parentNode;\n }\n }\n\n return parent;\n}\n\n/**\n * Goes up the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n * This method goes up through web components.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nfunction closest(element, nodes, until) {\n while (element != null && element !== until) {\n if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {\n return element;\n }\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n element = element.parentNode;\n }\n }\n\n return null;\n}\n\n/**\n * Goes \"down\" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nfunction closestDown(element, nodes, until) {\n var matched = [];\n\n while (element) {\n element = closest(element, nodes, until);\n\n if (!element || until && !until.contains(element)) {\n break;\n }\n matched.push(element);\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n } else {\n element = element.parentNode;\n }\n }\n var length = matched.length;\n\n return length ? matched[length - 1] : null;\n}\n\n/**\n * Goes up the DOM tree and checks if element is child of another element.\n *\n * @param child Child element\n * @param {Object|String} parent Parent element OR selector of the parent element.\n * If string provided, function returns `true` for the first occurrence of element with that class.\n * @returns {Boolean}\n */\nfunction isChildOf(child, parent) {\n var node = child.parentNode;\n var queriedParents = [];\n\n if (typeof parent === 'string') {\n queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);\n } else {\n queriedParents.push(parent);\n }\n\n while (node != null) {\n if (queriedParents.indexOf(node) > -1) {\n return true;\n }\n node = node.parentNode;\n }\n\n return false;\n}\n\n/**\n * Check if an element is part of `hot-table` web component.\n *\n * @param {Element} element\n * @returns {Boolean}\n */\nfunction isChildOfWebComponentTable(element) {\n var hotTableName = 'hot-table',\n result = false,\n parentNode;\n\n parentNode = polymerWrap(element);\n\n function isHotTable(element) {\n return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();\n }\n\n while (parentNode != null) {\n if (isHotTable(parentNode)) {\n result = true;\n break;\n } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result = isHotTable(parentNode.host);\n\n if (result) {\n break;\n }\n parentNode = parentNode.host;\n }\n parentNode = parentNode.parentNode;\n }\n\n return result;\n}\n\n/**\n * Wrap element into polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nfunction polymerWrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;\n}\n\n/**\n * Unwrap element from polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nfunction polymerUnwrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;\n}\n\n/**\n * Counts index of element within its parent\n * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable\n * Otherwise would need to check for nodeType or use previousElementSibling\n *\n * @see http://jsperf.com/sibling-index/10\n * @param {Element} element\n * @return {Number}\n */\nfunction index(element) {\n var i = 0;\n\n if (element.previousSibling) {\n /* eslint-disable no-cond-assign */\n while (element = element.previousSibling) {\n ++i;\n }\n }\n\n return i;\n}\n\n/**\n * Check if the provided overlay contains the provided element\n *\n * @param {String} overlay\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nfunction overlayContainsElement(overlayType, element) {\n var overlayElement = document.querySelector('.ht_clone_' + overlayType);\n return overlayElement ? overlayElement.contains(element) : null;\n}\n\nvar classListSupport = !!document.documentElement.classList;\nvar _hasClass, _addClass, _removeClass;\n\nfunction filterEmptyClassNames(classNames) {\n var len = 0,\n result = [];\n\n if (!classNames || !classNames.length) {\n return result;\n }\n while (classNames[len]) {\n result.push(classNames[len]);\n len++;\n }\n\n return result;\n}\n\nif (classListSupport) {\n var isSupportMultipleClassesArg = function () {\n var element = document.createElement('div');\n\n element.classList.add('test', 'test2');\n\n return element.classList.contains('test2');\n }();\n\n _hasClass = function _hasClass(element, className) {\n if (className === '') {\n return false;\n }\n\n return element.classList.contains(className);\n };\n\n _addClass = function _addClass(element, className) {\n var len = 0;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n className = filterEmptyClassNames(className);\n\n if (isSupportMultipleClassesArg) {\n element.classList.add.apply(element.classList, className);\n } else {\n while (className && className[len]) {\n element.classList.add(className[len]);\n len++;\n }\n }\n };\n\n _removeClass = function _removeClass(element, className) {\n var len = 0;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n className = filterEmptyClassNames(className);\n\n if (isSupportMultipleClassesArg) {\n element.classList.remove.apply(element.classList, className);\n } else {\n while (className && className[len]) {\n element.classList.remove(className[len]);\n len++;\n }\n }\n };\n} else {\n var createClassNameRegExp = function createClassNameRegExp(className) {\n return new RegExp('(\\\\s|^)' + className + '(\\\\s|$)');\n };\n\n _hasClass = function _hasClass(element, className) {\n // http://snipplr.com/view/3561/addclass-removeclass-hasclass/\n return !!element.className.match(createClassNameRegExp(className));\n };\n\n _addClass = function _addClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n if (_className === '') {\n _className = className.join(' ');\n } else {\n while (className && className[len]) {\n if (!createClassNameRegExp(className[len]).test(_className)) {\n _className += ' ' + className[len];\n }\n len++;\n }\n }\n element.className = _className;\n };\n\n _removeClass = function _removeClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n while (className && className[len]) {\n // String.prototype.trim is defined in polyfill.js\n _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();\n len++;\n }\n if (element.className !== _className) {\n element.className = _className;\n }\n };\n}\n\n/**\n * Checks if element has class name\n *\n * @param {HTMLElement} element\n * @param {String} className Class name to check\n * @returns {Boolean}\n */\nfunction hasClass(element, className) {\n return _hasClass(element, className);\n}\n\n/**\n * Add class name to an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nfunction addClass(element, className) {\n return _addClass(element, className);\n}\n\n/**\n * Remove class name from an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nfunction removeClass(element, className) {\n return _removeClass(element, className);\n}\n\nfunction removeTextNodes(element, parent) {\n if (element.nodeType === 3) {\n parent.removeChild(element); // bye text nodes!\n } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {\n var childs = element.childNodes;\n for (var i = childs.length - 1; i >= 0; i--) {\n removeTextNodes(childs[i], element);\n }\n }\n}\n\n/**\n * Remove childs function\n * WARNING - this doesn't unload events and data attached by jQuery\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method\n *\n * @param element\n * @returns {void}\n */\n//\nfunction empty(element) {\n var child;\n /* eslint-disable no-cond-assign */\n while (child = element.lastChild) {\n element.removeChild(child);\n }\n}\n\nvar HTML_CHARACTERS = exports.HTML_CHARACTERS = /(<(.*)>|&(.*);)/;\n\n/**\n * Insert content into element trying avoid innerHTML method.\n * @return {void}\n */\nfunction fastInnerHTML(element, content) {\n if (HTML_CHARACTERS.test(content)) {\n element.innerHTML = content;\n } else {\n fastInnerText(element, content);\n }\n}\n\n/**\n * Insert text content into element\n * @return {void}\n */\n\nvar textContextSupport = !!document.createTextNode('test').textContent;\n\nfunction fastInnerText(element, content) {\n var child = element.firstChild;\n\n if (child && child.nodeType === 3 && child.nextSibling === null) {\n // fast lane - replace existing text node\n\n if (textContextSupport) {\n // http://jsperf.com/replace-text-vs-reuse\n child.textContent = content;\n } else {\n // http://jsperf.com/replace-text-vs-reuse\n child.data = content;\n }\n } else {\n // slow lane - empty element and insert a text node\n empty(element);\n element.appendChild(document.createTextNode(content));\n }\n}\n\n/**\n * Returns true if element is attached to the DOM and visible, false otherwise\n * @param elem\n * @returns {boolean}\n */\nfunction isVisible(elem) {\n var next = elem;\n\n while (polymerUnwrap(next) !== document.documentElement) {\n // until <html> reached\n if (next === null) {\n // parent detached from DOM\n return false;\n } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n if (next.host) {\n // this is Web Components Shadow DOM\n // see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation\n // according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet\n if (next.host.impl) {\n // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled\n return isVisible(next.host.impl);\n } else if (next.host) {\n // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled\n return isVisible(next.host);\n }\n throw new Error('Lost in Web Components world');\n } else {\n return false; // this is a node detached from document in IE8\n }\n } else if (next.style.display === 'none') {\n return false;\n }\n next = next.parentNode;\n }\n\n return true;\n}\n\n/**\n * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.\n *\n * @param {HTMLElement} elem\n * @return {Object} Returns object with `top` and `left` props\n */\nfunction offset(elem) {\n var offsetLeft, offsetTop, lastElem, docElem, box;\n\n docElem = document.documentElement;\n\n if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)\n // http://jsperf.com/offset-vs-getboundingclientrect/8\n box = elem.getBoundingClientRect();\n\n return {\n top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),\n left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)\n };\n }\n offsetLeft = elem.offsetLeft;\n offsetTop = elem.offsetTop;\n lastElem = elem;\n\n /* eslint-disable no-cond-assign */\n while (elem = elem.offsetParent) {\n // from my observation, document.body always has scrollLeft/scrollTop == 0\n if (elem === document.body) {\n break;\n }\n offsetLeft += elem.offsetLeft;\n offsetTop += elem.offsetTop;\n lastElem = elem;\n }\n\n // slow - http://jsperf.com/offset-vs-getboundingclientrect/6\n if (lastElem && lastElem.style.position === 'fixed') {\n // if(lastElem !== document.body) { //faster but does gives false positive in Firefox\n offsetLeft += window.pageXOffset || docElem.scrollLeft;\n offsetTop += window.pageYOffset || docElem.scrollTop;\n }\n\n return {\n left: offsetLeft,\n top: offsetTop\n };\n}\n\n/**\n * Returns the document's scrollTop property.\n *\n * @returns {Number}\n */\nfunction getWindowScrollTop() {\n var res = window.scrollY;\n\n if (res === void 0) {\n // IE8-11\n res = document.documentElement.scrollTop;\n }\n\n return res;\n}\n\n/**\n * Returns the document's scrollLeft property.\n *\n * @returns {Number}\n */\nfunction getWindowScrollLeft() {\n var res = window.scrollX;\n\n if (res === void 0) {\n // IE8-11\n res = document.documentElement.scrollLeft;\n }\n\n return res;\n}\n\n/**\n * Returns the provided element's scrollTop property.\n *\n * @param element\n * @returns {Number}\n */\nfunction getScrollTop(element) {\n if (element === window) {\n return getWindowScrollTop();\n }\n return element.scrollTop;\n}\n\n/**\n * Returns the provided element's scrollLeft property.\n *\n * @param element\n * @returns {Number}\n */\nfunction getScrollLeft(element) {\n if (element === window) {\n return getWindowScrollLeft();\n }\n return element.scrollLeft;\n}\n\n/**\n * Returns a DOM element responsible for scrolling of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {HTMLElement} Element's scrollable parent\n */\nfunction getScrollableElement(element) {\n var el = element.parentNode,\n props = ['auto', 'scroll'],\n overflow,\n overflowX,\n overflowY,\n computedStyle = '',\n computedOverflow = '',\n computedOverflowY = '',\n computedOverflowX = '';\n\n while (el && el.style && document.body !== el) {\n overflow = el.style.overflow;\n overflowX = el.style.overflowX;\n overflowY = el.style.overflowY;\n\n if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {\n return el;\n } else if (window.getComputedStyle) {\n computedStyle = window.getComputedStyle(el);\n computedOverflow = computedStyle.getPropertyValue('overflow');\n computedOverflowY = computedStyle.getPropertyValue('overflow-y');\n computedOverflowX = computedStyle.getPropertyValue('overflow-x');\n\n if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {\n return el;\n }\n }\n\n if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {\n return el;\n }\n if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {\n return el;\n }\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a DOM element responsible for trimming the provided element.\n *\n * @param {HTMLElement} base Base element\n * @returns {HTMLElement} Base element's trimming parent\n */\nfunction getTrimmingContainer(base) {\n var el = base.parentNode;\n\n while (el && el.style && document.body !== el) {\n if (el.style.overflow !== 'visible' && el.style.overflow !== '') {\n return el;\n } else if (window.getComputedStyle) {\n var computedStyle = window.getComputedStyle(el);\n\n if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {\n return el;\n }\n }\n\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a style property for the provided element. (Be it an inline or external style).\n *\n * @param {HTMLElement} element\n * @param {String} prop Wanted property\n * @returns {String|undefined} Element's style property\n */\nfunction getStyle(element, prop) {\n /* eslint-disable */\n if (!element) {\n return;\n } else if (element === window) {\n if (prop === 'width') {\n return window.innerWidth + 'px';\n } else if (prop === 'height') {\n return window.innerHeight + 'px';\n }\n\n return;\n }\n\n var styleProp = element.style[prop],\n computedStyle;\n\n if (styleProp !== '' && styleProp !== void 0) {\n return styleProp;\n } else {\n computedStyle = getComputedStyle(element);\n\n if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {\n return computedStyle[prop];\n }\n }\n}\n\n/**\n * Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).\n *\n * @param element\n * @returns {IEElementStyle|CssStyle} Elements computed style object\n */\nfunction getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n}\n\n/**\n * Returns the element's outer width.\n *\n * @param element\n * @returns {number} Element's outer width\n */\nfunction outerWidth(element) {\n return element.offsetWidth;\n}\n\n/**\n * Returns the element's outer height\n *\n * @param elem\n * @returns {number} Element's outer height\n */\nfunction outerHeight(elem) {\n if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight\n // jQuery (1.10.1) still has this unsolved\n // may be better to just switch to getBoundingClientRect\n // http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html\n // http://bugs.jquery.com/ticket/2196\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140\n return elem.offsetHeight + elem.firstChild.offsetHeight;\n }\n\n return elem.offsetHeight;\n}\n\n/**\n * Returns the element's inner height.\n *\n * @param element\n * @returns {number} Element's inner height\n */\nfunction innerHeight(element) {\n return element.clientHeight || element.innerHeight;\n}\n\n/**\n * Returns the element's inner width.\n *\n * @param element\n * @returns {number} Element's inner width\n */\nfunction innerWidth(element) {\n return element.clientWidth || element.innerWidth;\n}\n\nfunction addEvent(element, event, callback) {\n if (window.addEventListener) {\n element.addEventListener(event, callback, false);\n } else {\n element.attachEvent('on' + event, callback);\n }\n}\n\nfunction removeEvent(element, event, callback) {\n if (window.removeEventListener) {\n element.removeEventListener(event, callback, false);\n } else {\n element.detachEvent('on' + event, callback);\n }\n}\n\n/**\n * Returns caret position in text input\n *\n * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea\n * @return {Number}\n */\nfunction getCaretPosition(el) {\n if (el.selectionStart) {\n return el.selectionStart;\n } else if (document.selection) {\n // IE8\n el.focus();\n\n var r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n var re = el.createTextRange();\n var rc = re.duplicate();\n\n re.moveToBookmark(r.getBookmark());\n rc.setEndPoint('EndToStart', re);\n\n return rc.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns end of the selection in text input\n *\n * @return {Number}\n */\nfunction getSelectionEndPosition(el) {\n if (el.selectionEnd) {\n return el.selectionEnd;\n } else if (document.selection) {\n // IE8\n var r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n var re = el.createTextRange();\n\n return re.text.indexOf(r.text) + r.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns text under selection.\n *\n * @returns {String}\n */\nfunction getSelectionText() {\n var text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type !== 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n}\n\n/**\n * Sets caret position in text input.\n *\n * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/\n * @param {Element} element\n * @param {Number} pos\n * @param {Number} endPos\n */\nfunction setCaretPosition(element, pos, endPos) {\n if (endPos === void 0) {\n endPos = pos;\n }\n if (element.setSelectionRange) {\n element.focus();\n\n try {\n element.setSelectionRange(pos, endPos);\n } catch (err) {\n var elementParent = element.parentNode;\n var parentDisplayValue = elementParent.style.display;\n elementParent.style.display = 'block';\n element.setSelectionRange(pos, endPos);\n elementParent.style.display = parentDisplayValue;\n }\n } else if (element.createTextRange) {\n // IE8\n var range = element.createTextRange();\n range.collapse(true);\n range.moveEnd('character', endPos);\n range.moveStart('character', pos);\n range.select();\n }\n}\n\nvar cachedScrollbarWidth;\n\n// http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\nfunction walkontableCalculateScrollbarWidth() {\n var inner = document.createElement('div');\n inner.style.height = '200px';\n inner.style.width = '100%';\n\n var outer = document.createElement('div');\n outer.style.boxSizing = 'content-box';\n outer.style.height = '150px';\n outer.style.left = '0px';\n outer.style.overflow = 'hidden';\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.width = '200px';\n outer.style.visibility = 'hidden';\n outer.appendChild(inner);\n\n (document.body || document.documentElement).appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n (document.body || document.documentElement).removeChild(outer);\n\n return w1 - w2;\n}\n\n/**\n * Returns the computed width of the native browser scroll bar.\n *\n * @return {Number} width\n */\nfunction getScrollbarWidth() {\n if (cachedScrollbarWidth === void 0) {\n cachedScrollbarWidth = walkontableCalculateScrollbarWidth();\n }\n\n return cachedScrollbarWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nfunction hasVerticalScrollbar(element) {\n return element.offsetWidth !== element.clientWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nfunction hasHorizontalScrollbar(element) {\n return element.offsetHeight !== element.clientHeight;\n}\n\n/**\n * Sets overlay position depending on it's type and used browser\n */\nfunction setOverlayPosition(overlayElem, left, top) {\n if ((0, _browser.isIE8)() || (0, _browser.isIE9)()) {\n overlayElem.style.top = top;\n overlayElem.style.left = left;\n } else if ((0, _browser.isSafari)()) {\n overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';\n } else {\n overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';\n }\n}\n\nfunction getCssTransform(element) {\n var transform;\n\n if (element.style.transform && (transform = element.style.transform) !== '') {\n return ['transform', transform];\n } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {\n\n return ['-webkit-transform', transform];\n }\n\n return -1;\n}\n\nfunction resetCssTransform(element) {\n if (element.style.transform && element.style.transform !== '') {\n element.style.transform = '';\n } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') {\n element.style['-webkit-transform'] = '';\n }\n}\n\n/**\n * Determines if the given DOM element is an input field.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nfunction isInput(element) {\n var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];\n\n return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');\n}\n\n/**\n * Determines if the given DOM element is an input field placed OUTSIDE of HOT.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nfunction isOutsideInput(element) {\n return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.to2dArray = to2dArray;\nexports.extendArray = extendArray;\nexports.pivot = pivot;\nexports.arrayReduce = arrayReduce;\nexports.arrayFilter = arrayFilter;\nexports.arrayMap = arrayMap;\nexports.arrayEach = arrayEach;\nexports.arraySum = arraySum;\nexports.arrayMax = arrayMax;\nexports.arrayMin = arrayMin;\nexports.arrayAvg = arrayAvg;\nexports.arrayFlatten = arrayFlatten;\nexports.arrayUnique = arrayUnique;\nfunction to2dArray(arr) {\n var i = 0,\n ilen = arr.length;\n\n while (i < ilen) {\n arr[i] = [arr[i]];\n i++;\n }\n}\n\nfunction extendArray(arr, extension) {\n var i = 0,\n ilen = extension.length;\n\n while (i < ilen) {\n arr.push(extension[i]);\n i++;\n }\n}\n\nfunction pivot(arr) {\n var pivotedArr = [];\n\n if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {\n return pivotedArr;\n }\n\n var rowCount = arr.length;\n var colCount = arr[0].length;\n\n for (var i = 0; i < rowCount; i++) {\n for (var j = 0; j < colCount; j++) {\n if (!pivotedArr[j]) {\n pivotedArr[j] = [];\n }\n\n pivotedArr[j][i] = arr[i][j];\n }\n }\n\n return pivotedArr;\n}\n\n/**\n * A specialized version of `.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {Boolean} [initFromArray] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n\n return accumulator;\n}\n\n/**\n * A specialized version of `.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n\n result[++resIndex] = iteratee(value, index, array);\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n\n return array;\n}\n\n/**\n * Calculate sum value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated sum value.\n */\nfunction arraySum(array) {\n return arrayReduce(array, function (a, b) {\n return a + b;\n }, 0);\n}\n\n/**\n * Returns the highest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the highest value from an array.\n */\nfunction arrayMax(array) {\n return arrayReduce(array, function (a, b) {\n return a > b ? a : b;\n }, Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Returns the lowest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the lowest value from an array.\n */\nfunction arrayMin(array) {\n return arrayReduce(array, function (a, b) {\n return a < b ? a : b;\n }, Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Calculate average value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated average value.\n */\nfunction arrayAvg(array) {\n if (!array.length) {\n return 0;\n }\n\n return arraySum(array) / array.length;\n}\n\n/**\n * Flatten multidimensional array.\n *\n * @param {Array} array Array of Arrays\n * @returns {Array}\n */\nfunction arrayFlatten(array) {\n return arrayReduce(array, function (initial, value) {\n return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value);\n }, []);\n}\n\n/**\n * Unique values in the array.\n *\n * @param {Array} array The array to process.\n * @returns {Array}\n */\nfunction arrayUnique(array) {\n var unique = [];\n\n arrayEach(array, function (value) {\n if (unique.indexOf(value) === -1) {\n unique.push(value);\n }\n });\n\n return unique;\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.duckSchema = duckSchema;\nexports.inherit = inherit;\nexports.extend = extend;\nexports.deepExtend = deepExtend;\nexports.deepClone = deepClone;\nexports.clone = clone;\nexports.mixin = mixin;\nexports.isObjectEquals = isObjectEquals;\nexports.isObject = isObject;\nexports.defineGetter = defineGetter;\nexports.objectEach = objectEach;\nexports.getProperty = getProperty;\nexports.deepObjectSize = deepObjectSize;\nexports.createObjectPropListener = createObjectPropListener;\nexports.hasOwnProperty = hasOwnProperty;\n\nvar _array = __webpack_require__(1);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Generate schema for passed object.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nfunction duckSchema(object) {\n var schema;\n\n if (Array.isArray(object)) {\n schema = [];\n } else {\n schema = {};\n\n objectEach(object, function (value, key) {\n if (key === '__children') {\n return;\n }\n\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !Array.isArray(value)) {\n schema[key] = duckSchema(value);\n } else if (Array.isArray(value)) {\n if (value.length && _typeof(value[0]) === 'object' && !Array.isArray(value[0])) {\n schema[key] = [duckSchema(value[0])];\n } else {\n schema[key] = [];\n }\n } else {\n schema[key] = null;\n }\n });\n }\n\n return schema;\n}\n\n/**\n * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`.\n * Creates temporary dummy function to call it as constructor.\n * Described in ticket: https://github.com/handsontable/handsontable/pull/516\n *\n * @param {Object} Child child class\n * @param {Object} Parent parent class\n * @return {Object} extended Child\n */\nfunction inherit(Child, Parent) {\n Parent.prototype.constructor = Parent;\n Child.prototype = new Parent();\n Child.prototype.constructor = Child;\n\n return Child;\n}\n\n/**\n * Perform shallow extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nfunction extend(target, extension) {\n objectEach(extension, function (value, key) {\n target[key] = value;\n });\n\n return target;\n}\n\n/**\n * Perform deep extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nfunction deepExtend(target, extension) {\n objectEach(extension, function (value, key) {\n if (extension[key] && _typeof(extension[key]) === 'object') {\n if (!target[key]) {\n if (Array.isArray(extension[key])) {\n target[key] = [];\n } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {\n target[key] = extension[key];\n } else {\n target[key] = {};\n }\n }\n deepExtend(target[key], extension[key]);\n } else {\n target[key] = extension[key];\n }\n });\n}\n\n/**\n * Perform deep clone of an object.\n * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc.\n *\n * @param {Object} obj An object that will be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {\n return JSON.parse(JSON.stringify(obj));\n }\n\n return obj;\n}\n\n/**\n * Shallow clone object.\n *\n * @param {Object} object\n * @returns {Object}\n */\nfunction clone(object) {\n var result = {};\n\n objectEach(object, function (value, key) {\n result[key] = value;\n });\n\n return result;\n}\n\n/**\n * Extend the Base object (usually prototype) of the functionality the `mixins` objects.\n *\n * @param {Object} Base Base object which will be extended.\n * @param {Object} mixins The object of the functionality will be \"copied\".\n * @returns {Object}\n */\nfunction mixin(Base) {\n if (!Base.MIXINS) {\n Base.MIXINS = [];\n }\n\n for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n mixins[_key - 1] = arguments[_key];\n }\n\n (0, _array.arrayEach)(mixins, function (mixin) {\n Base.MIXINS.push(mixin.MIXIN_NAME);\n\n objectEach(mixin, function (value, key) {\n if (Base.prototype[key] !== void 0) {\n throw new Error('Mixin conflict. Property \\'' + key + '\\' already exist and cannot be overwritten.');\n }\n if (typeof value === 'function') {\n Base.prototype[key] = value;\n } else {\n var getter = function _getter(propertyName, initialValue) {\n propertyName = '_' + propertyName;\n\n var initValue = function initValue(value) {\n if (Array.isArray(value) || isObject(value)) {\n value = deepClone(value);\n }\n\n return value;\n };\n\n return function () {\n if (this[propertyName] === void 0) {\n this[propertyName] = initValue(initialValue);\n }\n\n return this[propertyName];\n };\n };\n var setter = function _setter(propertyName) {\n propertyName = '_' + propertyName;\n\n return function (value) {\n this[propertyName] = value;\n };\n };\n Object.defineProperty(Base.prototype, key, {\n get: getter(key, value),\n set: setter(key),\n configurable: true\n });\n }\n });\n });\n\n return Base;\n}\n\n/**\n * Checks if two objects or arrays are (deep) equal\n *\n * @param {Object|Array} object1\n * @param {Object|Array} object2\n * @returns {Boolean}\n */\nfunction isObjectEquals(object1, object2) {\n return JSON.stringify(object1) === JSON.stringify(object2);\n}\n\n/**\n * Determines whether given object is a plain Object.\n * Note: String and Array are not plain Objects\n * @param {*} obj\n * @returns {boolean}\n */\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) == '[object Object]';\n}\n\nfunction defineGetter(object, property, value, options) {\n options.value = value;\n options.writable = options.writable !== false;\n options.enumerable = options.enumerable !== false;\n options.configurable = options.configurable !== false;\n\n Object.defineProperty(object, property, options);\n}\n\n/**\n * A specialized version of `.forEach` for objects.\n *\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction objectEach(object, iteratee) {\n for (var key in object) {\n if (!object.hasOwnProperty || object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key)) {\n if (iteratee(object[key], key, object) === false) {\n break;\n }\n }\n }\n\n return object;\n}\n\n/**\n * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`).\n *\n * @param {Object} object Object which value will be exported.\n * @param {String} name Object property name.\n * @returns {*}\n */\nfunction getProperty(object, name) {\n var names = name.split('.');\n var result = object;\n\n objectEach(names, function (name) {\n result = result[name];\n\n if (result === void 0) {\n result = void 0;\n\n return false;\n }\n });\n\n return result;\n}\n\n/**\n * Return object length (recursively).\n *\n * @param {*} object Object for which we want get length.\n * @returns {Number}\n */\nfunction deepObjectSize(object) {\n if (!isObject(object)) {\n return 0;\n }\n var recursObjLen = function recursObjLen(obj) {\n var result = 0;\n\n if (isObject(obj)) {\n objectEach(obj, function (key) {\n result += recursObjLen(key);\n });\n } else {\n result++;\n }\n\n return result;\n };\n\n return recursObjLen(object);\n}\n\n/**\n * Create object with property where its value change will be observed.\n *\n * @param {*} [defaultValue=undefined] Default value.\n * @param {String} [propertyToListen='value'] Property to listen.\n * @returns {Object}\n */\nfunction createObjectPropListener(defaultValue) {\n var _holder;\n\n var propertyToListen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';\n\n var privateProperty = '_' + propertyToListen;\n var holder = (_holder = {\n _touched: false\n }, _defineProperty(_holder, privateProperty, defaultValue), _defineProperty(_holder, 'isTouched', function isTouched() {\n return this._touched;\n }), _holder);\n\n Object.defineProperty(holder, propertyToListen, {\n get: function get() {\n return this[privateProperty];\n },\n set: function set(value) {\n this._touched = true;\n this[privateProperty] = value;\n },\n\n enumerable: true,\n configurable: true\n });\n\n return holder;\n}\n\n/**\n * Check if at specified `key` there is any value for `object`.\n *\n * @param {Object} object Object to search value at specyfic key.\n * @param {String} key String key to check.\n */\nfunction hasOwnProperty(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , core = __webpack_require__(44)\n , hide = __webpack_require__(32)\n , redefine = __webpack_require__(33)\n , ctx = __webpack_require__(29)\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // import Core from './core';\n\n\nexports.getListenersCounter = getListenersCounter;\n\nvar _element = __webpack_require__(0);\n\nvar _feature = __webpack_require__(34);\n\nvar _event = __webpack_require__(7);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Counter which tracks unregistered listeners (useful for detecting memory leaks).\n *\n * @type {Number}\n */\nvar listenersCounter = 0;\n\n/**\n * Event DOM manager for internal use in Handsontable.\n *\n * @class EventManager\n * @util\n */\n\nvar EventManager = function () {\n /**\n * @param {Object} [context=null]\n * @private\n */\n function EventManager() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _classCallCheck(this, EventManager);\n\n this.context = context || this;\n\n if (!this.context.eventListeners) {\n this.context.eventListeners = [];\n }\n }\n\n /**\n * Register specified listener (`eventName`) to the element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function which will be called after event occur.\n * @returns {Function} Returns function which you can easily call to remove that event\n */\n\n\n _createClass(EventManager, [{\n key: 'addEventListener',\n value: function addEventListener(element, eventName, callback) {\n var _this = this;\n\n var context = this.context;\n\n function callbackProxy(event) {\n event = extendEvent(context, event);\n\n callback.call(this, event);\n }\n this.context.eventListeners.push({\n element: element,\n event: eventName,\n callback: callback,\n callbackProxy: callbackProxy\n });\n\n if (window.addEventListener) {\n element.addEventListener(eventName, callbackProxy, false);\n } else {\n element.attachEvent('on' + eventName, callbackProxy);\n }\n listenersCounter++;\n\n return function () {\n _this.removeEventListener(element, eventName, callback);\n };\n }\n\n /**\n * Remove the event listener previously registered.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function to remove from the event target. It must be the same as during registration listener.\n */\n\n }, {\n key: 'removeEventListener',\n value: function removeEventListener(element, eventName, callback) {\n var len = this.context.eventListeners.length;\n var tmpEvent = void 0;\n\n while (len--) {\n tmpEvent = this.context.eventListeners[len];\n\n if (tmpEvent.event == eventName && tmpEvent.element == element) {\n if (callback && callback != tmpEvent.callback) {\n /* eslint-disable no-continue */\n continue;\n }\n this.context.eventListeners.splice(len, 1);\n\n if (tmpEvent.element.removeEventListener) {\n tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);\n } else {\n tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy);\n }\n listenersCounter--;\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n *\n * @private\n * @since 0.15.0-beta3\n */\n\n }, {\n key: 'clearEvents',\n value: function clearEvents() {\n if (!this.context) {\n return;\n }\n var len = this.context.eventListeners.length;\n\n while (len--) {\n var event = this.context.eventListeners[len];\n\n if (event) {\n this.removeEventListener(event.element, event.event, event.callback);\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n this.clearEvents();\n }\n\n /**\n * Destroy instance of EventManager.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.clearEvents();\n this.context = null;\n }\n\n /**\n * Trigger event at the specified target element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n */\n\n }, {\n key: 'fireEvent',\n value: function fireEvent(element, eventName) {\n var options = {\n bubbles: true,\n cancelable: eventName !== 'mousemove',\n view: window,\n detail: 0,\n screenX: 0,\n screenY: 0,\n clientX: 1,\n clientY: 1,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: undefined\n };\n var event;\n\n if (document.createEvent) {\n event = document.createEvent('MouseEvents');\n event.initMouseEvent(eventName, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, options.relatedTarget || document.body.parentNode);\n } else {\n event = document.createEventObject();\n }\n\n if (element.dispatchEvent) {\n element.dispatchEvent(event);\n } else {\n element.fireEvent('on' + eventName, event);\n }\n }\n }]);\n\n return EventManager;\n}();\n\n/**\n * @param {Object} context\n * @param {Event} event\n * @private\n * @returns {*}\n */\n\n\nfunction extendEvent(context, event) {\n var componentName = 'HOT-TABLE';\n var isHotTableSpotted = void 0;\n var fromElement = void 0;\n var realTarget = void 0;\n var target = void 0;\n var len = void 0;\n var nativeStopImmediatePropagation = void 0;\n\n event.isTargetWebComponent = false;\n event.realTarget = event.target;\n\n nativeStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function () {\n nativeStopImmediatePropagation.apply(this);\n (0, _event.stopImmediatePropagation)(this);\n };\n\n if (!EventManager.isHotTableEnv) {\n return event;\n }\n event = (0, _element.polymerWrap)(event);\n len = event.path ? event.path.length : 0;\n\n while (len--) {\n if (event.path[len].nodeName === componentName) {\n isHotTableSpotted = true;\n } else if (isHotTableSpotted && event.path[len].shadowRoot) {\n target = event.path[len];\n\n break;\n }\n if (len === 0 && !target) {\n target = event.path[len];\n }\n }\n if (!target) {\n target = event.target;\n }\n event.isTargetWebComponent = true;\n\n if ((0, _feature.isWebComponentSupportedNatively)()) {\n event.realTarget = event.srcElement || event.toElement;\n } else if (context instanceof Core || context instanceof Walkontable) {\n // Polymer doesn't support `event.target` property properly we must emulate it ourselves\n if (context instanceof Core) {\n fromElement = context.view ? context.view.wt.wtTable.TABLE : null;\n } else if (context instanceof Walkontable) {\n // .wtHider\n fromElement = context.wtTable.TABLE.parentNode.parentNode;\n }\n realTarget = (0, _element.closest)(event.target, [componentName], fromElement);\n\n if (realTarget) {\n event.realTarget = fromElement.querySelector(componentName) || event.target;\n } else {\n event.realTarget = event.target;\n }\n }\n\n Object.defineProperty(event, 'target', {\n get: function get() {\n return (0, _element.polymerWrap)(target);\n },\n\n enumerable: true,\n configurable: true\n });\n\n return event;\n}\n\nexports.default = EventManager;\nfunction getListenersCounter() {\n return listenersCounter;\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getPluginName = exports.getRegistredPluginNames = exports.getPlugin = exports.registerPlugin = undefined;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _object = __webpack_require__(2);\n\nvar _string = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar registeredPlugins = new WeakMap();\n\n/**\n * Registers plugin under given name\n *\n * @param {String} pluginName\n * @param {Function} PluginClass\n */\n/**\n * Utility to register plugins and common namespace for keeping reference to all plugins classes\n */\nfunction registerPlugin(pluginName, PluginClass) {\n pluginName = (0, _string.toUpperCaseFirst)(pluginName);\n\n _pluginHooks2.default.getSingleton().add('construct', function () {\n var holder = void 0;\n\n if (!registeredPlugins.has(this)) {\n registeredPlugins.set(this, {});\n }\n holder = registeredPlugins.get(this);\n\n if (!holder[pluginName]) {\n holder[pluginName] = new PluginClass(this);\n }\n });\n _pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n if (registeredPlugins.has(this)) {\n var pluginsHolder = registeredPlugins.get(this);\n\n (0, _object.objectEach)(pluginsHolder, function (plugin) {\n return plugin.destroy();\n });\n registeredPlugins.delete(this);\n }\n });\n}\n\n/**\n * @param {Object} instance\n * @param {String|Function} pluginName\n * @returns {Function} pluginClass Returns plugin instance if exists or `undefined` if not exists.\n */\nfunction getPlugin(instance, pluginName) {\n if (typeof pluginName != 'string') {\n throw Error('Only strings can be passed as \"plugin\" parameter');\n }\n var _pluginName = (0, _string.toUpperCaseFirst)(pluginName);\n\n if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) {\n return void 0;\n }\n\n return registeredPlugins.get(instance)[_pluginName];\n}\n\n/**\n * Get all registred plugins names for concrete Handsontable instance.\n *\n * @param {Object} hotInstance\n * @returns {Array}\n */\nfunction getRegistredPluginNames(hotInstance) {\n return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : [];\n}\n\n/**\n * Get plugin name.\n *\n * @param {Object} hotInstance\n * @param {Object} plugin\n * @returns {String|null}\n */\nfunction getPluginName(hotInstance, plugin) {\n var pluginName = null;\n\n if (registeredPlugins.has(hotInstance)) {\n (0, _object.objectEach)(registeredPlugins.get(hotInstance), function (pluginInstance, name) {\n if (pluginInstance === plugin) {\n pluginName = name;\n }\n });\n }\n\n return pluginName;\n}\n\nexports.registerPlugin = registerPlugin;\nexports.getPlugin = getPlugin;\nexports.getRegistredPluginNames = getRegistredPluginNames;\nexports.getPluginName = getPluginName;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isNumeric = isNumeric;\nexports.rangeEach = rangeEach;\nexports.rangeEachReverse = rangeEachReverse;\nexports.valueAccordingPercent = valueAccordingPercent;\n/**\n * Checks if value of n is a numeric one\n * http://jsperf.com/isnan-vs-isnumeric/4\n * @param n\n * @returns {boolean}\n */\nfunction isNumeric(n) {\n /* eslint-disable */\n var t = typeof n === 'undefined' ? 'undefined' : _typeof(n);\n\n return t == 'number' ? !isNaN(n) && isFinite(n) : t == 'string' ? !n.length ? false : n.length == 1 ? /\\d/.test(n) : /^\\s*[+-]?\\s*(?:(?:\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?)|(?:0x[a-f\\d]+))\\s*$/i.test(n) : t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false;\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.\n * @param {Function} [iteratee] The function invoked per iteration.\n */\nfunction rangeEach(rangeFrom, rangeTo, iteratee) {\n var index = -1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = rangeFrom;\n } else {\n index = rangeFrom - 1;\n }\n while (++index <= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges iterable in reverse order.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number} rangeTo The number where finish iterate.\n * @param {Function} iteratee The function invoked per iteration.\n */\nfunction rangeEachReverse(rangeFrom, rangeTo, iteratee) {\n var index = rangeFrom + 1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = 0;\n }\n while (--index >= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * Calculate value from percent.\n *\n * @param {Number} value Base value from percent will be calculated.\n * @param {String|Number} percent Can be Number or String (eq. `'33%'`).\n * @returns {Number}\n */\nfunction valueAccordingPercent(value, percent) {\n percent = parseInt(percent.toString().replace('%', ''), 10);\n percent = parseInt(value * percent / 100, 10);\n\n return percent;\n}\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.stopImmediatePropagation = stopImmediatePropagation;\nexports.isImmediatePropagationStopped = isImmediatePropagationStopped;\nexports.stopPropagation = stopPropagation;\nexports.pageX = pageX;\nexports.pageY = pageY;\nexports.isRightClick = isRightClick;\nexports.isLeftClick = isLeftClick;\n\nvar _element = __webpack_require__(0);\n\n/**\n * Prevent other listeners of the same event from being called.\n *\n * @param {Event} event\n */\nfunction stopImmediatePropagation(event) {\n event.isImmediatePropagationEnabled = false;\n event.cancelBubble = true;\n}\n\n/**\n * Check if event was stopped by `stopImmediatePropagation`.\n *\n * @param event {Event}\n * @returns {Boolean}\n */\nfunction isImmediatePropagationStopped(event) {\n return event.isImmediatePropagationEnabled === false;\n}\n\n/**\n * Prevent further propagation of the current event (prevent bubbling).\n *\n * @param event {Event}\n */\nfunction stopPropagation(event) {\n // ie8\n // http://msdn.microsoft.com/en-us/library/ie/ff975462(v=vs.85).aspx\n if (typeof event.stopPropagation === 'function') {\n event.stopPropagation();\n } else {\n event.cancelBubble = true;\n }\n}\n\n/**\n * Get horizontal coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nfunction pageX(event) {\n if (event.pageX) {\n return event.pageX;\n }\n\n return event.clientX + (0, _element.getWindowScrollLeft)();\n}\n\n/**\n * Get vertical coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nfunction pageY(event) {\n if (event.pageY) {\n return event.pageY;\n }\n\n return event.clientY + (0, _element.getWindowScrollTop)();\n}\n\n/**\n * Check if provided event was triggered by clicking the right mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nfunction isRightClick(event) {\n return event.button === 2;\n}\n\n/**\n * Check if provided event was triggered by clicking the left mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nfunction isLeftClick(event) {\n return event.button === 0;\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @description\n * Handsontable events are the common interface that function in 2 ways: as __callbacks__ and as __hooks__.\n *\n * @example\n *\n * ```js\n * // Using events as callbacks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * afterChange: function(changes, source) {\n * $.ajax({\n * url: \"save.php',\n * data: change\n * });\n * }\n * });\n * ...\n * ```\n *\n * ```js\n * // Using events as plugin hooks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * myPlugin: true\n * });\n *\n * var hot2 = new Handsontable(document.getElementById('example2'), {\n * myPlugin: false\n * });\n *\n * // global hook\n * Handsontable.hooks.add('afterChange', function() {\n * // Fired twice - for hot1 and hot2\n * if (this.getSettings().myPlugin) {\n * // function body - will only run for hot1\n * }\n * });\n *\n * // local hook (has same effect as a callback)\n * hot2.addHook('afterChange', function() {\n * // function body - will only run in #example2\n * });\n * ```\n * ...\n */\n\n// @TODO: Move plugin description hooks to plugin?\nvar REGISTERED_HOOKS = [\n/**\n * Callback fired after resetting a cell's meta.\n *\n * @event Hooks#afterCellMetaReset\n * @since 0.11\n */\n'afterCellMetaReset',\n\n/**\n * @description\n * Callback fired after one or more cells has been changed. Its main use case is to save the input.\n *\n * __Note:__ For performance reasons, the `changes` array is null for `\"loadData\"` source.\n *\n * @event Hooks#afterChange\n * @param {Array} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterChange',\n\n/**\n * @description\n * Fired after observing changes.\n *\n * @event Hooks#afterChangesObserved\n */\n'afterChangesObserved',\n\n/**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @event Hooks#afterContextMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n'afterContextMenuDefaultOptions',\n\n/**\n * @description\n * Fired before setting up the Context Menu's items but after filtering these options by user (`contextMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @event Hooks#beforeContextMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Context Menu items.\n */\n'beforeContextMenuSetItems',\n\n/**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @pro\n * @event Hooks#afterDropdownMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n'afterDropdownMenuDefaultOptions',\n\n/**\n * @description\n * Fired before setting up the Dropdown Menu's items but after filtering these options by user (`dropdownMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @pro\n * @event Hooks#beforeDropdownMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Dropdown Menu items.\n */\n'beforeDropdownMenuSetItems',\n\n/**\n * @description\n * Fired after hiding the Context Menu.\n *\n * @event Hooks#afterContextMenuHide\n * @param {Object} context The Context menu instance.\n */\n'afterContextMenuHide',\n\n/**\n * @description\n * Fired after opening the Context Menu.\n *\n * @event Hooks#afterContextMenuShow\n * @param {Object} context The Context Menu instance.\n */\n'afterContextMenuShow',\n\n/**\n * @description\n * Fired after reaching the copy limit while copying data.\n *\n * @event Hooks#afterCopyLimit\n * @param {Number} selectedRows Count of selected copyable rows.\n * @param {Number} selectedColumns Count of selected copyable columns.\n * @param {Number} copyRowsLimit Current copy rows limit.\n * @param {Number} copyColumnsLimit Current copy columns limit.\n */\n'afterCopyLimit',\n\n/**\n * Callback is fired before a new column was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateCol\n * @param {Number} index Represents the index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeCreateCol',\n\n/**\n * Callback is fired after a new column was created.\n *\n * @event Hooks#afterCreateCol\n * @param {Number} index Represents the index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterCreateCol',\n\n/**\n * Callback is fired before a new row was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateRow\n * @param {Number} index Represents the index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeCreateRow',\n\n/**\n * Callback is fired after a new row was created.\n *\n * @event Hooks#afterCreateRow\n * @param {Number} index Represents the index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterCreateRow',\n\n/**\n * Fired after the current cell is deselected.\n *\n * @event Hooks#afterDeselect\n */\n'afterDeselect',\n\n/**\n * Fired after destroying the Handsontable instance.\n *\n * @event Hooks#afterDestroy\n */\n'afterDestroy',\n\n/**\n * Fired on a `keydown` event on the document body.\n *\n * @event Hooks#afterDocumentKeyDown\n * @param {Event} event A `keydown` event.\n */\n'afterDocumentKeyDown',\n\n/**\n * Callback fired after getting the cell settings.\n *\n * @event Hooks#afterGetCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} cellProperties Object containing the cell properties.\n */\n'afterGetCellMeta',\n\n/**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetColHeader\n * @param {Number} col Column index.\n * @param {Element} TH Header's TH element.\n */\n'afterGetColHeader',\n\n/**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetRowHeader\n * @param {Number} row Row index.\n * @param {Element} TH Header's TH element.\n */\n'afterGetRowHeader',\n\n/**\n * Callback fired after Handsontable instance is initiated.\n *\n * @event Hooks#afterInit\n */\n'afterInit',\n\n/**\n * Callback fired after new data is loaded (by `loadData` method) into the data source array.\n *\n * @event Hooks#afterLoadData\n * @param {Boolean} firstTime flag that determines whether the data has been loaded during the initialization.\n */\n'afterLoadData',\n\n/**\n * Fired after a scroll event, which is identified as a momentum scroll (e.g. on an iPad).\n *\n * @event Hooks#afterMomentumScroll\n */\n'afterMomentumScroll',\n\n/**\n * Fired after a `mousedown` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n */\n'afterOnCellCornerMouseDown',\n\n/**\n * Fired after a `dblclick` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerDblClick\n * @since 0.30.0\n * @param {Object} event `dblclick` event object.\n */\n'afterOnCellCornerDblClick',\n\n/**\n * Callback fired after clicking on a cell or row/column header.\n * In case the row/column header was clicked, the index is negative.\n * For example clicking on the row header of cell (0, 0) results with `afterOnCellMouseDown` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n * @param {Object} coords Coordinates object containing the row and column indexes of the clicked cell.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseDown',\n\n/**\n * Callback fired after hovering a cell or row/column header with the mouse cursor.\n * In case the row/column header was hovered, the index is negative.\n * For example, hovering over the row header of cell (0, 0) results with `afterOnCellMouseOver` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseOver\n * @since 0.11\n * @param {Object} event `mouseover` event object.\n * @param {Object} coords Hovered cell's coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseOver',\n\n/**\n * Callback fired after leaving a cell or row/column header with the mouse cursor.\n *\n * @event Hooks#afterOnCellMouseOver\n * @since 0.31.1\n * @param {Object} event `mouseout` event object.\n * @param {Object} coords Leaved cell's coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n'afterOnCellMouseOut',\n\n/**\n * Callback is fired when one or more columns are removed.\n *\n * @event Hooks#afterRemoveCol\n * @param {Number} index Is an index of starter column.\n * @param {Number} amount Is an amount of removed columns.\n */\n'afterRemoveCol',\n\n/**\n * Callback is fired when one or more rows are removed.\n *\n * @event Hooks#afterRemoveRow\n * @param {Number} index Is an index of starter row.\n * @param {Number} amount Is an amount of removed rows.\n */\n'afterRemoveRow',\n\n/**\n * Callback fired after the Handsontable table is rendered.\n *\n * @event Hooks#afterRender\n * @param {Boolean} isForced Is `true` if rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n'afterRender',\n\n/**\n * Fired before starting rendering the cell.\n *\n * @event Hooks#beforeRenderer\n * @since 0.24.2\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'beforeRenderer',\n\n/**\n * Fired after finishing rendering the cell (after the renderer finishes).\n *\n * @event Hooks#afterRenderer\n * @since 0.11.0\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'afterRenderer',\n\n/**\n * Fired after the horizontal scroll event.\n *\n * @event Hooks#afterScrollHorizontally\n * @since 0.11\n */\n'afterScrollHorizontally',\n\n/**\n * Fired after the vertical scroll event.\n *\n * @event Hooks#afterScrollVertically\n * @since 0.11\n */\n'afterScrollVertically',\n\n/**\n * Callback fired after one or more cells are selected (e.g. during mouse move).\n *\n * @event Hooks#afterSelection\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * * @example\n * ```js\n * handsontable({\n * afterSelection: function (r, c, r2, c2, preventScrolling) {\n * // setting if prevent scrolling after selection\n *\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n'afterSelection',\n\n/**\n * Callback fired after one or more cells are selected. The `p` argument represents the source object property name instead of the column number.\n *\n * @event Hooks#afterSelectionByProp\n * @param {Number} r Selection start row index.\n * @param {String} p Selection start data source object property name.\n * @param {Number} r2 Selection end row index.\n * @param {String} p2 Selection end data source object property name.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * * @example\n * ```js\n * handsontable({\n * afterSelectionByProp: function (r, c, r2, c2, preventScrolling) {\n * // setting if prevent scrolling after selection\n *\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n'afterSelectionByProp',\n\n/**\n * Callback fired after one or more cells are selected (e.g. on mouse up).\n *\n * @event Hooks#afterSelectionEnd\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n */\n'afterSelectionEnd',\n\n/**\n * Callback fired after one or more cells are selected (e.g. on mouse up). The `p` argument represents the data source object\n * property name instead of the column number.\n *\n * @event Hooks#afterSelectionEndByProp\n * @param {Number} r Selection start row index.\n * @param {String} p Selection start data source object property index.\n * @param {Number} r2 Selection end row index.\n * @param {String} p2 Selection end data source object property index.\n */\n'afterSelectionEndByProp',\n\n/**\n * Called after cell meta is changed.\n *\n * @event Hooks#afterSetCellMeta\n * @since 0.11.0\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key The updated meta key.\n * @param {*} value The updated meta value.\n */\n'afterSetCellMeta',\n\n/**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtCell\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, col, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterSetDataAtCell',\n\n/**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtRowProp\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, prop, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterSetDataAtRowProp',\n\n/**\n * Fired after calling the `updateSettings` method.\n *\n * @event Hooks#afterUpdateSettings\n */\n'afterUpdateSettings',\n\n/**\n * @description\n * A plugin hook executed after validator function, only if validator function is defined.\n * Validation result is the first parameter. This can be used to determinate if validation passed successfully or not.\n *\n * __Returning false from the callback will mark the cell as invalid.__\n *\n * @event Hooks#afterValidate\n * @since 0.9.5\n * @param {Boolean} isValid `true` if valid, `false` if not.\n * @param {*} value The value in question.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'afterValidate',\n\n/**\n * Fired before populating the data in the autofill feature.\n *\n * @event Hooks#beforeAutofill\n * @param {Object} start Object containing information about first filled cell: `{row: 2, col: 0}`.\n * @param {Object} end Object containing information about last filled cell: `{row: 4, col: 1}`.\n * @param {Array} data 2D array containing information about fill pattern: `[[\"1', \"Ted\"], [\"1', \"John\"]]`.\n */\n'beforeAutofill',\n\n/**\n * Fired before aligning the cell contents.\n *\n * @event Hooks#beforeCellAlignment\n * @param stateBefore\n * @param range\n * @param {String} type Type of the alignment - either `horizontal` or `vertical`\n * @param {String} alignmentClass String defining the alignment class added to the cell.\n * Possible values:\n * * `htLeft`,\n * * `htCenter`,\n * * `htRight`,\n * * `htJustify`\n * for horizontal alignment,\n *\n *\n * * `htTop`,\n * * `htMiddle`,\n * * `htBottom`\n * for vertical alignment.\n */\n'beforeCellAlignment',\n\n/**\n * Callback fired before one or more cells is changed. Its main purpose is to alter changes silently before input.\n *\n * @event Hooks#beforeChange\n * @param {Array} changes 2D array containing information about each of the edited cells.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n * @example\n * ```js\n * // To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0] = null;\n * }\n * });\n * ...\n *\n * // To alter a single change, overwrite the desired value to changes[i][3].\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0][3] = 10;\n * }\n * });\n * ...\n *\n * // To cancel all edit, return false from the callback or set array length to 0 (changes.length = 0).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeChange',\n\n/**\n * Fired right before rendering the changes.\n *\n * @event Hooks#beforeChangeRender\n * @since 0.11\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue].\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeChangeRender',\n\n/**\n * Fired before drawing the borders.\n *\n * @event Hooks#beforeDrawBorders\n * @param {Array} corners Array specifying the current selection borders.\n * @param {String} borderClassName Specifies the border class name.\n */\n'beforeDrawBorders',\n\n/**\n * Callback fired before getting cell settings.\n *\n * @event Hooks#beforeGetCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n'beforeGetCellMeta',\n\n/**\n * @description\n * Callback fired before Handsontable instance is initiated.\n *\n * @event Hooks#beforeInit\n */\n'beforeInit',\n\n/**\n * Callback fired before Walkontable instance is initiated.\n *\n * @since 0.11\n * @event Hooks#beforeInitWalkontable\n * @param {Object} walkontableConfig Walkontable configuration object.\n */\n'beforeInitWalkontable',\n\n/**\n * Callback fired before keydown event is handled. It can be used to overwrite default key bindings.\n * Caution - in your `beforeKeyDown` handler you need to call `event.stopImmediatePropagation()` to prevent default key behavior.\n *\n * @event Hooks#beforeKeyDown\n * @since 0.9.0\n * @param {Event} event Original DOM event.\n */\n'beforeKeyDown',\n\n/**\n * Fired after the user clicked a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseDown\n * @param {Event} event The `mousedown` event object.\n * @param {CellCoords} coords CellCoords object containing the coordinates of the clicked cell.\n * @param {Element} TD TD element.\n */\n'beforeOnCellMouseDown',\n\n/**\n * Fired after the user moved cursor over a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOver\n * @param {Event} event The `mouseover` event object.\n * @param {CellCoords} coords CellCoords object containing the coordinates of the clicked cell.\n * @param {Element} TD TD element.\n * @param {Object} blockCalculations Contain keys 'row' and 'column' with boolean value.\n */\n'beforeOnCellMouseOver',\n\n/**\n * Fired after the user moved cursor out from a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOut\n * @since 0.31.1\n * @param {Event} event The `mouseout` event object.\n * @param {WalkontableCellCoords} coords WalkontableCellCoords object containing the coordinates of the leaved cell.\n * @param {Element} TD TD element.\n */\n'beforeOnCellMouseOut',\n\n/**\n * Callback is fired when one or more columns are about to be removed.\n *\n * @event Hooks#beforeRemoveCol\n * @param {Number} index Index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [logicalCols] Consists of logical indexes of processed columns.\n */\n'beforeRemoveCol',\n\n/**\n * Callback is fired when one or more rows are about to be removed.\n *\n * @event Hooks#beforeRemoveRow\n * @param {Number} index Index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [logicalRows] Consists of logical indexes of processed rows.\n */\n'beforeRemoveRow',\n\n/**\n * Callback fired before Handsontable table is rendered.\n *\n * @event Hooks#beforeRender\n * @param {Boolean} isForced If `true` rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n'beforeRender',\n\n/**\n * Callback fired before setting range is started.\n *\n * @event Hooks#beforeSetRangeStart\n * @param {Array} coords CellCoords array.\n */\n'beforeSetRangeStart',\n\n/**\n * Callback fired before setting range is ended.\n *\n * @event Hooks#beforeSetRangeEnd\n * @param {Array} coords CellCoords array.\n */\n'beforeSetRangeEnd',\n\n/**\n * Fired before the logic of handling a touch scroll, when user started scrolling on a touch-enabled device.\n *\n * @event Hooks#beforeTouchScroll\n */\n'beforeTouchScroll',\n\n/**\n * @description\n * A plugin hook executed before validator function, only if validator function is defined.\n * This can be used to manipulate the value of changed cell before it is applied to the validator function.\n *\n * __Notice:__ this will not affect values of changes. This will change value ONLY for validation!\n *\n * @event Hooks#beforeValidate\n * @since 0.9.5\n * @param {*} value Value of the cell.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n'beforeValidate',\n\n/**\n * Callback fired before cell value is rendered into the DOM (through renderer function).\n *\n * @event Hooks#beforeValueRender\n * @since 0.29.0\n * @param {*} value Cell value to render.\n */\n'beforeValueRender',\n\n/**\n * Callback fired after Handsontable instance is constructed (via `new` operator).\n *\n * @event Hooks#construct\n * @since 0.16.1\n */\n'construct',\n\n/**\n * Callback fired after Handsontable instance is initiated but before table is rendered.\n *\n * @event Hooks#init\n * @since 0.16.1\n */\n'init',\n\n/**\n * Fired when a column index is about to be modified by a callback function.\n *\n * @event Hooks#modifyCol\n * @since 0.11\n * @param {Number} col Column index.\n */\n'modifyCol',\n\n/**\n * Fired when a column index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyCol\n * @since 0.23.0\n * @param {Number} col Column index.\n */\n'unmodifyCol',\n\n/**\n * Fired when a row index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyRow\n * @since 0.26.2\n * @param {Number} row Logical row index.\n */\n'unmodifyRow',\n/**\n * Fired when a column header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyColHeader\n * @since 0.20.0\n * @param {Number} column Column header index.\n */\n'modifyColHeader',\n\n/**\n * Fired when a column width is about to be modified by a callback function.\n *\n * @event Hooks#modifyColWidth\n * @since 0.11\n * @param {Number} width Current column width.\n * @param {Number} col Column index.\n */\n'modifyColWidth',\n\n/**\n * Fired when a row index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRow\n * @since 0.11\n * @param {Number} row Row index.\n */\n'modifyRow',\n\n/**\n * Fired when a row header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeader\n * @since 0.20.0\n * @param {Number} row Row header index.\n */\n'modifyRowHeader',\n\n/**\n * Fired when a row height is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeight\n * @since 0.11.0\n * @param {Number} height Row height.\n * @param {Number} row Row index.\n */\n'modifyRowHeight',\n\n/**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyData\n * @since 0.28.0\n * @param {Number} row Row height.\n * @param {Number} column Column index.\n * @param {Object} valueHolder Object which contains original value which can be modified by overwriting `.value` property.\n * @param {String} ioMode String which indicates for what operation hook is fired (`get` or `set`).\n */\n'modifyData',\n\n/**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyRowSourceData\n * @since 0.28.0\n * @param {Number} row Row logical index.\n */\n'modifyRowData',\n\n/**\n * Fired after loading data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateLoad\n * @param {String} key Key string.\n * @param {Object} valuePlaceholder Object containing the loaded data.\n */\n'persistentStateLoad',\n\n/**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateReset\n * @param {String} key Key string.\n */\n'persistentStateReset',\n\n/**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateSave\n * @param {String} key Key string.\n * @param {Mixed} value Value to save.\n */\n'persistentStateSave',\n\n/**\n * Fired before sorting the column. If you return `false` value then sorting will be not applied by\n * Handsontable (useful for server-side sorting).\n *\n * @event Hooks#beforeColumnSort\n * @param {Number} column Sorted column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order,\n * * `false` means descending order,\n * * `undefined` means original order.\n */\n'beforeColumnSort',\n\n/**\n * Fired after sorting the column.\n *\n * @event Hooks#afterColumnSort\n * @param {Number} column Sorted column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order\n * * `false` means descending order\n * * `undefined` means original order\n */\n'afterColumnSort',\n\n/**\n * @description\n * Fired after setting range of autofill.\n * Both arguments are provided in the following format:\n * ```js\n * [startRow, startColumn, endRow, endColumn]\n * ```\n *\n * @event Hooks#modifyAutofillRange\n * @param {Array} startArea Array of coordinates of the starting point for the drag-down operation.\n * @param {Array} entireArea Array of coordinates of the entire area of the drag-down operation.\n */\n'modifyAutofillRange',\n\n/**\n * Fired to allow modifying the copyable range with a callback function.\n *\n * @since 0.19.0\n * @event Hooks#modifyCopyableRange\n * @param {Array} copyableRanges Array of objects defining copyable cells.\n */\n'modifyCopyableRange',\n\n/**\n * Called before copying the values into clipboard and before clearing values of the selected cells.\n *\n * @event Hooks#beforeCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to cut.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will be cut out.\n * @returns {*} If returns `false` then operation of the cutting out is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel cutting out, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeCut',\n\n/**\n * Fired after data are cutted out from the table.\n *\n * @event Hooks#afterCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the cutted out data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was cut out.\n */\n'afterCut',\n\n/**\n * Fired before values are copied into clipboard.\n *\n * @event Hooks#beforeCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to copied.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will copied.\n * @returns {*} If returns `false` then copying is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel copying, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforeCopy',\n\n/**\n * Fired after data are pasted into table.\n *\n * @event Hooks#afterCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the copied data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was copied.\n */\n'afterCopy',\n\n/**\n * Fired before values are pasted into table.\n *\n * @event Hooks#beforePaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to paste.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * where changes will be inserted.\n * @returns {*} If returns `false` then pasting is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel pasting, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n'beforePaste',\n\n/**\n * Fired after values are pasted into table.\n *\n * @event Hooks#afterePaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the pasted data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * where changes was inserted.\n */\n'afterPaste',\n\n/**\n * Fired before change order of the logical indexes.\n *\n * @event Hooks#beforeColumnMove\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n'beforeColumnMove',\n\n/**\n * Fired after change order of the logical indexes.\n *\n * @event Hooks#afterColumnMove\n * @param {Array} columns Array of visual column indexes that were moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n'afterColumnMove',\n\n/**\n * Fired before change order of the logical indexes.\n *\n * @event Hooks#beforeRowMove\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n'beforeRowMove',\n\n/**\n * Fired after change order of the logical indexes.\n *\n * @event Hooks#afterRowMove\n * @param {Array} rows Array of visual row indexes that were moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n'afterRowMove',\n\n/**\n * Fired before rendering the table with modified column sizes.\n *\n * @event Hooks#beforeColumnResize\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns a new column size or `undefined`, if column size should be calculated automatically.\n */\n'beforeColumnResize',\n\n/**\n * Fired after rendering the table with modified column sizes.\n *\n * @event Hooks#afterColumnResize\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n'afterColumnResize',\n\n/**\n * Fired before rendering the table with modified row sizes.\n *\n * @event Hooks#beforeRowResize\n * @param {Number} currentRow Index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns the new row size or `undefined` if row size should be calculated automatically.\n */\n'beforeRowResize',\n\n/**\n * Fired after rendering the table with modified row sizes.\n *\n * @event Hooks#afterRowResize\n * @param {Number} currentRow Index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n'afterRowResize',\n\n/**\n * Fired after getting the column header renderers.\n *\n * @event Hooks#afterGetColumnHeaderRenderers\n * @param {Array} array Array of the column header renderers.\n */\n'afterGetColumnHeaderRenderers',\n\n/**\n * Fired after getting the row header renderers.\n *\n * @event Hooks#afterGetRowHeaderRenderers\n * @param {Array} array Array of the row header renderers.\n */\n'afterGetRowHeaderRenderers',\n\n/**\n * Fired before applying stretched column width to column.\n *\n * @event Hooks#beforeStretchingColumnWidth\n * @param {Number} stretchedWidth Calculated width.\n * @param {Number} column Column index.\n * @returns {Number} Returns new width which will be applied to the column element.\n */\n'beforeStretchingColumnWidth',\n\n/**\n * Fired before applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#beforeFilter\n * @param {Array} formulasStack An array of objects with added formulas.\n * @returns {Boolean} If hook returns `false` value then filtering won't be applied on the UI side (server-side filtering).\n */\n'beforeFilter',\n\n/**\n * Fired after applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#afterFilter\n * @param {Array} formulasStack An array of objects with added formulas.\n */\n'afterFilter',\n\n/**\n * Used to modify the column header height.\n *\n * @event Hooks#modifyColumnHeaderHeight\n * @since 0.25.0\n * @param {Number} col Column index.\n */\n'modifyColumnHeaderHeight',\n\n/**\n * Fired before the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#beforeUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'beforeUndo',\n\n/**\n * Fired after the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#afterUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'afterUndo',\n\n/**\n * Fired before the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#beforeRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'beforeRedo',\n\n/**\n * Fired after the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#afterRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n'afterRedo',\n\n/**\n * Used to modify the row header width.\n *\n * @event Hooks#modifyRowHeaderWidth\n * @param {Number} rowHeaderWidth Row header width.\n */\n'modifyRowHeaderWidth',\n\n/**\n * Fired from the `populateFromArray` method during the `autofill` process. Fired for each \"autofilled\" cell individually.\n *\n * @event Hooks#beforeAutofillInsidePopulate\n * @param {Object} index Object containing `row` and `col` properties, defining the number of rows/columns from the initial cell of the autofill.\n * @param {String} direction Declares the direction of the autofill. Possible values: `up`, `down`, `left`, `right`.\n * @param {Array} input Array of arrays. Contains an array of rows with data being used in the autofill.\n * @param {Array} deltas The deltas array passed to the `populateFromArray` method.\n */\n'beforeAutofillInsidePopulate',\n\n/**\n * Fired when the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformStart\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n'modifyTransformStart',\n\n/**\n * Fired when the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformEnd\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n'modifyTransformEnd',\n\n/**\n * Fired after the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformStart\n * @param {CellCoords} coords Coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n'afterModifyTransformStart',\n\n/**\n * Fired after the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformEnd\n * @param {CellCoords} coords Coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n'afterModifyTransformEnd',\n\n/**\n * Fired before rendering a cell value.\n *\n * @event Hooks#beforeValueRender\n * @param {Mixed} value The rendered value.\n */\n'beforeValueRender',\n\n/**\n * Fired inside the `viewportRowCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportRowCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n'afterViewportRowCalculatorOverride',\n\n/**\n * Fired inside the `viewportColumnCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportColumnCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n'afterViewportColumnCalculatorOverride',\n\n/**\n * Fired after initializing all the plugins.\n *\n * @event Hooks#afterPluginsInitialized\n */\n'afterPluginsInitialized',\n\n/**\n * Used when saving/loading the manual row heights state.\n *\n * @event Hooks#manualRowHeights\n * @param {Array} state The current manual row heights state.\n */\n'manualRowHeights',\n\n/**\n * Used to skip the length cache calculation for a defined period of time.\n *\n * @event Hooks#skipLengthCache\n * @param {Number} delay The delay in milliseconds.\n */\n'skipLengthCache',\n\n/**\n * Fired after trimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterTrimRow\n * @param {Array} rows Indexes of trimmed rows.\n */\n'afterTrimRow',\n\n/**\n * Fired after untrimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterUntrimRow\n * @param {Array} rows Indexes of untrimmed rows.\n */\n'afterUntrimRow',\n\n/**\n * Fired after opening the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuShow\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n'afterDropdownMenuShow',\n\n/**\n * Fired after hiding the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuHide\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n'afterDropdownMenuHide',\n\n/**\n * Used to check whether the provided row index is hidden.\n *\n * @pro\n * @event Hooks#hiddenRow\n * @param {Number} row The row index in question.\n */\n'hiddenRow',\n\n/**\n * Used to check whether the provided column index is hidden.\n *\n * @pro\n * @event Hooks#hiddenColumn\n * @param {Number} column The column index in question.\n */\n'hiddenColumn',\n\n/**\n * Fired before adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#beforeAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n'beforeAddChild',\n\n/**\n * Fired after adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#afterAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n'afterAddChild',\n\n/**\n * Fired before detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#beforeDetachChild\n * @param {Object} parent An object representing the parent from which the element is to be detached.\n * @param {Object} element The detached element.\n */\n'beforeDetachChild',\n\n/**\n * Fired after detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#afterDetachChild\n * @param {Object} parent An object representing the parent from which the element was detached.\n * @param {Object} element The detached element.\n */\n'afterDetachChild',\n\n/**\n * Fired after the editor is opened and rendered.\n *\n * @event Hooks#afterBeginEditing\n * @param {Number} row Row index of the edited cell.\n * @param {Number} column Column index of the edited cell.\n */\n'afterBeginEditing'];\n\nvar Hooks = function () {\n _createClass(Hooks, null, [{\n key: 'getSingleton',\n value: function getSingleton() {\n return globalSingleton;\n }\n\n /**\n *\n */\n\n }]);\n\n function Hooks() {\n _classCallCheck(this, Hooks);\n\n this.globalBucket = this.createEmptyBucket();\n }\n\n /**\n * Returns a new object with empty handlers related to every registered hook name.\n *\n * @returns {Object} The empty bucket object.\n *\n * @example\n * ```js\n * Handsontable.hooks.createEmptyBucket();\n * // Results:\n * {\n * ...\n * afterCreateCol: [],\n * afterCreateRow: [],\n * beforeInit: [],\n * ...\n * }\n * ```\n */\n\n\n _createClass(Hooks, [{\n key: 'createEmptyBucket',\n value: function createEmptyBucket() {\n var bucket = Object.create(null);\n\n (0, _array.arrayEach)(REGISTERED_HOOKS, function (hook) {\n return bucket[hook] = [];\n });\n\n return bucket;\n }\n\n /**\n * Get hook bucket based on the context of the object or if argument is `undefined`, get the global hook bucket.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Object} Returns a global or Handsontable instance bucket.\n */\n\n }, {\n key: 'getBucket',\n value: function getBucket() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (context) {\n if (!context.pluginHookBucket) {\n context.pluginHookBucket = this.createEmptyBucket();\n }\n\n return context.pluginHookBucket;\n }\n\n return this.globalBucket;\n }\n\n /**\n * Adds a listener (globally or locally) to a specified hook name.\n * If the `context` parameter is provided, the hook will be added only to the instance it references.\n * Otherwise, the callback will be used everytime the hook fires on any Handsontable instance.\n * You can provide an array of callback functions as the `callback` argument, this way they will all be fired\n * once the hook is triggered.\n *\n * @see Core#addHook\n * @param {String} key Hook name.\n * @param {Function|Array} callback Callback function or an array of functions.\n * @param {Object} [context=null] The context for the hook callback to be added - a Handsontable instance or leave empty.\n * @returns {Hooks} Instance of Hooks.\n *\n * @example\n * ```js\n * // single callback, added locally\n * Handsontable.hooks.add('beforeInit', myCallback, hotInstance);\n *\n * // single callback, added globally\n * Handsontable.hooks.add('beforeInit', myCallback);\n *\n * // multiple callbacks, added locally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback], hotInstance);\n *\n * // multiple callbacks, added globally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback]);\n * ```\n */\n\n }, {\n key: 'add',\n value: function add(key, callback) {\n var _this = this;\n\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (Array.isArray(callback)) {\n (0, _array.arrayEach)(callback, function (c) {\n return _this.add(key, c, context);\n });\n } else {\n var bucket = this.getBucket(context);\n\n if (typeof bucket[key] === 'undefined') {\n this.register(key);\n bucket[key] = [];\n }\n callback.skip = false;\n\n if (bucket[key].indexOf(callback) === -1) {\n // only add a hook if it has not already been added (adding the same hook twice is now silently ignored)\n var foundInitialHook = false;\n\n if (callback.initialHook) {\n (0, _array.arrayEach)(bucket[key], function (cb, i) {\n if (cb.initialHook) {\n bucket[key][i] = callback;\n foundInitialHook = true;\n\n return false;\n }\n });\n }\n\n if (!foundInitialHook) {\n bucket[key].push(callback);\n }\n }\n }\n\n return this;\n }\n\n /**\n * Adds a listener to a specified hook. After the hook runs this listener will be automatically removed from the bucket.\n *\n * @see Core#addHookOnce\n * @param {String} key Hook/Event name.\n * @param {Function|Array} callback Callback function.\n * @param {Object} [context=null] A Handsontable instance.\n *\n * @example\n * ```js\n * Handsontable.hooks.once('beforeInit', myCallback, hotInstance);\n * ```\n */\n\n }, {\n key: 'once',\n value: function once(key, callback) {\n var _this2 = this;\n\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (Array.isArray(callback)) {\n (0, _array.arrayEach)(callback, function (c) {\n return _this2.once(key, c, context);\n });\n } else {\n callback.runOnce = true;\n this.add(key, callback, context);\n }\n }\n\n /**\n * Removes a listener from a hook with a given name. If the `context` argument is provided, it removes a listener from a local hook assigned to the given Handsontable instance.\n *\n * @see Core#removeHook\n * @param {String} key Hook/Event name.\n * @param {Function} callback Callback function (needs the be the function that was previously added to the hook).\n * @param {Object} [context=null] Handsontable instance.\n * @return {Boolean} Returns `true` if hook was removed, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.remove('beforeInit', myCallback);\n * ```\n */\n\n }, {\n key: 'remove',\n value: function remove(key, callback) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n var bucket = this.getBucket(context);\n\n if (typeof bucket[key] !== 'undefined') {\n if (bucket[key].indexOf(callback) >= 0) {\n callback.skip = true;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Checks whether there are any registered listeners for the provided hook name.\n * If the `context` parameter is provided, it only checks for listeners assigned to the given Handsontable instance.\n *\n * @param {String} key Hook name.\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Boolean} `true` for success, `false` otherwise.\n */\n\n }, {\n key: 'has',\n value: function has(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var bucket = this.getBucket(context);\n\n return !!(bucket[key] !== void 0 && bucket[key].length);\n }\n\n /**\n * Runs all local and global callbacks assigned to the hook identified by the `key` parameter.\n * It returns either a return value from the last called callback or the first parameter (`p1`) passed to the `run` function.\n *\n * @see Core#runHooks\n * @param {Object} context Handsontable instance.\n * @param {String} key Hook/Event name.\n * @param {*} [p1] Parameter to be passed as an argument to the callback function.\n * @param {*} [p2] Parameter to be passed as an argument to the callback function.\n * @param {*} [p3] Parameter to be passed as an argument to the callback function.\n * @param {*} [p4] Parameter to be passed as an argument to the callback function.\n * @param {*} [p5] Parameter to be passed as an argument to the callback function.\n * @param {*} [p6] Parameter to be passed as an argument to the callback function.\n * @returns {*} Either a return value from the last called callback or `p1`.\n *\n * @example\n * ```js\n * Handsontable.hooks.run(hot, 'beforeInit');\n * ```\n */\n\n }, {\n key: 'run',\n value: function run(context, key, p1, p2, p3, p4, p5, p6) {\n {\n var globalHandlers = this.globalBucket[key];\n var index = -1;\n var length = globalHandlers ? globalHandlers.length : 0;\n\n if (length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++index < length) {\n if (!globalHandlers[index] || globalHandlers[index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n var res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (res !== void 0) {\n p1 = res;\n }\n if (globalHandlers[index] && globalHandlers[index].runOnce) {\n this.remove(key, globalHandlers[index]);\n }\n }\n }\n }\n {\n var localHandlers = this.getBucket(context)[key];\n var _index = -1;\n var _length = localHandlers ? localHandlers.length : 0;\n\n if (_length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++_index < _length) {\n if (!localHandlers[_index] || localHandlers[_index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n var _res = localHandlers[_index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (_res !== void 0) {\n p1 = _res;\n }\n if (localHandlers[_index] && localHandlers[_index].runOnce) {\n this.remove(key, localHandlers[_index], context);\n }\n }\n }\n }\n\n return p1;\n }\n\n /**\n * Destroy all listeners connected to the context. If no context is provided, the global listeners will be destroyed.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @example\n * ```js\n * // destroy the global listeners\n * Handsontable.hooks.destroy();\n *\n * // destroy the local listeners\n * Handsontable.hooks.destroy(hotInstance);\n * ```\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n (0, _object.objectEach)(this.getBucket(context), function (value, key, bucket) {\n return bucket[key].length = 0;\n });\n }\n\n /**\n * Registers a hook name (adds it to the list of the known hook names). Used by plugins.\n * It is not necessary to call register, but if you use it, your plugin hook will be used returned by\n * the `getRegistered` method. (which itself is used in the demo http://docs.handsontable.com/tutorial-callbacks.html).\n *\n * @param key {String} The hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.register('myHook');\n * ```\n */\n\n }, {\n key: 'register',\n value: function register(key) {\n if (!this.isRegistered(key)) {\n REGISTERED_HOOKS.push(key);\n }\n }\n\n /**\n * Deregisters a hook name (removes it from the list of known hook names).\n *\n * @param key {String} Hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.deregister('myHook');\n * ```\n */\n\n }, {\n key: 'deregister',\n value: function deregister(key) {\n if (this.isRegistered(key)) {\n REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1);\n }\n }\n\n /**\n * Returns a boolean depending on if a hook by such name has been registered.\n *\n * @param key {String} Hook name.\n * @returns {Boolean} `true` for success, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.isRegistered('beforeInit');\n *\n * // Results:\n * true\n * ```\n */\n\n }, {\n key: 'isRegistered',\n value: function isRegistered(key) {\n return REGISTERED_HOOKS.indexOf(key) >= 0;\n }\n\n /**\n * Returns an array of registered hooks.\n *\n * @returns {Array} An array of registered hooks.\n *\n * @example\n * ```js\n * Handsontable.hooks.getRegistered();\n *\n * // Results:\n * [\n * ...\n * 'beforeInit',\n * 'beforeRender',\n * 'beforeSetRangeEnd',\n * 'beforeDrawBorders',\n * 'beforeChange',\n * ...\n * ]\n * ```\n */\n\n }, {\n key: 'getRegistered',\n value: function getRegistered() {\n return REGISTERED_HOOKS;\n }\n }]);\n\n return Hooks;\n}();\n\nvar globalSingleton = new Hooks();\n\nexports.default = Hooks;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredRenderers = exports.getRegisteredRendererNames = exports.hasRenderer = exports.getRenderer = exports.registerRenderer = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _cellDecorator = __webpack_require__(260);\n\nvar _cellDecorator2 = _interopRequireDefault(_cellDecorator);\n\nvar _autocompleteRenderer = __webpack_require__(261);\n\nvar _autocompleteRenderer2 = _interopRequireDefault(_autocompleteRenderer);\n\nvar _checkboxRenderer = __webpack_require__(262);\n\nvar _checkboxRenderer2 = _interopRequireDefault(_checkboxRenderer);\n\nvar _htmlRenderer = __webpack_require__(263);\n\nvar _htmlRenderer2 = _interopRequireDefault(_htmlRenderer);\n\nvar _numericRenderer = __webpack_require__(264);\n\nvar _numericRenderer2 = _interopRequireDefault(_numericRenderer);\n\nvar _passwordRenderer = __webpack_require__(265);\n\nvar _passwordRenderer2 = _interopRequireDefault(_passwordRenderer);\n\nvar _textRenderer = __webpack_require__(266);\n\nvar _textRenderer2 = _interopRequireDefault(_textRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('renderers'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\nregister('base', _cellDecorator2.default);\nregister('autocomplete', _autocompleteRenderer2.default);\nregister('checkbox', _checkboxRenderer2.default);\nregister('html', _htmlRenderer2.default);\nregister('numeric', _numericRenderer2.default);\nregister('password', _passwordRenderer2.default);\nregister('text', _textRenderer2.default);\n\n/**\n * Retrieve renderer function.\n *\n * @param {String} name Renderer identification.\n * @returns {Function} Returns renderer function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error('No registered renderer found under \"' + name + '\" name');\n }\n\n return getItem(name);\n}\n\nexports.registerRenderer = register;\nexports.getRenderer = _getItem;\nexports.hasRenderer = hasItem;\nexports.getRegisteredRendererNames = getNames;\nexports.getRegisteredRenderers = getValues;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar store = __webpack_require__(82)('wks')\n , uid = __webpack_require__(49)\n , Symbol = __webpack_require__(13).Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.Viewport = exports.TableRenderer = exports.Table = exports.Settings = exports.Selection = exports.Scroll = exports.Overlays = exports.Event = exports.Core = exports.default = exports.Border = exports.TopLeftCornerOverlay = exports.TopOverlay = exports.LeftOverlay = exports.DebugOverlay = exports.RowFilter = exports.ColumnFilter = exports.CellRange = exports.CellCoords = exports.ViewportRowsCalculator = exports.ViewportColumnsCalculator = undefined;\n\n__webpack_require__(96);\n\n__webpack_require__(113);\n\n__webpack_require__(122);\n\n__webpack_require__(123);\n\n__webpack_require__(107);\n\n__webpack_require__(121);\n\n__webpack_require__(104);\n\n__webpack_require__(105);\n\n__webpack_require__(106);\n\n__webpack_require__(95);\n\n__webpack_require__(118);\n\n__webpack_require__(116);\n\n__webpack_require__(114);\n\n__webpack_require__(119);\n\n__webpack_require__(120);\n\n__webpack_require__(115);\n\n__webpack_require__(117);\n\n__webpack_require__(108);\n\n__webpack_require__(109);\n\n__webpack_require__(110);\n\n__webpack_require__(112);\n\n__webpack_require__(111);\n\n__webpack_require__(93);\n\n__webpack_require__(94);\n\n__webpack_require__(89);\n\n__webpack_require__(92);\n\n__webpack_require__(91);\n\n__webpack_require__(90);\n\n__webpack_require__(68);\n\n__webpack_require__(98);\n\n__webpack_require__(99);\n\n__webpack_require__(101);\n\n__webpack_require__(100);\n\n__webpack_require__(97);\n\n__webpack_require__(103);\n\n__webpack_require__(102);\n\n__webpack_require__(124);\n\n__webpack_require__(127);\n\n__webpack_require__(125);\n\n__webpack_require__(126);\n\n__webpack_require__(129);\n\n__webpack_require__(128);\n\n__webpack_require__(131);\n\n__webpack_require__(130);\n\nvar _viewportColumns = __webpack_require__(135);\n\nvar _viewportColumns2 = _interopRequireDefault(_viewportColumns);\n\nvar _viewportRows = __webpack_require__(136);\n\nvar _viewportRows2 = _interopRequireDefault(_viewportRows);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _column = __webpack_require__(139);\n\nvar _column2 = _interopRequireDefault(_column);\n\nvar _row = __webpack_require__(140);\n\nvar _row2 = _interopRequireDefault(_row);\n\nvar _debug = __webpack_require__(185);\n\nvar _debug2 = _interopRequireDefault(_debug);\n\nvar _left = __webpack_require__(186);\n\nvar _left2 = _interopRequireDefault(_left);\n\nvar _top = __webpack_require__(187);\n\nvar _top2 = _interopRequireDefault(_top);\n\nvar _topLeftCorner = __webpack_require__(188);\n\nvar _topLeftCorner2 = _interopRequireDefault(_topLeftCorner);\n\nvar _border = __webpack_require__(134);\n\nvar _border2 = _interopRequireDefault(_border);\n\nvar _core = __webpack_require__(137);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _event = __webpack_require__(138);\n\nvar _event2 = _interopRequireDefault(_event);\n\nvar _overlays = __webpack_require__(141);\n\nvar _overlays2 = _interopRequireDefault(_overlays);\n\nvar _scroll = __webpack_require__(142);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _selection = __webpack_require__(189);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _settings = __webpack_require__(143);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _table = __webpack_require__(144);\n\nvar _table2 = _interopRequireDefault(_table);\n\nvar _tableRenderer = __webpack_require__(145);\n\nvar _tableRenderer2 = _interopRequireDefault(_tableRenderer);\n\nvar _viewport = __webpack_require__(146);\n\nvar _viewport2 = _interopRequireDefault(_viewport);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.ViewportColumnsCalculator = _viewportColumns2.default;\nexports.ViewportRowsCalculator = _viewportRows2.default;\nexports.CellCoords = _coords2.default;\nexports.CellRange = _range2.default;\nexports.ColumnFilter = _column2.default;\nexports.RowFilter = _row2.default;\nexports.DebugOverlay = _debug2.default;\nexports.LeftOverlay = _left2.default;\nexports.TopOverlay = _top2.default;\nexports.TopLeftCornerOverlay = _topLeftCorner2.default;\nexports.Border = _border2.default;\nexports.default = _core2.default;\nexports.Core = _core2.default;\nexports.Event = _event2.default;\nexports.Overlays = _overlays2.default;\nexports.Scroll = _scroll2.default;\nexports.Selection = _selection2.default;\nexports.Settings = _settings2.default;\nexports.Table = _table2.default;\nexports.TableRenderer = _tableRenderer2.default;\nexports.Viewport = _viewport2.default;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _recordTranslator = __webpack_require__(153);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\nvar initializedPlugins = null;\n\n/**\n * @private\n */\n\nvar BasePlugin = function () {\n /**\n * @param {Object} hotInstance Handsontable instance.\n */\n function BasePlugin(hotInstance) {\n var _this = this;\n\n _classCallCheck(this, BasePlugin);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n (0, _object.defineGetter)(this, 'hot', hotInstance, {\n writable: false\n });\n (0, _object.defineGetter)(this, 't', (0, _recordTranslator.getTranslator)(hotInstance), {\n writable: false\n });\n\n privatePool.set(this, { hooks: {} });\n initializedPlugins = null;\n\n this.pluginName = null;\n this.pluginsInitializedCallbacks = [];\n this.isPluginsReady = false;\n this.enabled = false;\n this.initialized = false;\n\n this.hot.addHook('afterPluginsInitialized', function () {\n return _this.onAfterPluginsInitialized();\n });\n this.hot.addHook('afterUpdateSettings', function () {\n return _this.onUpdateSettings();\n });\n this.hot.addHook('beforeInit', function () {\n return _this.init();\n });\n }\n\n _createClass(BasePlugin, [{\n key: 'init',\n value: function init() {\n this.pluginName = (0, _plugins.getPluginName)(this.hot, this);\n\n if (this.isEnabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (!initializedPlugins) {\n initializedPlugins = (0, _plugins.getRegistredPluginNames)(this.hot);\n }\n if (initializedPlugins.indexOf(this.pluginName) >= 0) {\n initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);\n }\n if (!initializedPlugins.length) {\n this.hot.runHooks('afterPluginsInitialized');\n }\n this.initialized = true;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n this.enabled = true;\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n if (this.eventManager) {\n this.eventManager.clear();\n }\n this.clearHooks();\n this.enabled = false;\n }\n\n /**\n * Add listener to plugin hooks system.\n *\n * @param {String} name\n * @param {Function} callback\n */\n\n }, {\n key: 'addHook',\n value: function addHook(name, callback) {\n privatePool.get(this).hooks[name] = privatePool.get(this).hooks[name] || [];\n\n var hooks = privatePool.get(this).hooks[name];\n\n this.hot.addHook(name, callback);\n hooks.push(callback);\n privatePool.get(this).hooks[name] = hooks;\n }\n\n /**\n * Remove all hooks listeners by hook name.\n *\n * @param {String} name\n */\n\n }, {\n key: 'removeHooks',\n value: function removeHooks(name) {\n var _this2 = this;\n\n (0, _array.arrayEach)(privatePool.get(this).hooks[name] || [], function (callback) {\n _this2.hot.removeHook(name, callback);\n });\n }\n\n /**\n * Clear all hooks.\n */\n\n }, {\n key: 'clearHooks',\n value: function clearHooks() {\n var _this3 = this;\n\n var hooks = privatePool.get(this).hooks;\n\n (0, _object.objectEach)(hooks, function (callbacks, name) {\n return _this3.removeHooks(name);\n });\n hooks.length = 0;\n }\n\n /**\n * Register function which will be immediately called after all plugins initialized.\n *\n * @param {Function} callback\n */\n\n }, {\n key: 'callOnPluginsReady',\n value: function callOnPluginsReady(callback) {\n if (this.isPluginsReady) {\n callback();\n } else {\n this.pluginsInitializedCallbacks.push(callback);\n }\n }\n\n /**\n * On after plugins initialized listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n (0, _array.arrayEach)(this.pluginsInitializedCallbacks, function (callback) {\n return callback();\n });\n this.pluginsInitializedCallbacks.length = 0;\n this.isPluginsReady = true;\n }\n\n /**\n * On update settings listener.\n *\n * @private\n */\n\n }, {\n key: 'onUpdateSettings',\n value: function onUpdateSettings() {\n if (this.isEnabled) {\n if (this.enabled && !this.isEnabled()) {\n this.disablePlugin();\n }\n if (!this.enabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (this.enabled && this.isEnabled()) {\n this.updatePlugin();\n }\n }\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n *\n * @private\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {}\n\n /**\n * Destroy plugin.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n var _this4 = this;\n\n if (this.eventManager) {\n this.eventManager.destroy();\n }\n this.clearHooks();\n\n (0, _object.objectEach)(this, function (value, property) {\n if (property !== 'hot' && property !== 't') {\n _this4[property] = null;\n }\n });\n delete this.t;\n delete this.hot;\n }\n }]);\n\n return BasePlugin;\n}();\n\nexports.default = BasePlugin;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredEditors = exports.getRegisteredEditorNames = exports.hasEditor = exports.getEditorInstance = exports.getEditor = exports.registerEditor = undefined;\nexports.RegisteredEditor = RegisteredEditor;\nexports._getEditorInstance = _getEditorInstance;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _autocompleteEditor = __webpack_require__(147);\n\nvar _autocompleteEditor2 = _interopRequireDefault(_autocompleteEditor);\n\nvar _checkboxEditor = __webpack_require__(202);\n\nvar _checkboxEditor2 = _interopRequireDefault(_checkboxEditor);\n\nvar _dateEditor = __webpack_require__(203);\n\nvar _dateEditor2 = _interopRequireDefault(_dateEditor);\n\nvar _dropdownEditor = __webpack_require__(204);\n\nvar _dropdownEditor2 = _interopRequireDefault(_dropdownEditor);\n\nvar _handsontableEditor = __webpack_require__(148);\n\nvar _handsontableEditor2 = _interopRequireDefault(_handsontableEditor);\n\nvar _mobileTextEditor = __webpack_require__(205);\n\nvar _mobileTextEditor2 = _interopRequireDefault(_mobileTextEditor);\n\nvar _numericEditor = __webpack_require__(206);\n\nvar _numericEditor2 = _interopRequireDefault(_numericEditor);\n\nvar _passwordEditor = __webpack_require__(207);\n\nvar _passwordEditor2 = _interopRequireDefault(_passwordEditor);\n\nvar _selectEditor = __webpack_require__(208);\n\nvar _selectEditor2 = _interopRequireDefault(_selectEditor);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar registeredEditorClasses = new WeakMap(); /**\n * Utility to register editors and common namespace for keeping reference to all editor classes\n */\n\nvar _staticRegister = (0, _staticRegister3.default)('editors'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\n_register('base', _baseEditor2.default);\n_register('autocomplete', _autocompleteEditor2.default);\n_register('checkbox', _checkboxEditor2.default);\n_register('date', _dateEditor2.default);\n_register('dropdown', _dropdownEditor2.default);\n_register('handsontable', _handsontableEditor2.default);\n_register('mobile', _mobileTextEditor2.default);\n_register('numeric', _numericEditor2.default);\n_register('password', _passwordEditor2.default);\n_register('select', _selectEditor2.default);\n_register('text', _textEditor2.default);\n\nfunction RegisteredEditor(editorClass) {\n var instances = {};\n var Clazz = editorClass;\n\n this.getConstructor = function () {\n return editorClass;\n };\n\n this.getInstance = function (hotInstance) {\n if (!(hotInstance.guid in instances)) {\n instances[hotInstance.guid] = new Clazz(hotInstance);\n }\n\n return instances[hotInstance.guid];\n };\n\n _pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n instances = {};\n });\n}\n\n/**\n * Returns instance (singleton) of editor class.\n *\n * @param {String} name Name of an editor under which it has been stored.\n * @param {Object} hotInstance Instance of Handsontable.\n * @returns {Function} Returns instance of editor.\n */\nfunction _getEditorInstance(name, hotInstance) {\n var editor = void 0;\n\n if (typeof name === 'function') {\n if (!registeredEditorClasses.get(name)) {\n _register(null, name);\n }\n editor = registeredEditorClasses.get(name);\n } else if (typeof name === 'string') {\n editor = getItem(name);\n } else {\n throw Error('Only strings and functions can be passed as \"editor\" parameter');\n }\n\n if (!editor) {\n throw Error('No editor registered under name \"' + name + '\"');\n }\n\n return editor.getInstance(hotInstance);\n}\n\n/**\n * Retrieve editor class.\n *\n * @param {String} name Editor identification.\n * @returns {Function} Returns editor class.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error('No registered editor found under \"' + name + '\" name');\n }\n\n return getItem(name).getConstructor();\n}\n\n/**\n * Register editor class under specified name.\n *\n * @param {String} name Editor identification.\n * @param {Function} editorClass Editor class.\n */\nfunction _register(name, editorClass) {\n var editorWrapper = new RegisteredEditor(editorClass);\n\n if (typeof name === 'string') {\n register(name, editorWrapper);\n }\n registeredEditorClasses.set(editorClass, editorWrapper);\n}\n\nexports.registerEditor = _register;\nexports.getEditor = _getItem;\nexports.getEditorInstance = _getEditorInstance;\nexports.hasEditor = hasItem;\nexports.getRegisteredEditorNames = getNames;\nexports.getRegisteredEditors = getValues;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY_CODES = undefined;\nexports.isPrintableChar = isPrintableChar;\nexports.isMetaKey = isMetaKey;\nexports.isCtrlKey = isCtrlKey;\nexports.isKey = isKey;\n\nvar _array = __webpack_require__(1);\n\nvar KEY_CODES = exports.KEY_CODES = {\n MOUSE_LEFT: 1,\n MOUSE_RIGHT: 3,\n MOUSE_MIDDLE: 2,\n BACKSPACE: 8,\n COMMA: 188,\n INSERT: 45,\n DELETE: 46,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n CONTROL_LEFT: 91,\n COMMAND_LEFT: 17,\n COMMAND_RIGHT: 93,\n ALT: 18,\n HOME: 36,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n SPACE: 32,\n SHIFT: 16,\n CAPS_LOCK: 20,\n TAB: 9,\n ARROW_RIGHT: 39,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_DOWN: 40,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n A: 65,\n X: 88,\n C: 67,\n V: 86\n};\n\n/**\n * Returns true if keyCode represents a printable character.\n *\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isPrintableChar(keyCode) {\n return keyCode == 32 || // space\n keyCode >= 48 && keyCode <= 57 || // 0-9\n keyCode >= 96 && keyCode <= 111 || // numpad\n keyCode >= 186 && keyCode <= 192 || // ;=,-./`\n keyCode >= 219 && keyCode <= 222 || // []{}\\|\"'\n keyCode >= 226 || // special chars (229 for Asian chars)\n keyCode >= 65 && keyCode <= 90; // a-z\n}\n\n/**\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isMetaKey(keyCode) {\n var metaKeys = [KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_RIGHT, KEY_CODES.HOME, KEY_CODES.END, KEY_CODES.DELETE, KEY_CODES.BACKSPACE, KEY_CODES.F1, KEY_CODES.F2, KEY_CODES.F3, KEY_CODES.F4, KEY_CODES.F5, KEY_CODES.F6, KEY_CODES.F7, KEY_CODES.F8, KEY_CODES.F9, KEY_CODES.F10, KEY_CODES.F11, KEY_CODES.F12, KEY_CODES.TAB, KEY_CODES.PAGE_DOWN, KEY_CODES.PAGE_UP, KEY_CODES.ENTER, KEY_CODES.ESCAPE, KEY_CODES.SHIFT, KEY_CODES.CAPS_LOCK, KEY_CODES.ALT];\n\n return metaKeys.indexOf(keyCode) !== -1;\n}\n\n/**\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nfunction isCtrlKey(keyCode) {\n return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1;\n}\n\n/**\n * @param {Number} keyCode\n * @param {String} baseCode\n * @returns {Boolean}\n */\nfunction isKey(keyCode, baseCode) {\n var keys = baseCode.split('|');\n var result = false;\n\n (0, _array.arrayEach)(keys, function (key) {\n if (keyCode === KEY_CODES[key]) {\n result = true;\n\n return false;\n }\n });\n\n return result;\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.normalizeSelection = normalizeSelection;\nexports.isSeparator = isSeparator;\nexports.hasSubMenu = hasSubMenu;\nexports.isDisabled = isDisabled;\nexports.isSelectionDisabled = isSelectionDisabled;\nexports.getValidSelection = getValidSelection;\nexports.prepareVerticalAlignClass = prepareVerticalAlignClass;\nexports.prepareHorizontalAlignClass = prepareHorizontalAlignClass;\nexports.getAlignmentClasses = getAlignmentClasses;\nexports.align = align;\nexports.checkSelectionConsistency = checkSelectionConsistency;\nexports.markLabelAsSelected = markLabelAsSelected;\nexports.isItemHidden = isItemHidden;\nexports.filterSeparators = filterSeparators;\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _separator = __webpack_require__(70);\n\nfunction normalizeSelection(selRange) {\n return {\n start: selRange.getTopLeftCorner(),\n end: selRange.getBottomRightCorner()\n };\n}\n\nfunction isSeparator(cell) {\n return (0, _element.hasClass)(cell, 'htSeparator');\n}\n\nfunction hasSubMenu(cell) {\n return (0, _element.hasClass)(cell, 'htSubmenu');\n}\n\nfunction isDisabled(cell) {\n return (0, _element.hasClass)(cell, 'htDisabled');\n}\n\nfunction isSelectionDisabled(cell) {\n return (0, _element.hasClass)(cell, 'htSelectionDisabled');\n}\n\nfunction getValidSelection(hot) {\n var selected = hot.getSelected();\n\n if (!selected) {\n return null;\n }\n if (selected[0] < 0) {\n return null;\n }\n\n return selected;\n}\n\nfunction prepareVerticalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className.replace('htTop', '').replace('htMiddle', '').replace('htBottom', '').replace(' ', '');\n\n className += ' ' + alignment;\n\n return className;\n}\n\nfunction prepareHorizontalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className.replace('htLeft', '').replace('htCenter', '').replace('htRight', '').replace('htJustify', '').replace(' ', '');\n\n className += ' ' + alignment;\n\n return className;\n}\n\nfunction getAlignmentClasses(range, callback) {\n var classes = {};\n\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n if (!classes[row]) {\n classes[row] = [];\n }\n classes[row][col] = callback(row, col);\n }\n }\n\n return classes;\n}\n\nfunction align(range, type, alignment, cellDescriptor, propertySetter) {\n if (range.from.row == range.to.row && range.from.col == range.to.col) {\n applyAlignClassName(range.from.row, range.from.col, type, alignment, cellDescriptor, propertySetter);\n } else {\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter);\n }\n }\n }\n}\n\nfunction applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter) {\n var cellMeta = cellDescriptor(row, col);\n var className = alignment;\n\n if (cellMeta.className) {\n if (type === 'vertical') {\n className = prepareVerticalAlignClass(cellMeta.className, alignment);\n } else {\n className = prepareHorizontalAlignClass(cellMeta.className, alignment);\n }\n }\n\n propertySetter(row, col, 'className', className);\n}\n\nfunction checkSelectionConsistency(range, comparator) {\n var result = false;\n\n if (range) {\n range.forAll(function (row, col) {\n if (comparator(row, col)) {\n result = true;\n\n return false;\n }\n });\n }\n\n return result;\n}\n\nfunction markLabelAsSelected(label) {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n return '<span class=\"selected\">' + String.fromCharCode(10003) + '</span>' + label;\n}\n\nfunction isItemHidden(item, instance) {\n return !item.hidden || !(typeof item.hidden == 'function' && item.hidden.call(instance));\n}\n\nfunction shiftSeparators(items, separator) {\n var result = items.slice(0);\n\n for (var i = 0; i < result.length;) {\n if (result[i].name === separator) {\n result.shift();\n } else {\n break;\n }\n }\n return result;\n}\n\nfunction popSeparators(items, separator) {\n var result = items.slice(0);\n\n result.reverse();\n result = shiftSeparators(result, separator);\n result.reverse();\n\n return result;\n}\n\nfunction removeDuplicatedSeparators(items) {\n var result = [];\n\n (0, _array.arrayEach)(items, function (value, index) {\n if (index > 0) {\n if (result[result.length - 1].name !== value.name) {\n result.push(value);\n }\n } else {\n result.push(value);\n }\n });\n\n return result;\n}\n\nfunction filterSeparators(items) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _separator.KEY;\n\n var result = items.slice(0);\n\n result = shiftSeparators(result, separator);\n result = popSeparators(result, separator);\n result = removeDuplicatedSeparators(result);\n\n return result;\n}\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15);\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(18)\n , IE8_DOM_DEFINE = __webpack_require__(160)\n , toPrimitive = __webpack_require__(85)\n , dP = Object.defineProperty;\n\nexports.f = __webpack_require__(21) ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.stringify = stringify;\nexports.isDefined = isDefined;\nexports.isUndefined = isUndefined;\nexports.isEmpty = isEmpty;\nexports.isRegExp = isRegExp;\n\n/**\n * Converts any value to string.\n *\n * @param {*} value\n * @returns {String}\n */\nfunction stringify(value) {\n var result = void 0;\n\n switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) {\n case 'string':\n case 'number':\n result = '' + value;\n break;\n\n case 'object':\n result = value === null ? '' : value.toString();\n break;\n case 'undefined':\n result = '';\n break;\n default:\n result = value.toString();\n break;\n }\n\n return result;\n}\n\n/**\n * Checks if given variable is defined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isDefined(variable) {\n return typeof variable !== 'undefined';\n}\n\n/**\n * Checks if given variable is undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isUndefined(variable) {\n return typeof variable === 'undefined';\n}\n\n/**\n * Check if given variable is null, empty string or undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isEmpty(variable) {\n return variable === null || variable === '' || isUndefined(variable);\n}\n\n/**\n * Check if given variable is a regular expression.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nfunction isRegExp(variable) {\n return Object.prototype.toString.call(variable) === '[object RegExp]';\n}\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(31)(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(76)\n , defined = __webpack_require__(30);\nmodule.exports = function(it){\n return IObject(defined(it));\n};\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.15 ToLength\nvar toInteger = __webpack_require__(61)\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.isIE8 = isIE8;\nexports.isIE9 = isIE9;\nexports.isSafari = isSafari;\nexports.isChrome = isChrome;\nexports.isMobileBrowser = isMobileBrowser;\n\nvar _isIE8 = !document.createTextNode('test').textContent;\n\nfunction isIE8() {\n return _isIE8;\n}\n\nvar _isIE9 = !!document.documentMode;\n\nfunction isIE9() {\n return _isIE9;\n}\n\nvar _isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);\n\nfunction isSafari() {\n return _isSafari;\n}\n\nvar _isChrome = /Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor);\n\nfunction isChrome() {\n return _isChrome;\n}\n\nfunction isMobileBrowser(userAgent) {\n if (!userAgent) {\n userAgent = navigator.userAgent;\n }\n\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)\n );\n}\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredValidators = exports.getRegisteredValidatorNames = exports.hasValidator = exports.getValidator = exports.registerValidator = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _autocompleteValidator = __webpack_require__(271);\n\nvar _autocompleteValidator2 = _interopRequireDefault(_autocompleteValidator);\n\nvar _dateValidator = __webpack_require__(272);\n\nvar _dateValidator2 = _interopRequireDefault(_dateValidator);\n\nvar _numericValidator = __webpack_require__(273);\n\nvar _numericValidator2 = _interopRequireDefault(_numericValidator);\n\nvar _timeValidator = __webpack_require__(274);\n\nvar _timeValidator2 = _interopRequireDefault(_timeValidator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('validators'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\nregister('autocomplete', _autocompleteValidator2.default);\nregister('date', _dateValidator2.default);\nregister('numeric', _numericValidator2.default);\nregister('time', _timeValidator2.default);\n\n/**\n * Retrieve validator function.\n *\n * @param {String} name Validator identification.\n * @returns {Function} Returns validator function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error('No registered validator found under \"' + name + '\" name');\n }\n\n return getItem(name);\n}\n\nexports.registerValidator = register;\nexports.getValidator = _getItem;\nexports.hasValidator = hasItem;\nexports.getRegisteredValidatorNames = getNames;\nexports.getRegisteredValidators = getValues;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.toUpperCaseFirst = toUpperCaseFirst;\nexports.equalsIgnoreCase = equalsIgnoreCase;\nexports.randomString = randomString;\nexports.isPercentValue = isPercentValue;\nexports.substitute = substitute;\nexports.stripTags = stripTags;\n\nvar _mixed = __webpack_require__(20);\n\nvar _number = __webpack_require__(6);\n\n/**\n * Convert string to upper case first letter.\n *\n * @param {String} string String to convert.\n * @returns {String}\n */\nfunction toUpperCaseFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n}\n\n/**\n * Compare strings case insensitively.\n *\n * @param {...String} strings Strings to compare.\n * @returns {Boolean}\n */\nfunction equalsIgnoreCase() {\n var unique = [];\n\n for (var _len = arguments.length, strings = Array(_len), _key = 0; _key < _len; _key++) {\n strings[_key] = arguments[_key];\n }\n\n var length = strings.length;\n\n while (length--) {\n var string = (0, _mixed.stringify)(strings[length]).toLowerCase();\n\n if (unique.indexOf(string) === -1) {\n unique.push(string);\n }\n }\n\n return unique.length === 1;\n}\n\n/**\n * Generates a random hex string. Used as namespace for Handsontable instance events.\n *\n * @return {String} Returns 16-long character random string (eq. `'92b1bfc74ec4'`).\n */\nfunction randomString() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + s4() + s4();\n}\n\n/**\n * Checks if value is valid percent.\n *\n * @param {String} value\n * @returns {Boolean}\n */\nfunction isPercentValue(value) {\n return (/^([0-9][0-9]?%$)|(^100%$)/.test(value)\n );\n}\n\n/**\n * Substitute strings placed beetwen square brackets into value defined in `variables` object. String names defined in\n * square brackets must be the same as property name of `variables` object.\n *\n * @param {String} template Template string.\n * @param {Object} variables Object which contains all available values which can be injected into template.\n * @returns {String}\n */\nfunction substitute(template) {\n var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return ('' + template).replace(/(?:\\\\)?\\[([^[\\]]+)]/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.substr(1, match.length - 1);\n }\n\n return variables[name] === void 0 ? '' : variables[name];\n });\n}\n\nvar STRIP_TAGS_REGEX = /<\\/?\\w+\\/?>|<\\w+[\\s|/][^>]*>/gi;\n\n/**\n * Strip any HTML tag from the string.\n *\n * @param {String} string String to cut HTML from.\n * @return {String}\n */\nfunction stripTags(string) {\n string += '';\n\n return string.replace(STRIP_TAGS_REGEX, '');\n}\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _core = __webpack_require__(137);\n\nvar _core2 = _interopRequireDefault(_core);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar registeredOverlays = {};\n\n/**\n * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable\n * and (optionally) implements behavior needed for native horizontal and vertical scrolling.\n *\n * @class Overlay\n */\n\nvar Overlay = function () {\n _createClass(Overlay, null, [{\n key: 'registerOverlay',\n\n\n /**\n * Register overlay class.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Overlay} overlayClass Overlay class extended from base overlay class {@link Overlay}\n */\n value: function registerOverlay(type, overlayClass) {\n if (Overlay.CLONE_TYPES.indexOf(type) === -1) {\n throw new Error('Unsupported overlay (' + type + ').');\n }\n registeredOverlays[type] = overlayClass;\n }\n\n /**\n * Create new instance of overlay type.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Walkontable} wot Walkontable instance\n */\n\n }, {\n key: 'createOverlay',\n value: function createOverlay(type, wot) {\n return new registeredOverlays[type](wot);\n }\n\n /**\n * Check if specified overlay was registered.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasOverlay',\n value: function hasOverlay(type) {\n return registeredOverlays[type] !== void 0;\n }\n\n /**\n * Checks if overlay object (`overlay`) is instance of overlay type (`type`).\n *\n * @param {Overlay} overlay Overlay object\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n\n }, {\n key: 'isOverlayTypeOf',\n value: function isOverlayTypeOf(overlay, type) {\n if (!overlay || !registeredOverlays[type]) {\n return false;\n }\n\n return overlay instanceof registeredOverlays[type];\n }\n\n /**\n * @param {Walkontable} wotInstance\n */\n\n }, {\n key: 'CLONE_TOP',\n\n /**\n * @type {String}\n */\n get: function get() {\n return 'top';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_BOTTOM',\n get: function get() {\n return 'bottom';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_LEFT',\n get: function get() {\n return 'left';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_TOP_LEFT_CORNER',\n get: function get() {\n return 'top_left_corner';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_BOTTOM_LEFT_CORNER',\n get: function get() {\n return 'bottom_left_corner';\n }\n\n /**\n * @type {String}\n */\n\n }, {\n key: 'CLONE_DEBUG',\n get: function get() {\n return 'debug';\n }\n\n /**\n * List of all availables clone types\n *\n * @type {Array}\n */\n\n }, {\n key: 'CLONE_TYPES',\n get: function get() {\n return [Overlay.CLONE_TOP, Overlay.CLONE_BOTTOM, Overlay.CLONE_LEFT, Overlay.CLONE_TOP_LEFT_CORNER, Overlay.CLONE_BOTTOM_LEFT_CORNER, Overlay.CLONE_DEBUG];\n }\n }]);\n\n function Overlay(wotInstance) {\n _classCallCheck(this, Overlay);\n\n (0, _object.defineGetter)(this, 'wot', wotInstance, {\n writable: false\n });\n\n // legacy support, deprecated in the future\n this.instance = this.wot;\n\n this.type = '';\n this.mainTableScrollableElement = null;\n this.TABLE = this.wot.wtTable.TABLE;\n this.hider = this.wot.wtTable.hider;\n this.spreader = this.wot.wtTable.spreader;\n this.holder = this.wot.wtTable.holder;\n this.wtRootElement = this.wot.wtTable.wtRootElement;\n this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);\n this.areElementSizesAdjusted = false;\n this.updateStateOfRendering();\n }\n\n /**\n * Update internal state of object with an information about the need of full rendering of the overlay.\n *\n * @returns {Boolean} Returns `true` if the state has changed since the last check.\n */\n\n\n _createClass(Overlay, [{\n key: 'updateStateOfRendering',\n value: function updateStateOfRendering() {\n var previousState = this.needFullRender;\n\n this.needFullRender = this.shouldBeRendered();\n\n var changed = previousState !== this.needFullRender;\n\n if (changed && !this.needFullRender) {\n this.reset();\n }\n\n return changed;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return true;\n }\n\n /**\n * Update the trimming container.\n */\n\n }, {\n key: 'updateTrimmingContainer',\n value: function updateTrimmingContainer() {\n this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);\n }\n\n /**\n * Update the main scrollable element.\n */\n\n }, {\n key: 'updateMainScrollableElement',\n value: function updateMainScrollableElement() {\n this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n }\n\n /**\n * Make a clone of table for overlay\n *\n * @param {String} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,\n * `Overlay.CLONE_TOP_LEFT_CORNER`, `Overlay.CLONE_DEBUG`\n * @returns {Walkontable}\n */\n\n }, {\n key: 'makeClone',\n value: function makeClone(direction) {\n if (Overlay.CLONE_TYPES.indexOf(direction) === -1) {\n throw new Error('Clone type \"' + direction + '\" is not supported.');\n }\n var clone = document.createElement('DIV');\n var clonedTable = document.createElement('TABLE');\n\n clone.className = 'ht_clone_' + direction + ' handsontable';\n clone.style.position = 'absolute';\n clone.style.top = 0;\n clone.style.left = 0;\n clone.style.overflow = 'hidden';\n\n clonedTable.className = this.wot.wtTable.TABLE.className;\n clone.appendChild(clonedTable);\n\n this.type = direction;\n this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);\n\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === Overlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === Overlay.CLONE_LEFT) {\n this.mainTableScrollableElement = window;\n } else {\n this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n }\n\n return new _core2.default({\n cloneSource: this.wot,\n cloneOverlay: this,\n table: clonedTable\n });\n }\n\n /**\n * Refresh/Redraw overlay\n *\n * @param {Boolean} [fastDraw=false]\n */\n\n }, {\n key: 'refresh',\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n // When hot settings are changed we allow to refresh overlay once before blocking\n var nextCycleRenderFlag = this.shouldBeRendered();\n\n if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {\n this.clone.draw(fastDraw);\n }\n this.needFullRender = nextCycleRenderFlag;\n }\n\n /**\n * Reset overlay styles to initial values.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n if (!this.clone) {\n return;\n }\n var holder = this.clone.wtTable.holder;\n var hider = this.clone.wtTable.hider;\n var holderStyle = holder.style;\n var hidderStyle = hider.style;\n var rootStyle = holder.parentNode.style;\n\n (0, _array.arrayEach)([holderStyle, hidderStyle, rootStyle], function (style) {\n style.width = '';\n style.height = '';\n });\n }\n\n /**\n * Destroy overlay instance\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n new _eventManager2.default(this.clone).destroy();\n }\n }]);\n\n return Overlay;\n}();\n\nexports.default = Overlay;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// optional / simple context binding\nvar aFunction = __webpack_require__(71);\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19)\n , createDesc = __webpack_require__(40);\nmodule.exports = __webpack_require__(21) ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , hide = __webpack_require__(32)\n , has = __webpack_require__(22)\n , SRC = __webpack_require__(49)('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(44).inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.requestAnimationFrame = requestAnimationFrame;\nexports.cancelAnimationFrame = cancelAnimationFrame;\nexports.isTouchSupported = isTouchSupported;\nexports.isWebComponentSupportedNatively = isWebComponentSupportedNatively;\nexports.hasCaptionProblem = hasCaptionProblem;\nexports.getComparisonFunction = getComparisonFunction;\n// https://gist.github.com/paulirish/1579671\nvar lastTime = 0;\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\nvar _requestAnimationFrame = window.requestAnimationFrame;\nvar _cancelAnimationFrame = window.cancelAnimationFrame;\n\nfor (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {\n _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n}\n\nif (!_requestAnimationFrame) {\n _requestAnimationFrame = function _requestAnimationFrame(callback) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = window.setTimeout(function () {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n\n return id;\n };\n}\n\nif (!_cancelAnimationFrame) {\n _cancelAnimationFrame = function _cancelAnimationFrame(id) {\n clearTimeout(id);\n };\n}\n\n/**\n * Polyfill for requestAnimationFrame\n *\n * @param {Function} callback\n * @returns {Number}\n */\nfunction requestAnimationFrame(callback) {\n return _requestAnimationFrame.call(window, callback);\n}\n\n/**\n * Polyfill for cancelAnimationFrame\n *\n * @param {Number} id\n */\nfunction cancelAnimationFrame(id) {\n _cancelAnimationFrame.call(window, id);\n}\n\nfunction isTouchSupported() {\n return 'ontouchstart' in window;\n}\n\n/**\n * Checks if browser is support web components natively\n *\n * @returns {Boolean}\n */\nfunction isWebComponentSupportedNatively() {\n var test = document.createElement('div');\n\n return !!(test.createShadowRoot && test.createShadowRoot.toString().match(/\\[native code\\]/));\n}\n\nvar _hasCaptionProblem;\n\nfunction detectCaptionProblem() {\n var TABLE = document.createElement('TABLE');\n TABLE.style.borderSpacing = 0;\n TABLE.style.borderWidth = 0;\n TABLE.style.padding = 0;\n var TBODY = document.createElement('TBODY');\n TABLE.appendChild(TBODY);\n TBODY.appendChild(document.createElement('TR'));\n TBODY.firstChild.appendChild(document.createElement('TD'));\n TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';\n\n var CAPTION = document.createElement('CAPTION');\n CAPTION.innerHTML = 'c<br>c<br>c<br>c';\n CAPTION.style.padding = 0;\n CAPTION.style.margin = 0;\n TABLE.insertBefore(CAPTION, TBODY);\n\n document.body.appendChild(TABLE);\n _hasCaptionProblem = TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight; // boolean\n document.body.removeChild(TABLE);\n}\n\nfunction hasCaptionProblem() {\n if (_hasCaptionProblem === void 0) {\n detectCaptionProblem();\n }\n\n return _hasCaptionProblem;\n}\n\nvar comparisonFunction = void 0;\n\n/**\n * Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.\n *\n * @param {String} [language]\n * @param {Object} [options]\n * @returns {*}\n */\nfunction getComparisonFunction(language) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (comparisonFunction) {\n return comparisonFunction;\n }\n\n if ((typeof Intl === 'undefined' ? 'undefined' : _typeof(Intl)) === 'object') {\n comparisonFunction = new Intl.Collator(language, options).compare;\n } else if (typeof String.prototype.localeCompare === 'function') {\n comparisonFunction = function comparisonFunction(a, b) {\n return ('' + a).localeCompare(b);\n };\n } else {\n comparisonFunction = function comparisonFunction(a, b) {\n if (a === b) {\n return 0;\n }\n\n return a > b ? -1 : 1;\n };\n }\n\n return comparisonFunction;\n}\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.isFunction = isFunction;\nexports.throttle = throttle;\nexports.throttleAfterHits = throttleAfterHits;\nexports.debounce = debounce;\nexports.pipe = pipe;\nexports.partial = partial;\nexports.curry = curry;\nexports.curryRight = curryRight;\n\nvar _array = __webpack_require__(1);\n\n/**\n * Checks if given variable is function.\n *\n * @param {*} func Variable to check.\n * @returns {Boolean}\n */\nfunction isFunction(func) {\n return typeof func === 'function';\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`).\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @returns {Function}\n */\nfunction throttle(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n\n var lastCalled = 0;\n var result = {\n lastCallThrottled: true\n };\n var lastTimer = null;\n\n function _throttle() {\n var _this = this;\n\n var args = arguments;\n var stamp = Date.now();\n var needCall = false;\n\n result.lastCallThrottled = true;\n\n if (!lastCalled) {\n lastCalled = stamp;\n needCall = true;\n }\n var remaining = wait - (stamp - lastCalled);\n\n if (needCall) {\n result.lastCallThrottled = false;\n func.apply(this, args);\n } else {\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(function () {\n result.lastCallThrottled = false;\n func.apply(_this, args);\n lastCalled = 0;\n lastTimer = void 0;\n }, remaining);\n }\n\n return result;\n }\n\n return _throttle;\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over\n * time (`wait`) after specified hits.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @param {Number} hits Number of hits after throttling will be applied.\n * @returns {Function}\n */\nfunction throttleAfterHits(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n var hits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;\n\n var funcThrottle = throttle(func, wait);\n var remainHits = hits;\n\n function _clearHits() {\n remainHits = hits;\n }\n function _throttleAfterHits() {\n if (remainHits) {\n remainHits--;\n\n return func.apply(this, arguments);\n }\n\n return funcThrottle.apply(this, arguments);\n }\n _throttleAfterHits.clearHits = _clearHits;\n\n return _throttleAfterHits;\n}\n\n/**\n * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`)\n * has passed without it being called.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in milliseconds.\n * @returns {Function}\n */\nfunction debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;\n\n var lastTimer = null;\n var result = void 0;\n\n function _debounce() {\n var _this2 = this;\n\n var args = arguments;\n\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(function () {\n result = func.apply(_this2, args);\n }, wait);\n\n return result;\n }\n\n return _debounce;\n}\n\n/**\n * Creates the function that returns the result of calling the given functions. Result of the first function is passed to\n * the second as an argument and so on. Only first function in the chain can handle multiple arguments.\n *\n * @param {Function} functions Functions to compose.\n * @returns {Function}\n */\nfunction pipe() {\n for (var _len = arguments.length, functions = Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n\n var firstFunc = functions[0],\n restFunc = functions.slice(1);\n\n\n return function _pipe() {\n return (0, _array.arrayReduce)(restFunc, function (acc, fn) {\n return fn(acc);\n }, firstFunc.apply(this, arguments));\n };\n}\n\n/**\n * Creates the function that returns the function with cached arguments.\n *\n * @param {Function} func Function to partialization.\n * @param {Array} params Function arguments to cache.\n * @returns {Function}\n */\nfunction partial(func) {\n for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n return function _partial() {\n for (var _len3 = arguments.length, restParams = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n restParams[_key3] = arguments[_key3];\n }\n\n return func.apply(this, params.concat(restParams));\n };\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the left to the right.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('foo')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'Some test with foo...');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nfunction curry(func) {\n var argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry() {\n for (var _len4 = arguments.length, params = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n params[_key4] = arguments[_key4];\n }\n\n var passedArgsSoFar = argsSoFar.concat(params);\n var result = void 0;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the right to the left.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('Some test with foo...')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'foo');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nfunction curryRight(func) {\n var argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry() {\n for (var _len5 = arguments.length, params = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n params[_key5] = arguments[_key5];\n }\n\n var passedArgsSoFar = argsSoFar.concat(params.reverse());\n var result = void 0;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.EditorState = undefined;\n\nvar _src = __webpack_require__(11);\n\nvar _mixed = __webpack_require__(20);\n\nvar EditorState = exports.EditorState = {\n VIRGIN: 'STATE_VIRGIN', // before editing\n EDITING: 'STATE_EDITING',\n WAITING: 'STATE_WAITING', // waiting for async validation\n FINISHED: 'STATE_FINISHED'\n};\n\nfunction BaseEditor(instance) {\n this.instance = instance;\n this.state = EditorState.VIRGIN;\n\n this._opened = false;\n this._fullEditMode = false;\n this._closeCallback = null;\n\n this.init();\n}\n\nBaseEditor.prototype._fireCallbacks = function (result) {\n if (this._closeCallback) {\n this._closeCallback(result);\n this._closeCallback = null;\n }\n};\n\nBaseEditor.prototype.init = function () {};\n\nBaseEditor.prototype.getValue = function () {\n throw Error('Editor getValue() method unimplemented');\n};\n\nBaseEditor.prototype.setValue = function (newValue) {\n throw Error('Editor setValue() method unimplemented');\n};\n\nBaseEditor.prototype.open = function () {\n throw Error('Editor open() method unimplemented');\n};\n\nBaseEditor.prototype.close = function () {\n throw Error('Editor close() method unimplemented');\n};\n\nBaseEditor.prototype.prepare = function (row, col, prop, td, originalValue, cellProperties) {\n this.TD = td;\n this.row = row;\n this.col = col;\n this.prop = prop;\n this.originalValue = originalValue;\n this.cellProperties = cellProperties;\n\n var invalidActiveElement = !document.activeElement || document.activeElement && document.activeElement.nodeName === void 0;\n\n if (this.instance.view.isMouseDown() && document.activeElement && document.activeElement !== document.body && !invalidActiveElement) {\n document.activeElement.blur();\n } else if (invalidActiveElement) {\n // IE\n document.body.focus();\n }\n\n this.state = EditorState.VIRGIN;\n};\n\nBaseEditor.prototype.extend = function () {\n var baseClass = this.constructor;\n\n function Editor() {\n baseClass.apply(this, arguments);\n }\n\n function inherit(Child, Parent) {\n function Bridge() {}\n Bridge.prototype = Parent.prototype;\n Child.prototype = new Bridge();\n Child.prototype.constructor = Child;\n\n return Child;\n }\n\n return inherit(Editor, baseClass);\n};\n\nBaseEditor.prototype.saveValue = function (value, ctrlDown) {\n var selection = void 0;\n var tmp = void 0;\n\n // if ctrl+enter and multiple cells selected, behave like Excel (finish editing and apply to all cells)\n if (ctrlDown) {\n selection = this.instance.getSelected();\n\n if (selection[0] > selection[2]) {\n tmp = selection[0];\n selection[0] = selection[2];\n selection[2] = tmp;\n }\n if (selection[1] > selection[3]) {\n tmp = selection[1];\n selection[1] = selection[3];\n selection[3] = tmp;\n }\n } else {\n selection = [this.row, this.col, null, null];\n }\n\n this.instance.populateFromArray(selection[0], selection[1], value, selection[2], selection[3], 'edit');\n};\n\nBaseEditor.prototype.beginEditing = function (initialValue, event) {\n if (this.state != EditorState.VIRGIN) {\n return;\n }\n this.instance.view.scrollViewport(new _src.CellCoords(this.row, this.col));\n this.instance.view.render();\n this.state = EditorState.EDITING;\n\n initialValue = typeof initialValue == 'string' ? initialValue : this.originalValue;\n this.setValue((0, _mixed.stringify)(initialValue));\n\n this.open(event);\n this._opened = true;\n this.focus();\n\n // only rerender the selections (FillHandle should disappear when beginediting is triggered)\n this.instance.view.render();\n\n this.instance.runHooks('afterBeginEditing', this.row, this.col);\n};\n\nBaseEditor.prototype.finishEditing = function (restoreOriginalValue, ctrlDown, callback) {\n var _this = this,\n val;\n\n if (callback) {\n var previousCloseCallback = this._closeCallback;\n\n this._closeCallback = function (result) {\n if (previousCloseCallback) {\n previousCloseCallback(result);\n }\n\n callback(result);\n _this.instance.view.render();\n };\n }\n\n if (this.isWaiting()) {\n return;\n }\n\n if (this.state == EditorState.VIRGIN) {\n this.instance._registerTimeout(setTimeout(function () {\n _this._fireCallbacks(true);\n }, 0));\n\n return;\n }\n\n if (this.state == EditorState.EDITING) {\n if (restoreOriginalValue) {\n this.cancelChanges();\n this.instance.view.render();\n\n return;\n }\n\n var value = this.getValue();\n\n if (this.instance.getSettings().trimWhitespace) {\n // We trim only string values\n val = [[typeof value === 'string' ? String.prototype.trim.call(value || '') : value]];\n } else {\n val = [[value]];\n }\n\n this.state = EditorState.WAITING;\n this.saveValue(val, ctrlDown);\n\n if (this.instance.getCellValidator(this.cellProperties)) {\n this.instance.addHookOnce('postAfterValidate', function (result) {\n _this.state = EditorState.FINISHED;\n _this.discardEditor(result);\n });\n } else {\n this.state = EditorState.FINISHED;\n this.discardEditor(true);\n }\n }\n};\n\nBaseEditor.prototype.cancelChanges = function () {\n this.state = EditorState.FINISHED;\n this.discardEditor();\n};\n\nBaseEditor.prototype.discardEditor = function (result) {\n if (this.state !== EditorState.FINISHED) {\n return;\n }\n // validator was defined and failed\n if (result === false && this.cellProperties.allowInvalid !== true) {\n this.instance.selectCell(this.row, this.col);\n this.focus();\n this.state = EditorState.EDITING;\n this._fireCallbacks(false);\n } else {\n this.close();\n this._opened = false;\n this._fullEditMode = false;\n this.state = EditorState.VIRGIN;\n this._fireCallbacks(true);\n }\n};\n\n/**\n * Switch editor into full edit mode. In this state navigation keys don't close editor. This mode is activated\n * automatically after hit ENTER or F2 key on the cell or while editing cell press F2 key.\n */\nBaseEditor.prototype.enableFullEditMode = function () {\n this._fullEditMode = true;\n};\n\n/**\n * Checks if editor is in full edit mode.\n *\n * @returns {Boolean}\n */\nBaseEditor.prototype.isInFullEditMode = function () {\n return this._fullEditMode;\n};\n\nBaseEditor.prototype.isOpened = function () {\n return this._opened;\n};\n\nBaseEditor.prototype.isWaiting = function () {\n return this.state === EditorState.WAITING;\n};\n\nBaseEditor.prototype.checkEditorSection = function () {\n var totalRows = this.instance.countRows();\n var section = '';\n\n if (this.row < this.instance.getSettings().fixedRowsTop) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'top-left-corner';\n } else {\n section = 'top';\n }\n } else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'bottom-left-corner';\n } else {\n section = 'bottom';\n }\n } else if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'left';\n }\n\n return section;\n};\n\nexports.default = BaseEditor;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(10)('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(32)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(169)\n , enumBugKeys = __webpack_require__(74);\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(30);\nmodule.exports = function(it){\n return Object(defined(it));\n};\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * CellCoords holds cell coordinates (row, column) and few method to validate them and\n * retrieve as an array or an object\n *\n * @class CellCoords\n */\nvar CellCoords = function () {\n /**\n * @param {Number} row Row index\n * @param {Number} col Column index\n */\n function CellCoords(row, col) {\n _classCallCheck(this, CellCoords);\n\n if (typeof row !== 'undefined' && typeof col !== 'undefined') {\n this.row = row;\n this.col = col;\n } else {\n this.row = null;\n this.col = null;\n }\n }\n\n /**\n * Checks if given set of coordinates is valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n\n\n _createClass(CellCoords, [{\n key: 'isValid',\n value: function isValid(wotInstance) {\n // is it a valid cell index (0 or higher)\n if (this.row < 0 || this.col < 0) {\n return false;\n }\n // is selection within total rows and columns\n if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks if this cell coords are the same as cell coords given as a parameter\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEqual',\n value: function isEqual(cellCoords) {\n if (cellCoords === this) {\n return true;\n }\n\n return this.row === cellCoords.row && this.col === cellCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthEastOf',\n value: function isSouthEastOf(testedCoords) {\n return this.row >= testedCoords.row && this.col >= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthWestOf',\n value: function isNorthWestOf(testedCoords) {\n return this.row <= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-west from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthWestOf',\n value: function isSouthWestOf(testedCoords) {\n return this.row >= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthEastOf',\n value: function isNorthEastOf(testedCoords) {\n return this.row <= testedCoords.row && this.col >= testedCoords.col;\n }\n }]);\n\n return CellCoords;\n}();\n\nexports.default = CellCoords;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _autoResize = __webpack_require__(183);\n\nvar _autoResize2 = _interopRequireDefault(_autoResize);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TextEditor = _baseEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor TextEditor\n * @class TextEditor\n * @dependencies autoResize\n */\nTextEditor.prototype.init = function () {\n var that = this;\n this.createElements();\n this.eventManager = new _eventManager2.default(this);\n this.bindEvents();\n this.autoResize = (0, _autoResize2.default)();\n\n this.instance.addHook('afterDestroy', function () {\n that.destroy();\n });\n};\n\nTextEditor.prototype.getValue = function () {\n return this.TEXTAREA.value;\n};\n\nTextEditor.prototype.setValue = function (newValue) {\n this.TEXTAREA.value = newValue;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n var instance = this,\n that = instance.getActiveEditor(),\n ctrlDown;\n\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n // Process only events that have been fired in the editor\n if (event.target !== that.TEXTAREA || (0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) {\n // when CTRL or its equivalent is pressed and cell is edited, don't prepare selectable text in textarea\n (0, _event.stopImmediatePropagation)(event);\n return;\n }\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n case _unicode.KEY_CODES.ARROW_UP:\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (that.isInFullEditMode()) {\n if (!that.isWaiting() && !that.allowKeyEventPropagation || !that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode)) {\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n break;\n\n case _unicode.KEY_CODES.ENTER:\n var selected = that.instance.getSelected();\n var isMultipleSelection = !(selected[0] === selected[2] && selected[1] === selected[3]);\n if (ctrlDown && !isMultipleSelection || event.altKey) {\n // if ctrl+enter or alt+enter, add new line\n if (that.isOpened()) {\n var caretPosition = (0, _element.getCaretPosition)(that.TEXTAREA),\n value = that.getValue();\n\n var newValue = value.slice(0, caretPosition) + '\\n' + value.slice(caretPosition);\n\n that.setValue(newValue);\n\n (0, _element.setCaretPosition)(that.TEXTAREA, caretPosition + 1);\n } else {\n that.beginEditing(that.originalValue + '\\n');\n }\n (0, _event.stopImmediatePropagation)(event);\n }\n event.preventDefault(); // don't add newline to field\n break;\n\n case _unicode.KEY_CODES.A:\n case _unicode.KEY_CODES.X:\n case _unicode.KEY_CODES.C:\n case _unicode.KEY_CODES.V:\n if (ctrlDown) {\n (0, _event.stopImmediatePropagation)(event); // CTRL+A, CTRL+C, CTRL+V, CTRL+X should only work locally when cell is edited (not in table context)\n }\n break;\n\n case _unicode.KEY_CODES.BACKSPACE:\n case _unicode.KEY_CODES.DELETE:\n case _unicode.KEY_CODES.HOME:\n case _unicode.KEY_CODES.END:\n (0, _event.stopImmediatePropagation)(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n break;\n default:\n break;\n }\n\n if ([_unicode.KEY_CODES.ARROW_UP, _unicode.KEY_CODES.ARROW_RIGHT, _unicode.KEY_CODES.ARROW_DOWN, _unicode.KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) {\n that.autoResize.resize(String.fromCharCode(event.keyCode));\n }\n};\n\nTextEditor.prototype.open = function () {\n this.refreshDimensions(); // need it instantly, to prevent https://github.com/handsontable/handsontable/issues/348\n\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.close = function (tdOutside) {\n this.textareaParentStyle.display = 'none';\n\n this.autoResize.unObserve();\n\n if (document.activeElement === this.TEXTAREA) {\n this.instance.listen(); // don't refocus the table if user focused some cell outside of HT on purpose\n }\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.focus = function () {\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, this.TEXTAREA.value.length);\n};\n\nTextEditor.prototype.createElements = function () {\n // this.$body = $(document.body);\n\n this.TEXTAREA = document.createElement('TEXTAREA');\n\n (0, _element.addClass)(this.TEXTAREA, 'handsontableInput');\n\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n this.TEXTAREA_PARENT = document.createElement('DIV');\n (0, _element.addClass)(this.TEXTAREA_PARENT, 'handsontableInputHolder');\n\n this.textareaParentStyle = this.TEXTAREA_PARENT.style;\n this.textareaParentStyle.top = 0;\n this.textareaParentStyle.left = 0;\n this.textareaParentStyle.display = 'none';\n\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n\n this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);\n\n var that = this;\n this.instance._registerTimeout(setTimeout(function () {\n that.refreshDimensions();\n }, 0));\n};\n\nTextEditor.prototype.getEditedCell = function () {\n var editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 101;\n break;\n case 'top-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'bottom-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n case 'bottom':\n editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.textareaParentStyle.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nTextEditor.prototype.refreshValue = function () {\n var sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nTextEditor.prototype.refreshDimensions = function () {\n if (this.state !== _baseEditor.EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close(true);\n\n return;\n }\n var currentOffset = (0, _element.offset)(this.TD),\n containerOffset = (0, _element.offset)(this.instance.rootElement),\n scrollableContainer = (0, _element.getScrollableElement)(this.TD),\n totalRowsCount = this.instance.countRows(),\n\n\n // If colHeaders is disabled, cells in the first row have border-top\n editTopModifier = currentOffset.top === containerOffset.top ? 0 : 1,\n editTop = currentOffset.top - containerOffset.top - editTopModifier - (scrollableContainer.scrollTop || 0),\n editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),\n settings = this.instance.getSettings(),\n rowHeadersCount = this.instance.hasRowHeaders(),\n colHeadersCount = this.instance.hasColHeaders(),\n editorSection = this.checkEditorSection(),\n backgroundColor = this.TD.style.backgroundColor,\n cssTransformOffset;\n\n // TODO: Refactor this to the new instance.getCell method (from #ply-59), after 0.12.1 is released\n switch (editorSection) {\n case 'top':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n\n if (colHeadersCount && this.instance.getSelected()[0] === 0 || settings.fixedRowsBottom && this.instance.getSelected()[0] === totalRowsCount - settings.fixedRowsBottom) {\n editTop += 1;\n }\n\n if (this.instance.getSelected()[1] === 0) {\n editLeft += 1;\n }\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n (0, _element.resetCssTransform)(this.TEXTAREA_PARENT);\n }\n\n this.textareaParentStyle.top = editTop + 'px';\n this.textareaParentStyle.left = editLeft + 'px';\n\n var firstRowOffset = this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition;\n var firstColumnOffset = this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition;\n var horizontalScrollPosition = this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n var verticalScrollPosition = this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition();\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n var cellTopOffset = this.TD.offsetTop + firstRowOffset - verticalScrollPosition;\n var cellLeftOffset = this.TD.offsetLeft + firstColumnOffset - horizontalScrollPosition;\n\n var width = (0, _element.innerWidth)(this.TD) - 8;\n var actualVerticalScrollbarWidth = (0, _element.hasVerticalScrollbar)(scrollableContainer) ? scrollbarWidth : 0;\n var actualHorizontalScrollbarWidth = (0, _element.hasHorizontalScrollbar)(scrollableContainer) ? scrollbarWidth : 0;\n var maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9 - actualVerticalScrollbarWidth;\n var height = this.TD.scrollHeight + 1;\n var maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - actualHorizontalScrollbarWidth, 23);\n\n var cellComputedStyle = (0, _element.getComputedStyle)(this.TD);\n\n this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize;\n this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily;\n this.TEXTAREA.style.backgroundColor = ''; // RESET STYLE\n this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : (0, _element.getComputedStyle)(this.TEXTAREA).backgroundColor;\n\n this.autoResize.init(this.TEXTAREA, {\n minHeight: Math.min(height, maxHeight),\n maxHeight: maxHeight, // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n minWidth: Math.min(width, maxWidth),\n maxWidth: maxWidth // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n }, true);\n\n this.textareaParentStyle.display = 'block';\n};\n\nTextEditor.prototype.bindEvents = function () {\n var editor = this;\n\n this.eventManager.addEventListener(this.TEXTAREA, 'cut', function (event) {\n (0, _event.stopPropagation)(event);\n });\n\n this.eventManager.addEventListener(this.TEXTAREA, 'paste', function (event) {\n (0, _event.stopPropagation)(event);\n });\n\n this.instance.addHook('afterScrollHorizontally', function () {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterScrollVertically', function () {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterColumnResize', function () {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterRowResize', function () {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterDestroy', function () {\n editor.eventManager.destroy();\n });\n};\n\nTextEditor.prototype.destroy = function () {\n this.eventManager.destroy();\n};\n\nexports.default = TextEditor;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\nvar core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nmodule.exports = {};\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar META = __webpack_require__(49)('meta')\n , isObject = __webpack_require__(15)\n , has = __webpack_require__(22)\n , setDesc = __webpack_require__(19).f\n , id = 0;\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\nvar FREEZE = !__webpack_require__(31)(function(){\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function(it){\n setDesc(it, META, {value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n }});\n};\nvar fastKey = function(it, create){\n // return primitive with prefix\n if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return 'F';\n // not necessary to add metadata\n if(!create)return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function(it, create){\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return true;\n // not necessary to add metadata\n if(!create)return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function(it){\n if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports) {\n\nexports.f = {}.propertyIsEnumerable;\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar def = __webpack_require__(19).f\n , has = __webpack_require__(22)\n , TAG = __webpack_require__(10)('toStringTag');\n\nmodule.exports = function(it, tag, stat){\n if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});\n};\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports) {\n\nvar id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.ITEMS = exports.UNDO = exports.SEPARATOR = exports.ROW_BELOW = exports.ROW_ABOVE = exports.REMOVE_ROW = exports.REMOVE_COLUMN = exports.REDO = exports.READ_ONLY = exports.COLUMN_RIGHT = exports.COLUMN_LEFT = exports.CLEAR_COLUMN = exports.ALIGNMENT = undefined;\n\nvar _predefinedItems2;\n\nvar _alignment = __webpack_require__(223);\n\nObject.defineProperty(exports, 'ALIGNMENT', {\n enumerable: true,\n get: function get() {\n return _alignment.KEY;\n }\n});\n\nvar _clearColumn = __webpack_require__(224);\n\nObject.defineProperty(exports, 'CLEAR_COLUMN', {\n enumerable: true,\n get: function get() {\n return _clearColumn.KEY;\n }\n});\n\nvar _columnLeft = __webpack_require__(225);\n\nObject.defineProperty(exports, 'COLUMN_LEFT', {\n enumerable: true,\n get: function get() {\n return _columnLeft.KEY;\n }\n});\n\nvar _columnRight = __webpack_require__(226);\n\nObject.defineProperty(exports, 'COLUMN_RIGHT', {\n enumerable: true,\n get: function get() {\n return _columnRight.KEY;\n }\n});\n\nvar _readOnly = __webpack_require__(227);\n\nObject.defineProperty(exports, 'READ_ONLY', {\n enumerable: true,\n get: function get() {\n return _readOnly.KEY;\n }\n});\n\nvar _redo = __webpack_require__(228);\n\nObject.defineProperty(exports, 'REDO', {\n enumerable: true,\n get: function get() {\n return _redo.KEY;\n }\n});\n\nvar _removeColumn = __webpack_require__(229);\n\nObject.defineProperty(exports, 'REMOVE_COLUMN', {\n enumerable: true,\n get: function get() {\n return _removeColumn.KEY;\n }\n});\n\nvar _removeRow = __webpack_require__(230);\n\nObject.defineProperty(exports, 'REMOVE_ROW', {\n enumerable: true,\n get: function get() {\n return _removeRow.KEY;\n }\n});\n\nvar _rowAbove = __webpack_require__(231);\n\nObject.defineProperty(exports, 'ROW_ABOVE', {\n enumerable: true,\n get: function get() {\n return _rowAbove.KEY;\n }\n});\n\nvar _rowBelow = __webpack_require__(232);\n\nObject.defineProperty(exports, 'ROW_BELOW', {\n enumerable: true,\n get: function get() {\n return _rowBelow.KEY;\n }\n});\n\nvar _separator = __webpack_require__(70);\n\nObject.defineProperty(exports, 'SEPARATOR', {\n enumerable: true,\n get: function get() {\n return _separator.KEY;\n }\n});\n\nvar _undo = __webpack_require__(233);\n\nObject.defineProperty(exports, 'UNDO', {\n enumerable: true,\n get: function get() {\n return _undo.KEY;\n }\n});\nexports.predefinedItems = predefinedItems;\nexports.addItem = addItem;\n\nvar _object = __webpack_require__(2);\n\nvar _alignment2 = _interopRequireDefault(_alignment);\n\nvar _clearColumn2 = _interopRequireDefault(_clearColumn);\n\nvar _columnLeft2 = _interopRequireDefault(_columnLeft);\n\nvar _columnRight2 = _interopRequireDefault(_columnRight);\n\nvar _readOnly2 = _interopRequireDefault(_readOnly);\n\nvar _redo2 = _interopRequireDefault(_redo);\n\nvar _removeColumn2 = _interopRequireDefault(_removeColumn);\n\nvar _removeRow2 = _interopRequireDefault(_removeRow);\n\nvar _rowAbove2 = _interopRequireDefault(_rowAbove);\n\nvar _rowBelow2 = _interopRequireDefault(_rowBelow);\n\nvar _separator2 = _interopRequireDefault(_separator);\n\nvar _undo2 = _interopRequireDefault(_undo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar ITEMS = exports.ITEMS = [_rowAbove.KEY, _rowBelow.KEY, _columnLeft.KEY, _columnRight.KEY, _clearColumn.KEY, _removeRow.KEY, _removeColumn.KEY, _undo.KEY, _redo.KEY, _readOnly.KEY, _alignment.KEY, _separator.KEY];\n\nvar _predefinedItems = (_predefinedItems2 = {}, _defineProperty(_predefinedItems2, _separator.KEY, _separator2.default), _defineProperty(_predefinedItems2, _rowAbove.KEY, _rowAbove2.default), _defineProperty(_predefinedItems2, _rowBelow.KEY, _rowBelow2.default), _defineProperty(_predefinedItems2, _columnLeft.KEY, _columnLeft2.default), _defineProperty(_predefinedItems2, _columnRight.KEY, _columnRight2.default), _defineProperty(_predefinedItems2, _clearColumn.KEY, _clearColumn2.default), _defineProperty(_predefinedItems2, _removeRow.KEY, _removeRow2.default), _defineProperty(_predefinedItems2, _removeColumn.KEY, _removeColumn2.default), _defineProperty(_predefinedItems2, _undo.KEY, _undo2.default), _defineProperty(_predefinedItems2, _redo.KEY, _redo2.default), _defineProperty(_predefinedItems2, _readOnly.KEY, _readOnly2.default), _defineProperty(_predefinedItems2, _alignment.KEY, _alignment2.default), _predefinedItems2);\n\n/**\n * Gets new object with all predefined menu items.\n *\n * @returns {Object}\n */\nfunction predefinedItems() {\n var items = {};\n\n (0, _object.objectEach)(_predefinedItems, function (itemFactory, key) {\n items[key] = itemFactory();\n });\n\n return items;\n}\n\n/**\n * Add new predefined menu item to the collection.\n *\n * @param {String} key Menu command id.\n * @param {Object} item Object command descriptor.\n */\nfunction addItem(key, item) {\n if (ITEMS.indexOf(key) === -1) {\n _predefinedItems[key] = item;\n }\n}\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = staticRegister;\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar collection = exports.collection = new Map();\n\nfunction staticRegister() {\n var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'common';\n\n if (!collection.has(namespace)) {\n collection.set(namespace, new Map());\n }\n var subCollection = collection.get(namespace);\n\n /**\n * Register an item to the collection. If the item under the same was exist earlier then this item will be replaced with new one.\n *\n * @param {String} name Identification of the item.\n * @param {*} item Item to save in the collection.\n */\n function register(name, item) {\n subCollection.set(name, item);\n }\n\n /**\n * Retrieve the item from the collection.\n *\n * @param {String} name Identification of the item.\n * @returns {*} Returns item which was saved in the collection.\n */\n function getItem(name) {\n return subCollection.get(name);\n }\n\n /**\n * Check if item under specyfied name is exists.\n *\n * @param {String} name Identification of the item.\n * @returns {Boolean} Returns `true` or `false` depends on if element exists in the collection.\n */\n function hasItem(name) {\n return subCollection.has(name);\n }\n\n /**\n * Retrieve list of names registered from the collection.\n *\n * @returns {Array} Returns an array of strings with all names under which objects are stored.\n */\n function getNames() {\n return [].concat(_toConsumableArray(subCollection.keys()));\n }\n\n /**\n * Retrieve all registered values from the collection.\n *\n * @returns {Array} Returns an array with all values stored in the collection.\n */\n function getValues() {\n return [].concat(_toConsumableArray(subCollection.values()));\n }\n\n return {\n register: register,\n getItem: getItem,\n hasItem: hasItem,\n getNames: getNames,\n getValues: getValues\n };\n}\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it, Constructor, name, forbiddenField){\n if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(29)\n , IObject = __webpack_require__(76)\n , toObject = __webpack_require__(41)\n , toLength = __webpack_require__(24)\n , asc = __webpack_require__(278);\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(13)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , redefineAll = __webpack_require__(59)\n , meta = __webpack_require__(46)\n , forOf = __webpack_require__(56)\n , anInstance = __webpack_require__(52)\n , isObject = __webpack_require__(15)\n , fails = __webpack_require__(31)\n , $iterDetect = __webpack_require__(77)\n , setToStringTag = __webpack_require__(48)\n , inheritIfRequired = __webpack_require__(281);\n\nmodule.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){\n var Base = global[NAME]\n , C = Base\n , ADDER = IS_MAP ? 'set' : 'add'\n , proto = C && C.prototype\n , O = {};\n var fixMethod = function(KEY){\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a){\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a){\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){\n new C().entries().next();\n }))){\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C\n // early implementations not supports chaining\n , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n , BUGGY_ZERO = !IS_WEAK && fails(function(){\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C()\n , index = 5;\n while(index--)$instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if(!ACCEPT_ITERABLES){ \n C = wrapper(function(target, iterable){\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base, target, C);\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);\n // weak collections should not contains .clear method\n if(IS_WEAK && proto.clear)delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar hide = __webpack_require__(32)\n , redefine = __webpack_require__(33)\n , fails = __webpack_require__(31)\n , defined = __webpack_require__(30)\n , wks = __webpack_require__(10);\n\nmodule.exports = function(KEY, length, exec){\n var SYMBOL = wks(KEY)\n , fns = exec(defined, SYMBOL, ''[KEY])\n , strfn = fns[0]\n , rxfn = fns[1];\n if(fails(function(){\n var O = {};\n O[SYMBOL] = function(){ return 7; };\n return ''[KEY](O) != 7;\n })){\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function(string, arg){ return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function(string){ return rxfn.call(string, this); }\n );\n }\n};\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(29)\n , call = __webpack_require__(165)\n , isArrayIter = __webpack_require__(161)\n , anObject = __webpack_require__(18)\n , toLength = __webpack_require__(24)\n , getIterFn = __webpack_require__(176)\n , BREAK = {}\n , RETURN = {};\nvar exports = module.exports = function(iterable, entries, fn, that, ITERATOR){\n var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)\n , f = ctx(fn, that, entries ? 2 : 1)\n , index = 0\n , length, step, iterator, result;\n if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if(result === BREAK || result === RETURN)return result;\n } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){\n result = call(iterator, f, step.value, entries);\n if(result === BREAK || result === RETURN)return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports) {\n\nmodule.exports = false;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\nexports.f = Object.getOwnPropertySymbols;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar redefine = __webpack_require__(33);\nmodule.exports = function(target, src, safe){\n for(var key in src)redefine(target, key, src[key], safe);\n return target;\n};\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(61)\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports) {\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_62__;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getRegisteredCellTypes = exports.getRegisteredCellTypeNames = exports.hasCellType = exports.getCellType = exports.registerCellType = undefined;\n\nvar _staticRegister2 = __webpack_require__(51);\n\nvar _staticRegister3 = _interopRequireDefault(_staticRegister2);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _autocompleteType = __webpack_require__(190);\n\nvar _autocompleteType2 = _interopRequireDefault(_autocompleteType);\n\nvar _checkboxType = __webpack_require__(191);\n\nvar _checkboxType2 = _interopRequireDefault(_checkboxType);\n\nvar _dateType = __webpack_require__(192);\n\nvar _dateType2 = _interopRequireDefault(_dateType);\n\nvar _dropdownType = __webpack_require__(193);\n\nvar _dropdownType2 = _interopRequireDefault(_dropdownType);\n\nvar _handsontableType = __webpack_require__(194);\n\nvar _handsontableType2 = _interopRequireDefault(_handsontableType);\n\nvar _numericType = __webpack_require__(195);\n\nvar _numericType2 = _interopRequireDefault(_numericType);\n\nvar _passwordType = __webpack_require__(196);\n\nvar _passwordType2 = _interopRequireDefault(_passwordType);\n\nvar _textType = __webpack_require__(197);\n\nvar _textType2 = _interopRequireDefault(_textType);\n\nvar _timeType = __webpack_require__(198);\n\nvar _timeType2 = _interopRequireDefault(_timeType);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _staticRegister = (0, _staticRegister3.default)('cellTypes'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n\n_register('autocomplete', _autocompleteType2.default);\n_register('checkbox', _checkboxType2.default);\n_register('date', _dateType2.default);\n_register('dropdown', _dropdownType2.default);\n_register('handsontable', _handsontableType2.default);\n_register('numeric', _numericType2.default);\n_register('password', _passwordType2.default);\n_register('text', _textType2.default);\n_register('time', _timeType2.default);\n\n/**\n * Retrieve cell type object.\n *\n * @param {String} name Cell type identification.\n * @returns {Object} Returns cell type object.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error('You declared cell type \"' + name + '\" as a string that is not mapped to a known object.\\n Cell type must be an object or a string mapped to an object registered by \"Handsontable.cellTypes.registerCellType\" method');\n }\n\n return getItem(name);\n}\n\n/**\n * Register cell type under specified name.\n *\n * @param {String} name Cell type identification.\n * @param {Object} type An object with contains keys (eq: `editor`, `renderer`, `validator`) which describes specified behaviour of the cell.\n */\nfunction _register(name, type) {\n var editor = type.editor,\n renderer = type.renderer,\n validator = type.validator;\n\n\n if (editor) {\n (0, _editors.registerEditor)(name, editor);\n }\n if (renderer) {\n (0, _renderers.registerRenderer)(name, renderer);\n }\n if (validator) {\n (0, _validators.registerValidator)(name, validator);\n }\n\n register(name, type);\n}\n\nexports.registerCellType = _register;\nexports.getCellType = _getItem;\nexports.hasCellType = hasItem;\nexports.getRegisteredCellTypeNames = getNames;\nexports.getRegisteredCellTypes = getValues;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = Core;\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _element = __webpack_require__(0);\n\nvar _setting = __webpack_require__(66);\n\nvar _function = __webpack_require__(35);\n\nvar _mixed = __webpack_require__(20);\n\nvar _browser = __webpack_require__(25);\n\nvar _dataMap = __webpack_require__(199);\n\nvar _dataMap2 = _interopRequireDefault(_dataMap);\n\nvar _editorManager = __webpack_require__(201);\n\nvar _editorManager2 = _interopRequireDefault(_editorManager);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _plugins = __webpack_require__(5);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _string = __webpack_require__(27);\n\nvar _number = __webpack_require__(6);\n\nvar _tableView = __webpack_require__(267);\n\nvar _tableView2 = _interopRequireDefault(_tableView);\n\nvar _dataSource = __webpack_require__(200);\n\nvar _dataSource2 = _interopRequireDefault(_dataSource);\n\nvar _data = __webpack_require__(65);\n\nvar _recordTranslator = __webpack_require__(153);\n\nvar _src = __webpack_require__(11);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _defaultSettings = __webpack_require__(87);\n\nvar _defaultSettings2 = _interopRequireDefault(_defaultSettings);\n\nvar _cellTypes = __webpack_require__(63);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar activeGuid = null;\n\n/**\n * Handsontable constructor\n *\n * @core\n * @dependencies numbro\n * @constructor Core\n * @description\n *\n * After Handsontable is constructed, you can modify the grid behavior using the available public methods.\n *\n * ---\n * ## How to call methods\n *\n * These are 2 equal ways to call a Handsontable method:\n *\n * ```js\n * // all following examples assume that you constructed Handsontable like this\n * var ht = new Handsontable(document.getElementById('example1'), options);\n *\n * // now, to use setDataAtCell method, you can either:\n * ht.setDataAtCell(0, 0, 'new value');\n * ```\n *\n * Alternatively, you can call the method using jQuery wrapper (__obsolete__, requires initialization using our jQuery guide\n * ```js\n * $('#example1').handsontable('setDataAtCell', 0, 0, 'new value');\n * ```\n * ---\n */\nfunction Core(rootElement, userSettings) {\n var priv,\n datamap,\n dataSource,\n grid,\n selection,\n editorManager,\n instance = this,\n GridSettings = function GridSettings() {},\n eventManager = new _eventManager2.default(instance);\n\n (0, _object.extend)(GridSettings.prototype, _defaultSettings2.default.prototype); // create grid settings as a copy of default settings\n (0, _object.extend)(GridSettings.prototype, userSettings); // overwrite defaults with user settings\n (0, _object.extend)(GridSettings.prototype, expandType(userSettings));\n\n this.rootElement = rootElement;\n this.isHotTableEnv = (0, _element.isChildOfWebComponentTable)(this.rootElement);\n _eventManager2.default.isHotTableEnv = this.isHotTableEnv;\n\n this.container = document.createElement('DIV');\n this.renderCall = false;\n\n rootElement.insertBefore(this.container, rootElement.firstChild);\n\n this.guid = 'ht_' + (0, _string.randomString)(); // this is the namespace for global events\n\n var recordTranslator = (0, _recordTranslator.getTranslator)(instance);\n\n dataSource = new _dataSource2.default(instance);\n\n if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {\n this.rootElement.id = this.guid; // if root element does not have an id, assign a random id\n }\n priv = {\n cellSettings: [],\n columnSettings: [],\n columnsSettingConflicts: ['data', 'width'],\n settings: new GridSettings(), // current settings instance\n selRange: null, // exposed by public method `getSelectedRange`\n isPopulated: null,\n scrollable: null,\n firstRun: true\n };\n\n grid = {\n /**\n * Inserts or removes rows and columns\n *\n * @memberof Core#\n * @function alter\n * @private\n * @param {String} action Possible values: \"insert_row\", \"insert_col\", \"remove_row\", \"remove_col\"\n * @param {Number} index\n * @param {Number} amount\n * @param {String} [source] Optional. Source of hook runner.\n * @param {Boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows.\n */\n alter: function alter(action, index, amount, source, keepEmptyRows) {\n var delta;\n\n amount = amount || 1;\n\n function spliceWith(data, index, count, toInject) {\n var valueFactory = function valueFactory() {\n var result = void 0;\n\n if (toInject === 'array') {\n result = [];\n } else if (toInject === 'object') {\n result = {};\n }\n\n return result;\n };\n var spliceArgs = (0, _array.arrayMap)(new Array(count), function () {\n return valueFactory();\n });\n\n spliceArgs.unshift(index, 0);\n data.splice.apply(data, _toConsumableArray(spliceArgs));\n }\n\n /* eslint-disable no-case-declarations */\n switch (action) {\n case 'insert_row':\n\n var numberOfSourceRows = instance.countSourceRows();\n\n if (instance.getSettings().maxRows === numberOfSourceRows) {\n return;\n }\n\n index = (0, _mixed.isDefined)(index) ? index : numberOfSourceRows;\n\n delta = datamap.createRow(index, amount, source);\n spliceWith(priv.cellSettings, index, amount, 'array');\n\n if (delta) {\n if (selection.isSelected() && priv.selRange.from.row >= index) {\n priv.selRange.from.row += delta;\n selection.transformEnd(delta, 0); // will call render() internally\n } else {\n selection.refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'insert_col':\n delta = datamap.createCol(index, amount, source);\n\n for (var row = 0, len = instance.countSourceRows(); row < len; row++) {\n if (priv.cellSettings[row]) {\n spliceWith(priv.cellSettings[row], index, amount);\n }\n }\n\n if (delta) {\n if (Array.isArray(instance.getSettings().colHeaders)) {\n var spliceArray = [index, 0];\n spliceArray.length += delta; // inserts empty (undefined) elements at the end of an array\n Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); // inserts empty (undefined) elements into the colHeader array\n }\n\n if (selection.isSelected() && priv.selRange.from.col >= index) {\n priv.selRange.from.col += delta;\n selection.transformEnd(0, delta); // will call render() internally\n } else {\n selection.refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'remove_row':\n datamap.removeRow(index, amount, source);\n priv.cellSettings.splice(index, amount);\n\n var totalRows = instance.countRows();\n var fixedRowsTop = instance.getSettings().fixedRowsTop;\n if (fixedRowsTop >= index + 1) {\n instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - index);\n }\n\n var fixedRowsBottom = instance.getSettings().fixedRowsBottom;\n if (fixedRowsBottom && index >= totalRows - fixedRowsBottom) {\n instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom);\n }\n\n grid.adjustRowsAndCols();\n selection.refreshBorders(); // it will call render and prepare methods\n break;\n\n case 'remove_col':\n var logicalColumnIndex = recordTranslator.toPhysicalColumn(index);\n\n datamap.removeCol(index, amount, source);\n\n for (var _row = 0, _len = instance.countSourceRows(); _row < _len; _row++) {\n if (priv.cellSettings[_row]) {\n // if row hasn't been rendered it wouldn't have cellSettings\n priv.cellSettings[_row].splice(logicalColumnIndex, amount);\n }\n }\n var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft;\n\n if (fixedColumnsLeft >= index + 1) {\n instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index);\n }\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n if (typeof logicalColumnIndex == 'undefined') {\n logicalColumnIndex = -1;\n }\n instance.getSettings().colHeaders.splice(logicalColumnIndex, amount);\n }\n\n grid.adjustRowsAndCols();\n selection.refreshBorders(); // it will call render and prepare methods\n\n break;\n default:\n throw new Error('There is no such action \"' + action + '\"');\n }\n\n if (!keepEmptyRows) {\n grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh\n }\n },\n\n\n /**\n * Makes sure there are empty rows at the bottom of the table\n */\n adjustRowsAndCols: function adjustRowsAndCols() {\n if (priv.settings.minRows) {\n // should I add empty rows to data source to meet minRows?\n var rows = instance.countRows();\n\n if (rows < priv.settings.minRows) {\n for (var r = 0, minRows = priv.settings.minRows; r < minRows - rows; r++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n if (priv.settings.minSpareRows) {\n var emptyRows = instance.countEmptyRows(true);\n\n // should I add empty rows to meet minSpareRows?\n if (emptyRows < priv.settings.minSpareRows) {\n for (; emptyRows < priv.settings.minSpareRows && instance.countSourceRows() < priv.settings.maxRows; emptyRows++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n {\n var emptyCols = void 0;\n\n // count currently empty cols\n if (priv.settings.minCols || priv.settings.minSpareCols) {\n emptyCols = instance.countEmptyCols(true);\n }\n\n // should I add empty cols to meet minCols?\n if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) {\n for (; instance.countCols() < priv.settings.minCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n // should I add empty cols to meet minSpareCols?\n if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' && emptyCols < priv.settings.minSpareCols) {\n for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n }\n var rowCount = instance.countRows();\n var colCount = instance.countCols();\n\n if (rowCount === 0 || colCount === 0) {\n selection.deselect();\n }\n\n if (selection.isSelected()) {\n var selectionChanged = false;\n var fromRow = priv.selRange.from.row;\n var fromCol = priv.selRange.from.col;\n var toRow = priv.selRange.to.row;\n var toCol = priv.selRange.to.col;\n\n // if selection is outside, move selection to last row\n if (fromRow > rowCount - 1) {\n fromRow = rowCount - 1;\n selectionChanged = true;\n\n if (toRow > fromRow) {\n toRow = fromRow;\n }\n } else if (toRow > rowCount - 1) {\n toRow = rowCount - 1;\n selectionChanged = true;\n\n if (fromRow > toRow) {\n fromRow = toRow;\n }\n }\n // if selection is outside, move selection to last row\n if (fromCol > colCount - 1) {\n fromCol = colCount - 1;\n selectionChanged = true;\n\n if (toCol > fromCol) {\n toCol = fromCol;\n }\n } else if (toCol > colCount - 1) {\n toCol = colCount - 1;\n selectionChanged = true;\n\n if (fromCol > toCol) {\n fromCol = toCol;\n }\n }\n\n if (selectionChanged) {\n instance.selectCell(fromRow, fromCol, toRow, toCol);\n }\n }\n if (instance.view) {\n instance.view.wt.wtOverlays.adjustElementsSize();\n }\n },\n\n\n /**\n * Populate the data from the provided 2d array from the given cell coordinates.\n *\n * @private\n * @param {Object} start Start selection position.\n * @param {Array} input 2d data array.\n * @param {Object} [end] End selection position (only for drag-down mode).\n * @param {String} [source=\"populateFromArray\"] Source information string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction (left|right|up|down) String specifying the direction.\n * @param {Array} deltas The deltas array.\n * @returns {Object|undefined} ending td in pasted area (only if any cell was changed).\n */\n populateFromArray: function populateFromArray(start, input, end, source, method, direction, deltas) {\n var r,\n rlen,\n c,\n clen,\n setData = [],\n current = {};\n\n rlen = input.length;\n\n if (rlen === 0) {\n return false;\n }\n\n var repeatCol,\n repeatRow,\n cmax,\n rmax,\n baseEnd = {\n row: end === null ? null : end.row,\n col: end === null ? null : end.col\n };\n\n /* eslint-disable no-case-declarations */\n // insert data with specified pasteMode method\n switch (method) {\n case 'shift_down':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n input = (0, _data.translateRowsToColumns)(input);\n for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) {\n if (c < clen) {\n var _instance;\n\n for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) {\n input[c].push(input[c][r % rlen]);\n }\n input[c].unshift(start.col + c, start.row, 0);\n (_instance = instance).spliceCol.apply(_instance, _toConsumableArray(input[c]));\n } else {\n var _instance2;\n\n input[c % clen][0] = start.col + c;\n (_instance2 = instance).spliceCol.apply(_instance2, _toConsumableArray(input[c % clen]));\n }\n }\n break;\n\n case 'shift_right':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) {\n if (r < rlen) {\n var _instance3;\n\n for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) {\n input[r].push(input[r][c % clen]);\n }\n input[r].unshift(start.row + r, start.col, 0);\n (_instance3 = instance).spliceRow.apply(_instance3, _toConsumableArray(input[r]));\n } else {\n var _instance4;\n\n input[r % rlen][0] = start.row + r;\n (_instance4 = instance).spliceRow.apply(_instance4, _toConsumableArray(input[r % rlen]));\n }\n }\n break;\n\n case 'overwrite':\n default:\n // overwrite and other not specified options\n current.row = start.row;\n current.col = start.col;\n\n var selected = { // selected range\n row: end && start ? end.row - start.row + 1 : 1,\n col: end && start ? end.col - start.col + 1 : 1\n };\n var skippedRow = 0;\n var skippedColumn = 0;\n var pushData = true;\n var cellMeta = void 0;\n\n var getInputValue = function getInputValue(row) {\n var col = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n var rowValue = input[row % input.length];\n\n if (col !== null) {\n return rowValue[col % rowValue.length];\n }\n\n return rowValue;\n };\n var rowInputLength = input.length;\n var rowSelectionLength = end ? end.row - start.row + 1 : 0;\n\n if (end) {\n rlen = rowSelectionLength;\n } else {\n rlen = Math.max(rowInputLength, rowSelectionLength);\n }\n for (r = 0; r < rlen; r++) {\n if (end && current.row > end.row && rowSelectionLength > rowInputLength || !priv.settings.allowInsertRow && current.row > instance.countRows() - 1 || current.row >= priv.settings.maxRows) {\n break;\n }\n var logicalRow = r - skippedRow;\n var colInputLength = getInputValue(logicalRow).length;\n var colSelectionLength = end ? end.col - start.col + 1 : 0;\n\n if (end) {\n clen = colSelectionLength;\n } else {\n clen = Math.max(colInputLength, colSelectionLength);\n }\n current.col = start.col;\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.autofill') && cellMeta.skipRowOnPaste) {\n skippedRow++;\n current.row++;\n rlen++;\n /* eslint-disable no-continue */\n continue;\n }\n skippedColumn = 0;\n\n for (c = 0; c < clen; c++) {\n if (end && current.col > end.col && colSelectionLength > colInputLength || !priv.settings.allowInsertColumn && current.col > instance.countCols() - 1 || current.col >= priv.settings.maxCols) {\n break;\n }\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.fill') && cellMeta.skipColumnOnPaste) {\n skippedColumn++;\n current.col++;\n clen++;\n continue;\n }\n if (cellMeta.readOnly) {\n current.col++;\n /* eslint-disable no-continue */\n continue;\n }\n var logicalColumn = c - skippedColumn;\n var value = getInputValue(logicalRow, logicalColumn);\n var orgValue = instance.getDataAtCell(current.row, current.col);\n var index = {\n row: logicalRow,\n col: logicalColumn\n };\n\n if (source === 'Autofill.fill') {\n var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);\n\n if (result) {\n value = (0, _mixed.isUndefined)(result.value) ? value : result.value;\n }\n }\n if (value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n if (orgValue === null || (typeof orgValue === 'undefined' ? 'undefined' : _typeof(orgValue)) !== 'object') {\n pushData = false;\n } else {\n var orgValueSchema = (0, _object.duckSchema)(orgValue[0] || orgValue);\n var valueSchema = (0, _object.duckSchema)(value[0] || value);\n\n /* eslint-disable max-depth */\n if ((0, _object.isObjectEquals)(orgValueSchema, valueSchema)) {\n value = (0, _object.deepClone)(value);\n } else {\n pushData = false;\n }\n }\n } else if (orgValue !== null && (typeof orgValue === 'undefined' ? 'undefined' : _typeof(orgValue)) === 'object') {\n pushData = false;\n }\n if (pushData) {\n setData.push([current.row, current.col, value]);\n }\n pushData = true;\n current.col++;\n }\n current.row++;\n }\n instance.setDataAtCell(setData, null, null, source || 'populateFromArray');\n break;\n }\n }\n };\n\n /* eslint-disable no-multi-assign */\n this.selection = selection = { // this public assignment is only temporary\n inProgress: false,\n\n selectedHeader: {\n cols: false,\n rows: false\n },\n\n /**\n * @param {Boolean} [rows=false]\n * @param {Boolean} [cols=false]\n * @param {Boolean} [corner=false]\n */\n setSelectedHeaders: function setSelectedHeaders() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var cols = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var corner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n instance.selection.selectedHeader.rows = rows;\n instance.selection.selectedHeader.cols = cols;\n instance.selection.selectedHeader.corner = corner;\n },\n\n\n /**\n * Sets inProgress to `true`. This enables onSelectionEnd and onSelectionEndByProp to function as desired.\n */\n begin: function begin() {\n instance.selection.inProgress = true;\n },\n\n\n /**\n * Sets inProgress to `false`. Triggers onSelectionEnd and onSelectionEndByProp.\n */\n finish: function finish() {\n var sel = instance.getSelected();\n instance.runHooks('afterSelectionEnd', sel[0], sel[1], sel[2], sel[3]);\n instance.runHooks('afterSelectionEndByProp', sel[0], instance.colToProp(sel[1]), sel[2], instance.colToProp(sel[3]));\n instance.selection.inProgress = false;\n },\n\n\n /**\n * @returns {Boolean}\n */\n isInProgress: function isInProgress() {\n return instance.selection.inProgress;\n },\n\n\n /**\n * Starts selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param keepEditorOpened\n */\n setRangeStart: function setRangeStart(coords, keepEditorOpened) {\n instance.runHooks('beforeSetRangeStart', coords);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n selection.setRangeEnd(coords, null, keepEditorOpened);\n },\n\n\n /**\n * Starts selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param keepEditorOpened\n */\n setRangeStartOnly: function setRangeStartOnly(coords) {\n instance.runHooks('beforeSetRangeStartOnly', coords);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n },\n\n\n /**\n * Ends selection range on given td object.\n *\n * @param {CellCoords} coords\n * @param {Boolean} [scrollToCell=true] If `true`, viewport will be scrolled to range end\n * @param {Boolean} [keepEditorOpened] If `true`, cell editor will be still opened after changing selection range\n */\n setRangeEnd: function setRangeEnd(coords, scrollToCell, keepEditorOpened) {\n if (priv.selRange === null) {\n return;\n }\n var disableVisualSelection,\n isHeaderSelected = false,\n areCoordsPositive = true;\n\n var firstVisibleRow = instance.view.wt.wtTable.getFirstVisibleRow();\n var firstVisibleColumn = instance.view.wt.wtTable.getFirstVisibleColumn();\n var newRangeCoords = {\n row: null,\n col: null\n };\n\n // trigger handlers\n instance.runHooks('beforeSetRangeEnd', coords);\n instance.selection.begin();\n\n newRangeCoords.row = coords.row < 0 ? firstVisibleRow : coords.row;\n newRangeCoords.col = coords.col < 0 ? firstVisibleColumn : coords.col;\n\n priv.selRange.to = new _src.CellCoords(newRangeCoords.row, newRangeCoords.col);\n\n if (!priv.settings.multiSelect) {\n priv.selRange.from = coords;\n }\n // set up current selection\n instance.view.wt.selections.current.clear();\n\n disableVisualSelection = instance.getCellMeta(priv.selRange.highlight.row, priv.selRange.highlight.col).disableVisualSelection;\n\n if (typeof disableVisualSelection === 'string') {\n disableVisualSelection = [disableVisualSelection];\n }\n\n if (disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('current') === -1) {\n instance.view.wt.selections.current.add(priv.selRange.highlight);\n }\n // set up area selection\n instance.view.wt.selections.area.clear();\n\n if ((disableVisualSelection === false || Array.isArray(disableVisualSelection) && disableVisualSelection.indexOf('area') === -1) && selection.isMultiple()) {\n instance.view.wt.selections.area.add(priv.selRange.from);\n instance.view.wt.selections.area.add(priv.selRange.to);\n }\n // set up highlight\n if (priv.settings.currentHeaderClassName || priv.settings.currentRowClassName || priv.settings.currentColClassName) {\n instance.view.wt.selections.highlight.clear();\n instance.view.wt.selections.highlight.add(priv.selRange.from);\n instance.view.wt.selections.highlight.add(priv.selRange.to);\n }\n\n var preventScrolling = (0, _object.createObjectPropListener)('value');\n\n // trigger handlers\n instance.runHooks('afterSelection', priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col, preventScrolling);\n instance.runHooks('afterSelectionByProp', priv.selRange.from.row, datamap.colToProp(priv.selRange.from.col), priv.selRange.to.row, datamap.colToProp(priv.selRange.to.col), preventScrolling);\n\n if (priv.selRange.from.row === 0 && priv.selRange.to.row === instance.countRows() - 1 && instance.countRows() > 1 || priv.selRange.from.col === 0 && priv.selRange.to.col === instance.countCols() - 1 && instance.countCols() > 1) {\n isHeaderSelected = true;\n }\n\n if (coords.row < 0 || coords.col < 0) {\n areCoordsPositive = false;\n }\n\n if (preventScrolling.isTouched()) {\n scrollToCell = !preventScrolling.value;\n }\n\n if (scrollToCell !== false && !isHeaderSelected && areCoordsPositive) {\n if (priv.selRange.from && !selection.isMultiple()) {\n instance.view.scrollViewport(priv.selRange.from);\n } else {\n instance.view.scrollViewport(coords);\n }\n }\n\n if (selection.selectedHeader.rows && selection.selectedHeader.cols) {\n (0, _element.addClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n } else if (selection.selectedHeader.rows) {\n (0, _element.removeClass)(instance.rootElement, 'ht__selection--columns');\n (0, _element.addClass)(instance.rootElement, 'ht__selection--rows');\n } else if (selection.selectedHeader.cols) {\n (0, _element.removeClass)(instance.rootElement, 'ht__selection--rows');\n (0, _element.addClass)(instance.rootElement, 'ht__selection--columns');\n } else {\n (0, _element.removeClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n }\n\n selection.refreshBorders(null, keepEditorOpened);\n },\n\n\n /**\n * Destroys editor, redraws borders around cells, prepares editor.\n *\n * @param {Boolean} [revertOriginal]\n * @param {Boolean} [keepEditor]\n */\n refreshBorders: function refreshBorders(revertOriginal, keepEditor) {\n if (!keepEditor) {\n editorManager.destroyEditor(revertOriginal);\n }\n instance.view.render();\n\n if (selection.isSelected() && !keepEditor) {\n editorManager.prepareEditor();\n }\n },\n\n\n /**\n * Returns information if we have a multiselection.\n *\n * @returns {Boolean}\n */\n isMultiple: function isMultiple() {\n var isMultiple = !(priv.selRange.to.col === priv.selRange.from.col && priv.selRange.to.row === priv.selRange.from.row),\n modifier = instance.runHooks('afterIsMultipleSelection', isMultiple);\n\n if (isMultiple) {\n return modifier;\n }\n },\n\n\n /**\n * Selects cell relative to current cell (if possible).\n */\n transformStart: function transformStart(rowDelta, colDelta, force, keepEditorOpened) {\n var delta = new _src.CellCoords(rowDelta, colDelta),\n rowTransformDir = 0,\n colTransformDir = 0,\n totalRows,\n totalCols,\n coords,\n fixedRowsBottom;\n\n instance.runHooks('modifyTransformStart', delta);\n totalRows = instance.countRows();\n totalCols = instance.countCols();\n fixedRowsBottom = instance.getSettings().fixedRowsBottom;\n\n if (priv.selRange.highlight.row + rowDelta > totalRows - 1) {\n if (force && priv.settings.minSpareRows > 0 && !(fixedRowsBottom && priv.selRange.highlight.row >= totalRows - fixedRowsBottom - 1)) {\n instance.alter('insert_row', totalRows);\n totalRows = instance.countRows();\n } else if (priv.settings.autoWrapCol) {\n delta.row = 1 - totalRows;\n delta.col = priv.selRange.highlight.col + delta.col == totalCols - 1 ? 1 - totalCols : 1;\n }\n } else if (priv.settings.autoWrapCol && priv.selRange.highlight.row + delta.row < 0 && priv.selRange.highlight.col + delta.col >= 0) {\n delta.row = totalRows - 1;\n delta.col = priv.selRange.highlight.col + delta.col == 0 ? totalCols - 1 : -1;\n }\n\n if (priv.selRange.highlight.col + delta.col > totalCols - 1) {\n if (force && priv.settings.minSpareCols > 0) {\n instance.alter('insert_col', totalCols);\n totalCols = instance.countCols();\n } else if (priv.settings.autoWrapRow) {\n delta.row = priv.selRange.highlight.row + delta.row == totalRows - 1 ? 1 - totalRows : 1;\n delta.col = 1 - totalCols;\n }\n } else if (priv.settings.autoWrapRow && priv.selRange.highlight.col + delta.col < 0 && priv.selRange.highlight.row + delta.row >= 0) {\n delta.row = priv.selRange.highlight.row + delta.row == 0 ? totalRows - 1 : -1;\n delta.col = totalCols - 1;\n }\n\n coords = new _src.CellCoords(priv.selRange.highlight.row + delta.row, priv.selRange.highlight.col + delta.col);\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n instance.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);\n selection.setRangeStart(coords, keepEditorOpened);\n },\n\n\n /**\n * Sets selection end cell relative to current selection end cell (if possible).\n */\n transformEnd: function transformEnd(rowDelta, colDelta) {\n var delta = new _src.CellCoords(rowDelta, colDelta),\n rowTransformDir = 0,\n colTransformDir = 0,\n totalRows,\n totalCols,\n coords;\n\n instance.runHooks('modifyTransformEnd', delta);\n\n totalRows = instance.countRows();\n totalCols = instance.countCols();\n coords = new _src.CellCoords(priv.selRange.to.row + delta.row, priv.selRange.to.col + delta.col);\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n instance.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);\n selection.setRangeEnd(coords, true);\n },\n\n\n /**\n * Returns `true` if currently there is a selection on screen, `false` otherwise.\n *\n * @returns {Boolean}\n */\n isSelected: function isSelected() {\n return priv.selRange !== null;\n },\n\n\n /**\n * Returns `true` if coords is within current selection coords.\n *\n * @param {CellCoords} coords\n * @returns {Boolean}\n */\n inInSelection: function inInSelection(coords) {\n if (!selection.isSelected()) {\n return false;\n }\n\n return priv.selRange.includes(coords);\n },\n\n\n /**\n * Deselects all selected cells\n */\n deselect: function deselect() {\n if (!selection.isSelected()) {\n return;\n }\n instance.selection.inProgress = false; // needed by HT inception\n priv.selRange = null;\n instance.view.wt.selections.current.clear();\n instance.view.wt.selections.area.clear();\n if (priv.settings.currentHeaderClassName || priv.settings.currentRowClassName || priv.settings.currentColClassName) {\n instance.view.wt.selections.highlight.clear();\n }\n editorManager.destroyEditor();\n selection.refreshBorders();\n (0, _element.removeClass)(instance.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n instance.runHooks('afterDeselect');\n },\n\n\n /**\n * Select all cells\n */\n selectAll: function selectAll() {\n if (!priv.settings.multiSelect) {\n return;\n }\n selection.setSelectedHeaders(true, true, true);\n selection.setRangeStart(new _src.CellCoords(0, 0));\n selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, instance.countCols() - 1), false);\n },\n\n\n /**\n * Deletes data from selected cells\n */\n empty: function empty() {\n if (!selection.isSelected()) {\n return;\n }\n var topLeft = priv.selRange.getTopLeftCorner();\n var bottomRight = priv.selRange.getBottomRightCorner();\n var r,\n c,\n changes = [];\n\n for (r = topLeft.row; r <= bottomRight.row; r++) {\n for (c = topLeft.col; c <= bottomRight.col; c++) {\n if (!instance.getCellMeta(r, c).readOnly) {\n changes.push([r, c, '']);\n }\n }\n }\n instance.setDataAtCell(changes);\n }\n };\n\n this.init = function () {\n dataSource.setData(priv.settings.data);\n instance.runHooks('beforeInit');\n\n if ((0, _browser.isMobileBrowser)()) {\n (0, _element.addClass)(instance.rootElement, 'mobile');\n }\n\n this.updateSettings(priv.settings, true);\n\n this.view = new _tableView2.default(this);\n editorManager = new _editorManager2.default(instance, priv, selection, datamap);\n\n this.forceFullRender = true; // used when data was changed\n\n instance.runHooks('init');\n this.view.render();\n\n if (_typeof(priv.firstRun) === 'object') {\n instance.runHooks('afterChange', priv.firstRun[0], priv.firstRun[1]);\n priv.firstRun = false;\n }\n instance.runHooks('afterInit');\n };\n\n function ValidatorsQueue() {\n // moved this one level up so it can be used in any function here. Probably this should be moved to a separate file\n var resolved = false;\n\n return {\n validatorsInQueue: 0,\n valid: true,\n addValidatorToQueue: function addValidatorToQueue() {\n this.validatorsInQueue++;\n resolved = false;\n },\n removeValidatorFormQueue: function removeValidatorFormQueue() {\n this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;\n this.checkIfQueueIsEmpty();\n },\n onQueueEmpty: function onQueueEmpty(valid) {},\n checkIfQueueIsEmpty: function checkIfQueueIsEmpty() {\n if (this.validatorsInQueue == 0 && resolved == false) {\n resolved = true;\n this.onQueueEmpty(this.valid);\n }\n }\n };\n }\n\n function validateChanges(changes, source, callback) {\n var waitingForValidator = new ValidatorsQueue();\n waitingForValidator.onQueueEmpty = resolve;\n\n for (var i = changes.length - 1; i >= 0; i--) {\n if (changes[i] === null) {\n changes.splice(i, 1);\n } else {\n var row = changes[i][0];\n var col = datamap.propToCol(changes[i][1]);\n\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type === 'numeric' && typeof changes[i][3] === 'string') {\n if (changes[i][3].length > 0 && (/^-?[\\d\\s]*(\\.|,)?\\d*$/.test(changes[i][3]) || cellProperties.format)) {\n var len = changes[i][3].length;\n\n if ((0, _mixed.isUndefined)(cellProperties.language)) {\n _numbro2.default.culture('en-US');\n } else if (changes[i][3].indexOf('.') === len - 3 && changes[i][3].indexOf(',') === -1) {\n // this input in format XXXX.XX is likely to come from paste. Let's parse it using international rules\n _numbro2.default.culture('en-US');\n } else {\n\n _numbro2.default.culture(cellProperties.language);\n }\n\n var _numbro$cultureData = _numbro2.default.cultureData(_numbro2.default.culture()),\n delimiters = _numbro$cultureData.delimiters;\n\n // try to parse to float - https://github.com/foretagsplatsen/numbro/pull/183\n\n\n if (_numbro2.default.validate(changes[i][3]) && !isNaN(changes[i][3])) {\n changes[i][3] = parseFloat(changes[i][3]);\n } else {\n changes[i][3] = (0, _numbro2.default)().unformat(changes[i][3]) || changes[i][3];\n }\n }\n }\n\n /* eslint-disable no-loop-func */\n if (instance.getCellValidator(cellProperties)) {\n waitingForValidator.addValidatorToQueue();\n instance.validateCell(changes[i][3], cellProperties, function (i, cellProperties) {\n return function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false && cellProperties.allowInvalid === false) {\n changes.splice(i, 1); // cancel the change\n cellProperties.valid = true; // we cancelled the change, so cell value is still valid\n var cell = instance.getCell(cellProperties.row, cellProperties.col);\n (0, _element.removeClass)(cell, instance.getSettings().invalidCellClassName);\n --i;\n }\n waitingForValidator.removeValidatorFormQueue();\n };\n }(i, cellProperties), source);\n }\n }\n }\n waitingForValidator.checkIfQueueIsEmpty();\n\n function resolve() {\n var beforeChangeResult;\n\n if (changes.length) {\n beforeChangeResult = instance.runHooks('beforeChange', changes, source);\n if ((0, _function.isFunction)(beforeChangeResult)) {\n console.warn('Your beforeChange callback returns a function. It\\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).');\n } else if (beforeChangeResult === false) {\n changes.splice(0, changes.length); // invalidate all changes (remove everything from array)\n }\n }\n callback(); // called when async validators are resolved and beforeChange was not async\n }\n }\n\n /**\n * Internal function to apply changes. Called after validateChanges\n *\n * @private\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue]\n * @param {String} source String that identifies how this change will be described in changes array (useful in onChange callback)\n * @fires Hooks#beforeChangeRender\n * @fires Hooks#afterChange\n */\n function applyChanges(changes, source) {\n var i = changes.length - 1;\n\n if (i < 0) {\n return;\n }\n\n for (; i >= 0; i--) {\n var skipThisChange = false;\n\n if (changes[i] === null) {\n changes.splice(i, 1);\n /* eslint-disable no-continue */\n continue;\n }\n\n if (changes[i][2] == null && changes[i][3] == null) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (priv.settings.allowInsertRow) {\n while (changes[i][0] > instance.countRows() - 1) {\n var numberOfCreatedRows = datamap.createRow(void 0, void 0, source);\n\n if (numberOfCreatedRows === 0) {\n skipThisChange = true;\n break;\n }\n }\n }\n\n if (skipThisChange) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (instance.dataType === 'array' && (!priv.settings.columns || priv.settings.columns.length === 0) && priv.settings.allowInsertColumn) {\n while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) {\n datamap.createCol(void 0, void 0, source);\n }\n }\n\n datamap.set(changes[i][0], changes[i][1], changes[i][3]);\n }\n\n instance.forceFullRender = true; // used when data was changed\n grid.adjustRowsAndCols();\n instance.runHooks('beforeChangeRender', changes, source);\n selection.refreshBorders(null, true);\n instance.view.wt.wtOverlays.adjustElementsSize();\n instance.runHooks('afterChange', changes, source || 'edit');\n\n var activeEditor = instance.getActiveEditor();\n\n if (activeEditor && (0, _mixed.isDefined)(activeEditor.refreshValue)) {\n activeEditor.refreshValue();\n }\n }\n\n this.validateCell = function (value, cellProperties, callback, source) {\n var validator = instance.getCellValidator(cellProperties);\n\n function done(valid) {\n var col = cellProperties.visualCol,\n row = cellProperties.visualRow,\n td = instance.getCell(row, col, true);\n\n if (td && td.nodeName != 'TH') {\n instance.view.wt.wtSettings.settings.cellRenderer(row, col, td);\n }\n callback(valid);\n }\n\n if ((0, _mixed.isRegExp)(validator)) {\n validator = function (validator) {\n return function (value, callback) {\n callback(validator.test(value));\n };\n }(validator);\n }\n\n if ((0, _function.isFunction)(validator)) {\n\n value = instance.runHooks('beforeValidate', value, cellProperties.visualRow, cellProperties.prop, source);\n\n // To provide consistent behaviour, validation should be always asynchronous\n instance._registerTimeout(setTimeout(function () {\n validator.call(cellProperties, value, function (valid) {\n valid = instance.runHooks('afterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n cellProperties.valid = valid;\n\n done(valid);\n instance.runHooks('postAfterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n });\n }, 0));\n } else {\n // resolve callback even if validator function was not found\n instance._registerTimeout(setTimeout(function () {\n cellProperties.valid = true;\n done(cellProperties.valid);\n }, 0));\n }\n };\n\n function setDataInputToArray(row, propOrCol, value) {\n if ((typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n // is it an array of changes\n return row;\n }\n return [[row, propOrCol, value]];\n }\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, col, value], ...]` as\n * the only parameter. `col` is the index of a __visible__ column (note that if columns were reordered,\n * the current visible order will be used). `source` is a flag for before/afterChange events. If you pass only array of\n * changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtCell\n * @param {Number|Array} row Row index or array of changes in format `[[row, col, value], ...]`.\n * @param {Number} col Column index.\n * @param {String} value New value.\n * @param {String} [source] String that identifies how this change will be described in the changes array (useful in onAfterChange or onBeforeChange callback).\n */\n this.setDataAtCell = function (row, col, value, source) {\n var input = setDataInputToArray(row, col, value),\n i,\n ilen,\n changes = [],\n prop;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n if (_typeof(input[i]) !== 'object') {\n throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter');\n }\n if (typeof input[i][1] !== 'number') {\n throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`');\n }\n prop = datamap.colToProp(input[i][1]);\n changes.push([input[i][0], prop, dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!source && (typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n source = col;\n }\n\n instance.runHooks('afterSetDataAtCell', changes, source);\n\n validateChanges(changes, source, function () {\n applyChanges(changes, source);\n });\n };\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, prop, value], ...]` as\n * the only parameter. `prop` is the name of the object property (e.g. `first.name`). `source` is a flag for before/afterChange events.\n * If you pass only array of changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtRowProp\n * @param {Number|Array} row Row index or array of changes in format `[[row, prop, value], ...]`.\n * @param {String} prop Property name or the source string.\n * @param {String} value Value to be set.\n * @param {String} [source] String that identifies how this change will be described in changes array (useful in onChange callback).\n */\n this.setDataAtRowProp = function (row, prop, value, source) {\n var input = setDataInputToArray(row, prop, value),\n i,\n ilen,\n changes = [];\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n changes.push([input[i][0], input[i][1], dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!source && (typeof row === 'undefined' ? 'undefined' : _typeof(row)) === 'object') {\n source = prop;\n }\n\n instance.runHooks('afterSetDataAtRowProp', changes, source);\n\n validateChanges(changes, source, function () {\n applyChanges(changes, source);\n });\n };\n\n /**\n * Listen to the keyboard input on document body.\n *\n * @memberof Core#\n * @function listen\n * @since 0.11\n */\n this.listen = function () {\n activeGuid = instance.guid;\n };\n\n /**\n * Stop listening to keyboard input on the document body.\n *\n * @memberof Core#\n * @function unlisten\n * @since 0.11\n */\n this.unlisten = function () {\n activeGuid = null;\n };\n\n /**\n * Returns `true` if the current Handsontable instance is listening to keyboard input on document body.\n *\n * @memberof Core#\n * @function isListening\n * @since 0.11\n * @returns {Boolean} `true` if the instance is listening, `false` otherwise.\n */\n this.isListening = function () {\n return activeGuid === instance.guid;\n };\n\n /**\n * Destroys the current editor, renders and selects the current cell.\n *\n * @memberof Core#\n * @function destroyEditor\n * @param {Boolean} [revertOriginal] If != `true`, edited data is saved. Otherwise the previous value is restored.\n */\n this.destroyEditor = function (revertOriginal) {\n selection.refreshBorders(revertOriginal);\n };\n\n /**\n * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`).\n * Use `endRow`, `endCol` when you want to cut input when a certain row is reached.\n * Optional `source` parameter (default value \"populateFromArray\") is used to identify this call in the resulting events (beforeChange, afterChange).\n * Optional `populateMethod` parameter (default value \"overwrite\", possible values \"shift_down\" and \"shift_right\")\n * has the same effect as pasteMode option {@link Options#pasteMode}\n *\n * @memberof Core#\n * @function populateFromArray\n * @since 0.9.0\n * @param {Number} row Start row\n * @param {Number} col Start column\n * @param {Array} input 2d array\n * @param {Number} [endRow] End row (use when you want to cut input when certain row is reached)\n * @param {Number} [endCol] End column (use when you want to cut input when certain column is reached)\n * @param {String} [source=\"populateFromArray\"] Source string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction Populate direction. (left|right|up|down)\n * @param {Array} deltas Deltas array.\n * @returns {Object|undefined} The ending TD element in pasted area (only if any cells were changed).\n */\n this.populateFromArray = function (row, col, input, endRow, endCol, source, method, direction, deltas) {\n var c;\n\n if (!((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && _typeof(input[0]) === 'object')) {\n throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly\n }\n c = typeof endRow === 'number' ? new _src.CellCoords(endRow, endCol) : null;\n\n return grid.populateFromArray(new _src.CellCoords(row, col), input, c, source, method, direction, deltas);\n };\n\n /**\n * Adds/removes data from the column. This function is modelled after Array.splice.\n * Parameter `col` is the index of the column in which do you want to do splice.\n * Parameter `index` is the row index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of the old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceCol}\n *\n * @memberof Core#\n * @function spliceCol\n * @since 0.9-beta2\n * @param {Number} col Index of the column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceCol = function (col, index, amount /* , elements... */) {\n var _datamap;\n\n return (_datamap = datamap).spliceCol.apply(_datamap, arguments);\n };\n\n /**\n * Adds/removes data from the row. This function works is modelled after Array.splice.\n * Parameter `row` is the index of row in which do you want to do splice.\n * Parameter `index` is the column index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceRow}\n *\n * @memberof Core#\n * @function spliceRow\n * @since 0.11\n * @param {Number} row Index of column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceRow = function (row, index, amount /* , elements... */) {\n var _datamap2;\n\n return (_datamap2 = datamap).spliceRow.apply(_datamap2, arguments);\n };\n\n /**\n * Returns indexes of the currently selected cells as an array `[startRow, startCol, endRow, endCol]`.\n *\n * Start row and start col are the coordinates of the active cell (where the selection was started).\n *\n * @memberof Core#\n * @function getSelected\n * @returns {Array} Array of the selection's indexes.\n */\n this.getSelected = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return [priv.selRange.from.row, priv.selRange.from.col, priv.selRange.to.row, priv.selRange.to.col];\n }\n };\n\n /**\n * Returns the current selection as a CellRange object.\n *\n * @memberof Core#\n * @function getSelectedRange\n * @since 0.11\n * @returns {CellRange} Selected range object or undefined` if there is no selection.\n */\n this.getSelectedRange = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return priv.selRange;\n }\n };\n\n /**\n * Rerender the table.\n *\n * @memberof Core#\n * @function render\n */\n this.render = function () {\n if (instance.view) {\n instance.renderCall = true;\n instance.forceFullRender = true; // used when data was changed\n selection.refreshBorders(null, true);\n }\n };\n\n /**\n * Reset all cells in the grid to contain data from the data array.\n *\n * @memberof Core#\n * @function loadData\n * @param {Array} data Array of arrays or array of objects containing data.\n * @fires Hooks#afterLoadData\n * @fires Hooks#afterChange\n */\n this.loadData = function (data) {\n if (Array.isArray(priv.settings.dataSchema)) {\n instance.dataType = 'array';\n } else if ((0, _function.isFunction)(priv.settings.dataSchema)) {\n instance.dataType = 'function';\n } else {\n instance.dataType = 'object';\n }\n\n if (datamap) {\n datamap.destroy();\n }\n datamap = new _dataMap2.default(instance, priv, GridSettings);\n\n if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object' && data !== null) {\n if (!(data.push && data.splice)) {\n // check if data is array. Must use duck-type check so Backbone Collections also pass it\n // when data is not an array, attempt to make a single-row array of it\n data = [data];\n }\n } else if (data === null) {\n data = [];\n var row;\n var r = 0;\n var rlen = 0;\n var dataSchema = datamap.getSchema();\n\n for (r = 0, rlen = priv.settings.startRows; r < rlen; r++) {\n if ((instance.dataType === 'object' || instance.dataType === 'function') && priv.settings.dataSchema) {\n row = (0, _object.deepClone)(dataSchema);\n data.push(row);\n } else if (instance.dataType === 'array') {\n row = (0, _object.deepClone)(dataSchema[0]);\n data.push(row);\n } else {\n row = [];\n\n for (var c = 0, clen = priv.settings.startCols; c < clen; c++) {\n row.push(null);\n }\n\n data.push(row);\n }\n }\n } else {\n throw new Error('loadData only accepts array of objects or array of arrays (' + (typeof data === 'undefined' ? 'undefined' : _typeof(data)) + ' given)');\n }\n\n priv.isPopulated = false;\n GridSettings.prototype.data = data;\n\n if (Array.isArray(data[0])) {\n instance.dataType = 'array';\n }\n\n datamap.dataSource = data;\n dataSource.data = data;\n dataSource.dataType = instance.dataType;\n dataSource.colToProp = datamap.colToProp.bind(datamap);\n dataSource.propToCol = datamap.propToCol.bind(datamap);\n\n clearCellSettingCache();\n\n grid.adjustRowsAndCols();\n instance.runHooks('afterLoadData', priv.firstRun);\n\n if (priv.firstRun) {\n priv.firstRun = [null, 'loadData'];\n } else {\n instance.runHooks('afterChange', null, 'loadData');\n instance.render();\n }\n priv.isPopulated = true;\n\n function clearCellSettingCache() {\n priv.cellSettings.length = 0;\n }\n };\n\n /**\n * Returns the current data object (the same one that was passed by `data` configuration option or `loadData` method,\n * unless the `modifyRow` hook was used to trim some of the rows. If that's the case - use the {@link Core#getSourceData} method.).\n * Optionally you can provide cell range by defining `row`, `col`, `row2`, `col2` to get only a fragment of grid data.\n *\n * Note: getData functionality changed with the release of version 0.20. If you're looking for the previous functionality,\n * you should use the {@link Core#getSourceData} method.\n *\n * @memberof Core#\n * @function getData\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} Array with the data.\n */\n this.getData = function (r, c, r2, c2) {\n if ((0, _mixed.isUndefined)(r)) {\n return datamap.getAll();\n }\n return datamap.getRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2), datamap.DESTINATION_RENDERER);\n };\n\n /**\n * Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new line character.\n * {@link DataMap#getCopyableText}\n *\n * @memberof Core#\n * @function getCopyableText\n * @since 0.11\n * @param {Number} startRow From row.\n * @param {Number} startCol From column.\n * @param {Number} endRow To row.\n * @param {Number} endCol To column.\n * @returns {String}\n */\n this.getCopyableText = function (startRow, startCol, endRow, endCol) {\n return datamap.getCopyableText(new _src.CellCoords(startRow, startCol), new _src.CellCoords(endRow, endCol));\n };\n\n /**\n * Returns the data's copyable value at specified row and column index ({@link DataMap#getCopyable}).\n *\n * @memberof Core#\n * @function getCopyableData\n * @since 0.19.0\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {String}\n */\n this.getCopyableData = function (row, column) {\n return datamap.getCopyable(row, datamap.colToProp(column));\n };\n\n /**\n * Returns schema provided by constructor settings. If it doesn't exist then it returns the schema based on the data\n * structure in the first row.\n *\n * @memberof Core#\n * @function getSchema\n * @since 0.13.2\n * @returns {Object} Schema object.\n */\n this.getSchema = function () {\n return datamap.getSchema();\n };\n\n /**\n * Use it if you need to change configuration after initialization. The `settings` parameter is an object containing the new\n * settings, declared the same way as in the initial settings object.\n * Note, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset\n * the settings made post-initialization. (for example - ignore changes made using the columnResize feature).\n *\n * @memberof Core#\n * @function updateSettings\n * @param {Object} settings New settings object.\n * @param {Boolean} init\n * @example\n * ```js\n * hot.updateSettings({\n * contextMenu: true,\n * colHeaders: true,\n * fixedRowsTop: 2\n * });\n * ```\n * @fires Hooks#afterCellMetaReset\n * @fires Hooks#afterUpdateSettings\n */\n this.updateSettings = function (settings, init) {\n var columnsAsFunc = false;\n var i = void 0;\n var j = void 0;\n var clen = void 0;\n\n if ((0, _mixed.isDefined)(settings.rows)) {\n throw new Error('\"rows\" setting is no longer supported. do you mean startRows, minRows or maxRows?');\n }\n if ((0, _mixed.isDefined)(settings.cols)) {\n throw new Error('\"cols\" setting is no longer supported. do you mean startCols, minCols or maxCols?');\n }\n\n for (i in settings) {\n if (i === 'data') {\n /* eslint-disable no-continue */\n continue; // loadData will be triggered later\n } else if (_pluginHooks2.default.getSingleton().getRegistered().indexOf(i) > -1) {\n if ((0, _function.isFunction)(settings[i]) || Array.isArray(settings[i])) {\n settings[i].initialHook = true;\n instance.addHook(i, settings[i]);\n }\n } else if (!init && (0, _object.hasOwnProperty)(settings, i)) {\n // Update settings\n GridSettings.prototype[i] = settings[i];\n }\n }\n\n // Load data or create data map\n if (settings.data === void 0 && priv.settings.data === void 0) {\n instance.loadData(null); // data source created just now\n } else if (settings.data !== void 0) {\n instance.loadData(settings.data); // data source given as option\n } else if (settings.columns !== void 0) {\n datamap.createMap();\n }\n\n clen = instance.countCols();\n\n var columnSetting = settings.columns || GridSettings.prototype.columns;\n\n // Init columns constructors configuration\n if (columnSetting && (0, _function.isFunction)(columnSetting)) {\n clen = instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n // Clear cellSettings cache\n if (settings.cell !== void 0 || settings.cells !== void 0 || settings.columns !== void 0) {\n priv.cellSettings.length = 0;\n }\n\n if (clen > 0) {\n var proto = void 0;\n var column = void 0;\n\n for (i = 0, j = 0; i < clen; i++) {\n if (columnsAsFunc && !columnSetting(i)) {\n /* eslint-disable no-continue */\n continue;\n }\n priv.columnSettings[j] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n\n // shortcut for prototype\n proto = priv.columnSettings[j].prototype;\n\n // Use settings provided by user\n if (columnSetting) {\n if (columnsAsFunc) {\n column = columnSetting(i);\n } else {\n column = columnSetting[j];\n }\n\n if (column) {\n (0, _object.extend)(proto, column);\n (0, _object.extend)(proto, expandType(column));\n }\n }\n\n j++;\n }\n }\n\n if ((0, _mixed.isDefined)(settings.cell)) {\n for (var key in settings.cell) {\n if ((0, _object.hasOwnProperty)(settings.cell, key)) {\n var cell = settings.cell[key];\n\n instance.setCellMetaObject(cell.row, cell.col, cell);\n }\n }\n }\n\n instance.runHooks('afterCellMetaReset');\n\n if ((0, _mixed.isDefined)(settings.className)) {\n if (GridSettings.prototype.className) {\n (0, _element.removeClass)(instance.rootElement, GridSettings.prototype.className);\n }\n if (settings.className) {\n (0, _element.addClass)(instance.rootElement, settings.className);\n }\n }\n\n var currentHeight = instance.rootElement.style.height;\n if (currentHeight !== '') {\n currentHeight = parseInt(instance.rootElement.style.height, 10);\n }\n\n var height = settings.height;\n if ((0, _function.isFunction)(height)) {\n height = height();\n }\n\n if (init) {\n var initialStyle = instance.rootElement.getAttribute('style');\n\n if (initialStyle) {\n instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style'));\n }\n }\n\n if (height === null) {\n var _initialStyle = instance.rootElement.getAttribute('data-initialstyle');\n\n if (_initialStyle && (_initialStyle.indexOf('height') > -1 || _initialStyle.indexOf('overflow') > -1)) {\n instance.rootElement.setAttribute('style', _initialStyle);\n } else {\n instance.rootElement.style.height = '';\n instance.rootElement.style.overflow = '';\n }\n } else if (height !== void 0) {\n instance.rootElement.style.height = height + 'px';\n instance.rootElement.style.overflow = 'hidden';\n }\n\n if (typeof settings.width != 'undefined') {\n var width = settings.width;\n\n if ((0, _function.isFunction)(width)) {\n width = width();\n }\n\n instance.rootElement.style.width = width + 'px';\n }\n\n if (!init) {\n datamap.clearLengthCache(); // force clear cache length on updateSettings() #3416\n\n if (instance.view) {\n instance.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked();\n }\n\n instance.runHooks('afterUpdateSettings');\n }\n\n grid.adjustRowsAndCols();\n if (instance.view && !priv.firstRun) {\n instance.forceFullRender = true; // used when data was changed\n selection.refreshBorders(null, true);\n }\n\n if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {\n instance.view.wt.wtOverlays.updateMainScrollableElements();\n }\n };\n\n /**\n * Get value from the selected cell.\n *\n * @memberof Core#\n * @function getValue\n * @since 0.11\n * @returns {*} Value of selected cell.\n */\n this.getValue = function () {\n var sel = instance.getSelected();\n if (GridSettings.prototype.getValue) {\n if ((0, _function.isFunction)(GridSettings.prototype.getValue)) {\n return GridSettings.prototype.getValue.call(instance);\n } else if (sel) {\n return instance.getData()[sel[0]][GridSettings.prototype.getValue];\n }\n } else if (sel) {\n return instance.getDataAtCell(sel[0], sel[1]);\n }\n };\n\n function expandType(obj) {\n if (!(0, _object.hasOwnProperty)(obj, 'type')) {\n // ignore obj.prototype.type\n return;\n }\n\n var type,\n expandedType = {};\n\n if (_typeof(obj.type) === 'object') {\n type = obj.type;\n } else if (typeof obj.type === 'string') {\n type = (0, _cellTypes.getCellType)(obj.type);\n }\n\n for (var i in type) {\n if ((0, _object.hasOwnProperty)(type, i) && !(0, _object.hasOwnProperty)(obj, i)) {\n expandedType[i] = type[i];\n }\n }\n\n return expandedType;\n }\n\n /**\n * Returns the object settings.\n *\n * @memberof Core#\n * @function getSettings\n * @returns {Object} Object containing the current grid settings.\n */\n this.getSettings = function () {\n return priv.settings;\n };\n\n /**\n * Clears the data from the grid. (The table settings remain intact.)\n *\n * @memberof Core#\n * @function clear\n * @since 0.11\n */\n this.clear = function () {\n selection.selectAll();\n selection.empty();\n };\n\n /**\n * @memberof Core#\n * @function alter\n * @param {String} action See grid.alter for possible values: `\"insert_row\"`, `\"insert_col\"`, `\"remove_row\"`, `\"remove_col\"`\n * @param {Number} index Index of the row/column before which the new row/column will be inserted/removed.\n * @param {Number} [amount = 1] Amound of rows/columns to be inserted/removed.\n * @param {String} [source] Source indicator.\n * @param {Boolean} [keepEmptyRows] Flag for preventing deletion of empty rows.\n * @description\n *\n * Allows altering the table structure by either inserting/removing rows or inserting/removing columns:\n *\n * Insert new row(s) above the row with a given `index`. If index is `null` or `undefined`, the new row will be\n * added after the last row.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_row', 10);\n * ```\n *\n * Insert new column(s) before the column with a given `index`. If index is `null` or `undefined`, the new column\n * will be added after the last column.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_col', 10);\n * ```\n *\n * Remove the row(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_row', 10);\n * ```\n *\n * Remove the column(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_col', 10);\n * ```\n */\n this.alter = function (action, index, amount, source, keepEmptyRows) {\n grid.alter(action, index, amount, source, keepEmptyRows);\n };\n\n /**\n * Returns a TD element for the given `row` and `col` arguments, if it is rendered on screen.\n * Returns `null` if the TD is not rendered on screen (probably because that part of the table is not visible).\n *\n * @memberof Core#\n * @function getCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Boolean} topmost If set to true, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element from the `top` overlay.\n * @returns {Element} The cell's TD element.\n */\n this.getCell = function (row, col, topmost) {\n return instance.view.getCellAtCoords(new _src.CellCoords(row, col), topmost);\n };\n\n /**\n * Returns the coordinates of the cell, provided as a HTML Element.\n *\n * @memberof Core#\n * @function getCoords\n * @param {Element} elem The HTML Element representing the cell.\n * @returns {CellCoords} Coordinates object.\n */\n this.getCoords = function (elem) {\n return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem);\n };\n\n /**\n * Returns the property name that corresponds with the given column index. {@link DataMap#colToProp}\n * If the data source is an array of arrays, it returns the columns index.\n *\n * @memberof Core#\n * @function colToProp\n * @param {Number} col Column index\n * @returns {String|Number} Column property or column index.\n */\n this.colToProp = function (col) {\n return datamap.colToProp(col);\n };\n\n /**\n * Returns column index that corresponds with the given property. {@link DataMap#propToCol}\n *\n * @memberof Core#\n * @function propToCol\n * @param {String|Number} prop Property name or column index.\n * @returns {Number} Column index.\n */\n this.propToCol = function (prop) {\n return datamap.propToCol(prop);\n };\n\n /**\n * Translate physical row index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualRow\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n this.toVisualRow = function (row) {\n return recordTranslator.toVisualRow(row);\n };\n\n /**\n * Translate physical column index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualColumn\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n this.toVisualColumn = function (column) {\n return recordTranslator.toVisualColumn(column);\n };\n\n /**\n * Translate visual row index into physical.\n * If displayed rows order is different than the order of rows stored in memory (i.e. sorting is applied)\n * to retrieve valid physical row index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalRow\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n this.toPhysicalRow = function (row) {\n return recordTranslator.toPhysicalRow(row);\n };\n\n /**\n * Translate visual column index into physical.\n * If displayed columns order is different than the order of columns stored in memory (i.e. manual column move is applied)\n * to retrieve valid physical column index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalColumn\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n this.toPhysicalColumn = function (column) {\n return recordTranslator.toPhysicalColumn(column);\n };\n\n /**\n * @description\n * Returns the cell value at `row`, `col`. `row` and `col` are the __visible__ indexes (note, that if columns were reordered or sorted,\n * the currently visible order will be used).\n *\n * @memberof Core#\n * @function getDataAtCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {String|Boolean|null} Data at cell.\n */\n this.getDataAtCell = function (row, col) {\n return datamap.get(row, datamap.colToProp(col));\n };\n\n /**\n * Return value at `row`, `prop`. (Uses {@link DataMap#get})\n *\n * @memberof Core#\n * @function getDataAtRowProp\n * @param {Number} row Row index.\n * @param {String} prop Property name.\n * @returns {*} Cell value.\n */\n this.getDataAtRowProp = function (row, prop) {\n return datamap.get(row, prop);\n };\n\n /**\n * @description\n * Returns array of column values from the data source. `col` is the __visible__ index of the column.\n * Note, that if columns were reordered or sorted, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtCol\n * @since 0.9-beta2\n * @param {Number} col Column index.\n * @returns {Array} Array of cell values.\n */\n this.getDataAtCol = function (col) {\n var out = [];\n return out.concat.apply(out, _toConsumableArray(datamap.getRange(new _src.CellCoords(0, col), new _src.CellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER)));\n };\n\n /**\n * Given the object property name (e.g. `'first.name'`), returns an array of column's values from the data source.\n * You can also provide a column index as the first argument.\n *\n * @memberof Core#\n * @function getDataAtProp\n * @since 0.9-beta2\n * @param {String|Number} prop Property name / column index.\n * @returns {Array} Array of cell values.\n */\n this.getDataAtProp = function (prop) {\n var out = [],\n range;\n\n range = datamap.getRange(new _src.CellCoords(0, datamap.propToCol(prop)), new _src.CellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);\n\n return out.concat.apply(out, _toConsumableArray(range));\n };\n\n /**\n * Returns the source data object (the same that was passed by `data` configuration option or `loadData` method).\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceData\n * @since 0.20.0\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} Array of grid data.\n */\n this.getSourceData = function (r, c, r2, c2) {\n var data = void 0;\n\n if (r === void 0) {\n data = dataSource.getData();\n } else {\n data = dataSource.getByRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2));\n }\n\n return data;\n };\n\n /**\n * Returns the source data object as an arrays of arrays format even when source data was provided in another format.\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceDataArray\n * @since 0.28.0\n * @param {Number} [r] From row.\n * @param {Number} [c] From column.\n * @param {Number} [r2] To row.\n * @param {Number} [c2] To column.\n * @returns {Array} An array of arrays.\n */\n this.getSourceDataArray = function (r, c, r2, c2) {\n var data = void 0;\n\n if (r === void 0) {\n data = dataSource.getData(true);\n } else {\n data = dataSource.getByRange(new _src.CellCoords(r, c), new _src.CellCoords(r2, c2), true);\n }\n\n return data;\n };\n\n /**\n * Returns an array of column values from the data source. `col` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCol\n * @since 0.11.0-beta3\n * @param {Number} column Column index.\n * @returns {Array} Array of the column's cell values.\n */\n this.getSourceDataAtCol = function (column) {\n return dataSource.getAtColumn(column);\n };\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtRow\n * @since 0.11.0-beta3\n * @param {Number} row Row index.\n * @returns {Array|Object} Single row of data.\n */\n this.getSourceDataAtRow = function (row) {\n return dataSource.getAtRow(row);\n };\n\n /**\n * Returns a single value from the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCell\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {*} Cell data.\n * @since 0.20.0\n */\n this.getSourceDataAtCell = function (row, column) {\n return dataSource.getAtCell(row, column);\n };\n\n /**\n * @description\n * Returns a single row of the data. The `row` argument is the __visible__ index of the row.\n *\n * @memberof Core#\n * @function getDataAtRow\n * @param {Number} row Row index.\n * @returns {Array} Array of row's cell data.\n * @since 0.9-beta2\n */\n this.getDataAtRow = function (row) {\n var data = datamap.getRange(new _src.CellCoords(row, 0), new _src.CellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);\n\n return data[0] || [];\n };\n\n /**\n * @description\n * Returns a data type defined in the Handsontable settings under the `type` key ([Options#type](http://docs.handsontable.com/Options.html#type)).\n * If there are cells with different types in the selected range, it returns `'mixed'`.\n *\n * @since 0.18.1\n * @memberof Core#\n * @function getDataType\n * @param {Number} rowFrom From row index.\n * @param {Number} columnFrom To row index.\n * @param {Number} rowTo From column index.\n * @param {Number} columnTo To column index.\n * @returns {String} Cell type (e.q: `'mixed'`, `'text'`, `'numeric'`, `'autocomplete'`).\n */\n this.getDataType = function (rowFrom, columnFrom, rowTo, columnTo) {\n var _this = this;\n\n var previousType = null;\n var currentType = null;\n\n if (rowFrom === void 0) {\n rowFrom = 0;\n rowTo = this.countRows();\n columnFrom = 0;\n columnTo = this.countCols();\n }\n if (rowTo === void 0) {\n rowTo = rowFrom;\n }\n if (columnTo === void 0) {\n columnTo = columnFrom;\n }\n var type = 'mixed';\n\n (0, _number.rangeEach)(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), function (row) {\n var isTypeEqual = true;\n\n (0, _number.rangeEach)(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), function (column) {\n var cellType = _this.getCellMeta(row, column);\n\n currentType = cellType.type;\n\n if (previousType) {\n isTypeEqual = previousType === currentType;\n } else {\n previousType = currentType;\n }\n\n return isTypeEqual;\n });\n type = isTypeEqual ? currentType : 'mixed';\n\n return isTypeEqual;\n });\n\n return type;\n };\n\n /**\n * Remove a property defined by the `key` argument from the cell meta object for the provided `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function removeCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key Property name.\n */\n this.removeCellMeta = function (row, col, key) {\n var cellMeta = instance.getCellMeta(row, col);\n if (cellMeta[key] != undefined) {\n delete priv.cellSettings[row][col][key];\n }\n };\n\n /**\n * Remove one or more rows from the cell meta object.\n *\n * @since 0.30.0\n * @param {Number} index An integer that specifies at what position to add/remove items, Use negative values to specify the position from the end of the array.\n * @param {Number} deleteAmount The number of items to be removed. If set to 0, no items will be removed.\n * @param {Array} items The new items to be added to the array.\n */\n this.spliceCellsMeta = function (index, deleteAmount) {\n var _priv$cellSettings;\n\n for (var _len2 = arguments.length, items = Array(_len2 > 2 ? _len2 - 2 : 0), _key = 2; _key < _len2; _key++) {\n items[_key - 2] = arguments[_key];\n }\n\n (_priv$cellSettings = priv.cellSettings).splice.apply(_priv$cellSettings, [index, deleteAmount].concat(items));\n };\n\n /**\n * Set cell meta data object defined by `prop` to the corresponding params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMetaObject\n * @since 0.11\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} prop Meta object.\n */\n this.setCellMetaObject = function (row, col, prop) {\n if ((typeof prop === 'undefined' ? 'undefined' : _typeof(prop)) === 'object') {\n for (var key in prop) {\n if ((0, _object.hasOwnProperty)(prop, key)) {\n var value = prop[key];\n this.setCellMeta(row, col, key, value);\n }\n }\n }\n };\n\n /**\n * Sets a property defined by the `key` object to the meta object of a cell corresponding to params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMeta\n * @since 0.11\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} key Property name.\n * @param {String} val Property value.\n * @fires Hooks#afterSetCellMeta\n */\n this.setCellMeta = function (row, col, key, val) {\n var _recordTranslator$toP = recordTranslator.toPhysical(row, col);\n\n var _recordTranslator$toP2 = _slicedToArray(_recordTranslator$toP, 2);\n\n row = _recordTranslator$toP2[0];\n col = _recordTranslator$toP2[1];\n\n\n if (!priv.columnSettings[col]) {\n priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[row]) {\n priv.cellSettings[row] = [];\n }\n if (!priv.cellSettings[row][col]) {\n priv.cellSettings[row][col] = new priv.columnSettings[col]();\n }\n priv.cellSettings[row][col][key] = val;\n instance.runHooks('afterSetCellMeta', row, col, key, val);\n };\n\n /**\n * Get all the cells meta settings at least once generated in the table (in order of cell initialization).\n *\n * @since 0.19.0\n * @returns {Array} Returns Array of ColumnSettings object.\n */\n this.getCellsMeta = function () {\n return (0, _array.arrayFlatten)(priv.cellSettings);\n };\n\n /**\n * Returns the cell properties object for the given `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function getCellMeta\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} The cell properties object.\n * @fires Hooks#beforeGetCellMeta\n * @fires Hooks#afterGetCellMeta\n */\n this.getCellMeta = function (row, col) {\n var prop = datamap.colToProp(col),\n cellProperties;\n\n var visualRow = row;\n var visualCol = col;\n\n var _recordTranslator$toP3 = recordTranslator.toPhysical(row, col);\n\n var _recordTranslator$toP4 = _slicedToArray(_recordTranslator$toP3, 2);\n\n row = _recordTranslator$toP4[0];\n col = _recordTranslator$toP4[1];\n\n\n if (!priv.columnSettings[col]) {\n priv.columnSettings[col] = (0, _setting.columnFactory)(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[row]) {\n priv.cellSettings[row] = [];\n }\n if (!priv.cellSettings[row][col]) {\n priv.cellSettings[row][col] = new priv.columnSettings[col]();\n }\n\n cellProperties = priv.cellSettings[row][col]; // retrieve cellProperties from cache\n\n cellProperties.row = row;\n cellProperties.col = col;\n cellProperties.visualRow = visualRow;\n cellProperties.visualCol = visualCol;\n cellProperties.prop = prop;\n cellProperties.instance = instance;\n\n instance.runHooks('beforeGetCellMeta', row, col, cellProperties);\n (0, _object.extend)(cellProperties, expandType(cellProperties)); // for `type` added in beforeGetCellMeta\n\n if (cellProperties.cells) {\n var settings = cellProperties.cells.call(cellProperties, row, col, prop);\n\n if (settings) {\n (0, _object.extend)(cellProperties, settings);\n (0, _object.extend)(cellProperties, expandType(settings)); // for `type` added in cells\n }\n }\n\n instance.runHooks('afterGetCellMeta', row, col, cellProperties);\n\n return cellProperties;\n };\n\n /**\n * Returns a row off the cell meta array.\n *\n * @memberof Core#\n * @function getCellMetaAtRow\n * @since 0.30.0\n * @param {Number} row Index of the row to return cell meta for.\n * @returns {Array}\n */\n this.getCellMetaAtRow = function (row) {\n return priv.cellSettings[row];\n };\n\n /**\n * Checks if the data format and config allows user to modify the column structure.\n * @returns {boolean}\n */\n this.isColumnModificationAllowed = function () {\n return !(instance.dataType === 'object' || instance.getSettings().columns);\n };\n\n var rendererLookup = (0, _data.cellMethodLookupFactory)('renderer');\n\n /**\n * Returns the cell renderer function by given `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellRenderer\n * @since 0.11\n * @param {Number|Object} row Row index or cell meta object.\n * @param {Number} [col] Column index.\n * @returns {Function} The renderer function.\n */\n this.getCellRenderer = function (row, col) {\n return (0, _renderers.getRenderer)(rendererLookup.call(this, row, col));\n };\n\n /**\n * Returns the cell editor by the provided `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellEditor\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} The Editor object.\n */\n this.getCellEditor = (0, _data.cellMethodLookupFactory)('editor');\n\n var validatorLookup = (0, _data.cellMethodLookupFactory)('validator');\n\n /**\n * Returns the cell validator by `row` and `col`, provided a validator is defined. If not - it doesn't return anything.\n *\n * @memberof Core#\n * @function getCellValidator\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Function|RegExp|undefined} The validator function.\n */\n this.getCellValidator = function (row, col) {\n var validator = validatorLookup.call(this, row, col);\n\n if (typeof validator === 'string') {\n validator = (0, _validators.getValidator)(validator);\n }\n\n return validator;\n };\n\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * @memberof Core#\n * @function validateCells\n * @param {Function} [callback] The callback function.\n */\n this.validateCells = function (callback) {\n var waitingForValidator = new ValidatorsQueue();\n\n if (callback) {\n waitingForValidator.onQueueEmpty = callback;\n }\n\n var i = instance.countRows() - 1;\n\n while (i >= 0) {\n var j = instance.countCols() - 1;\n\n while (j >= 0) {\n waitingForValidator.addValidatorToQueue();\n\n instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false) {\n waitingForValidator.valid = false;\n }\n waitingForValidator.removeValidatorFormQueue();\n }, 'validateCells');\n j--;\n }\n i--;\n }\n waitingForValidator.checkIfQueueIsEmpty();\n };\n\n /**\n * Returns an array of row headers' values (if they are enabled). If param `row` was given, it returns the header of the given row as a string.\n *\n * @memberof Core#\n * @function getRowHeader\n * @param {Number} [row] Row index.\n * @fires Hooks#modifyRowHeader\n * @returns {Array|String} Array of header values / single header value.\n */\n this.getRowHeader = function (row) {\n var rowHeader = priv.settings.rowHeaders;\n\n if (row !== void 0) {\n row = instance.runHooks('modifyRowHeader', row);\n }\n if (row === void 0) {\n rowHeader = [];\n (0, _number.rangeEach)(instance.countRows() - 1, function (i) {\n rowHeader.push(instance.getRowHeader(i));\n });\n } else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) {\n rowHeader = rowHeader[row];\n } else if ((0, _function.isFunction)(rowHeader)) {\n rowHeader = rowHeader(row);\n } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') {\n rowHeader = row + 1;\n }\n\n return rowHeader;\n };\n\n /**\n * Returns information about if this table is configured to display row headers.\n *\n * @memberof Core#\n * @function hasRowHeaders\n * @returns {Boolean} `true` if the instance has the row headers enabled, `false` otherwise.\n * @since 0.11\n */\n this.hasRowHeaders = function () {\n return !!priv.settings.rowHeaders;\n };\n\n /**\n * Returns information about if this table is configured to display column headers.\n *\n * @memberof Core#\n * @function hasColHeaders\n * @since 0.11\n * @returns {Boolean} `True` if the instance has the column headers enabled, `false` otherwise.\n */\n this.hasColHeaders = function () {\n if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) {\n // Polymer has empty value = null\n return !!priv.settings.colHeaders;\n }\n for (var i = 0, ilen = instance.countCols(); i < ilen; i++) {\n if (instance.getColHeader(i)) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Returns an array of column headers (in string format, if they are enabled). If param `col` is given, it returns the header at the given column as a string.\n *\n * @memberof Core#\n * @function getColHeader\n * @param {Number} [col] Column index.\n * @fires Hooks#modifyColHeader\n * @returns {Array|String} The column header(s).\n */\n this.getColHeader = function (col) {\n var columnsAsFunc = priv.settings.columns && (0, _function.isFunction)(priv.settings.columns);\n var result = priv.settings.colHeaders;\n\n col = instance.runHooks('modifyColHeader', col);\n\n if (col === void 0) {\n var out = [];\n var ilen = columnsAsFunc ? instance.countSourceCols() : instance.countCols();\n\n for (var i = 0; i < ilen; i++) {\n out.push(instance.getColHeader(i));\n }\n\n result = out;\n } else {\n var translateVisualIndexToColumns = function translateVisualIndexToColumns(col) {\n var arr = [];\n var columnsLen = instance.countSourceCols();\n var index = 0;\n\n for (; index < columnsLen; index++) {\n if ((0, _function.isFunction)(instance.getSettings().columns) && instance.getSettings().columns(index)) {\n arr.push(index);\n }\n }\n\n return arr[col];\n };\n var baseCol = col;\n col = instance.runHooks('modifyCol', col);\n\n var prop = translateVisualIndexToColumns(col);\n\n if (priv.settings.columns && (0, _function.isFunction)(priv.settings.columns) && priv.settings.columns(prop) && priv.settings.columns(prop).title) {\n result = priv.settings.columns(prop).title;\n } else if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) {\n result = priv.settings.columns[col].title;\n } else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) {\n result = priv.settings.colHeaders[col];\n } else if ((0, _function.isFunction)(priv.settings.colHeaders)) {\n result = priv.settings.colHeaders(col);\n } else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') {\n result = (0, _data.spreadsheetColumnLabel)(baseCol); // see #1458\n }\n }\n\n return result;\n };\n\n /**\n * Return column width from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getColWidthFromSettings\n * @param {Number} col\n * @returns {Number}\n */\n this._getColWidthFromSettings = function (col) {\n var cellProperties = instance.getCellMeta(0, col);\n var width = cellProperties.width;\n\n if (width === void 0 || width === priv.settings.width) {\n width = cellProperties.colWidths;\n }\n if (width !== void 0 && width !== null) {\n switch (typeof width === 'undefined' ? 'undefined' : _typeof(width)) {\n case 'object':\n // array\n width = width[col];\n break;\n\n case 'function':\n width = width(col);\n break;\n default:\n break;\n }\n if (typeof width === 'string') {\n width = parseInt(width, 10);\n }\n }\n\n return width;\n };\n\n /**\n * Returns the width of the requested column.\n *\n * @memberof Core#\n * @function getColWidth\n * @since 0.11\n * @param {Number} col Column index.\n * @returns {Number} Column width.\n * @fires Hooks#modifyColWidth\n */\n this.getColWidth = function (col) {\n var width = instance._getColWidthFromSettings(col);\n\n width = instance.runHooks('modifyColWidth', width, col);\n\n if (width === void 0) {\n width = _src.ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n };\n\n /**\n * Return row height from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getRowHeightFromSettings\n * @param {Number} row\n * @returns {Number}\n */\n this._getRowHeightFromSettings = function (row) {\n // let cellProperties = instance.getCellMeta(row, 0);\n // let height = cellProperties.height;\n //\n // if (height === void 0 || height === priv.settings.height) {\n // height = cellProperties.rowHeights;\n // }\n var height = priv.settings.rowHeights;\n\n if (height !== void 0 && height !== null) {\n switch (typeof height === 'undefined' ? 'undefined' : _typeof(height)) {\n case 'object':\n // array\n height = height[row];\n break;\n\n case 'function':\n height = height(row);\n break;\n default:\n break;\n }\n if (typeof height === 'string') {\n height = parseInt(height, 10);\n }\n }\n\n return height;\n };\n\n /**\n * Returns the row height.\n *\n * @memberof Core#\n * @function getRowHeight\n * @since 0.11\n * @param {Number} row Row index.\n * @returns {Number} The given row's height.\n * @fires Hooks#modifyRowHeight\n */\n this.getRowHeight = function (row) {\n var height = instance._getRowHeightFromSettings(row);\n\n height = instance.runHooks('modifyRowHeight', height, row);\n\n return height;\n };\n\n /**\n * Returns the total number of rows in the data source.\n *\n * @memberof Core#\n * @function countSourceRows\n * @since 0.20.0\n * @returns {Number} Total number in rows in data source.\n */\n this.countSourceRows = function () {\n var sourceLength = instance.runHooks('modifySourceLength');\n return sourceLength || (instance.getSourceData() ? instance.getSourceData().length : 0);\n };\n\n /**\n * Returns the total number of columns in the data source.\n *\n * @memberof Core#\n * @function countSourceCols\n * @since 0.26.1\n * @returns {Number} Total number in columns in data source.\n */\n this.countSourceCols = function () {\n var len = 0;\n var obj = instance.getSourceData() && instance.getSourceData()[0] ? instance.getSourceData()[0] : [];\n\n if ((0, _object.isObject)(obj)) {\n len = (0, _object.deepObjectSize)(obj);\n } else {\n len = obj.length || 0;\n }\n\n return len;\n };\n\n /**\n * Returns the total number of rows in the grid.\n *\n * @memberof Core#\n * @function countRows\n * @returns {Number} Total number in rows the grid.\n */\n this.countRows = function () {\n return datamap.getLength();\n };\n\n /**\n * Returns the total number of columns in the grid.\n *\n * @memberof Core#\n * @function countCols\n * @returns {Number} Total number of columns.\n */\n this.countCols = function () {\n var maxCols = this.getSettings().maxCols;\n var dataHasLength = false;\n var dataLen = 0;\n\n if (instance.dataType === 'array') {\n dataHasLength = priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length;\n }\n\n if (dataHasLength) {\n dataLen = priv.settings.data[0].length;\n }\n\n if (priv.settings.columns) {\n var columnsIsFunction = (0, _function.isFunction)(priv.settings.columns);\n\n if (columnsIsFunction) {\n if (instance.dataType === 'array') {\n var columnLen = 0;\n\n for (var i = 0; i < dataLen; i++) {\n if (priv.settings.columns(i)) {\n columnLen++;\n }\n }\n\n dataLen = columnLen;\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n } else {\n dataLen = priv.settings.columns.length;\n }\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n\n return Math.min(maxCols, dataLen);\n };\n\n /**\n * Returns an index of the first rendered row.\n *\n * @memberof Core#\n * @function rowOffset\n * @returns {Number} Index of first rendered row.\n */\n this.rowOffset = function () {\n return instance.view.wt.wtTable.getFirstRenderedRow();\n };\n\n /**\n * Returns the index of the first rendered column.\n *\n * @memberof Core#\n * @function colOffset\n * @returns {Number} Index of the first visible column.\n */\n this.colOffset = function () {\n return instance.view.wt.wtTable.getFirstRenderedColumn();\n };\n\n /**\n * Returns the number of rendered rows (including rows partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedRows\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1;\n };\n\n /**\n * Returns the number of visible rows (rendered rows that fully fit inside viewport).\n *\n * @memberof Core#\n * @function countVisibleRows\n * @returns {Number} Number of visible rows or -1.\n */\n this.countVisibleRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1;\n };\n\n /**\n * Returns the number of rendered columns (including columns partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedCols\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1;\n };\n\n /**\n * Returns the number of visible columns. Returns -1 if table is not visible\n *\n * @memberof Core#\n * @function countVisibleCols\n * @return {Number} Number of visible columns or -1.\n */\n this.countVisibleCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1;\n };\n\n /**\n * Returns the number of empty rows. If the optional ending parameter is `true`, returns the\n * number of empty rows at the bottom of the table.\n *\n * @memberof Core#\n * @function countEmptyRows\n * @param {Boolean} [ending] If `true`, will only count empty rows at the end of the data source.\n * @returns {Number} Count empty rows\n * @fires Hooks#modifyRow\n */\n this.countEmptyRows = function (ending) {\n var i = instance.countRows() - 1,\n empty = 0,\n row;\n\n while (i >= 0) {\n row = instance.runHooks('modifyRow', i);\n\n if (instance.isEmptyRow(row)) {\n empty++;\n } else if (ending) {\n break;\n }\n i--;\n }\n\n return empty;\n };\n\n /**\n * Returns the number of empty columns. If the optional ending parameter is `true`, returns the number of empty\n * columns at right hand edge of the table.\n *\n * @memberof Core#\n * @function countEmptyCols\n * @param {Boolean} [ending] If `true`, will only count empty columns at the end of the data source row.\n * @returns {Number} Count empty cols\n */\n this.countEmptyCols = function (ending) {\n if (instance.countRows() < 1) {\n return 0;\n }\n var i = instance.countCols() - 1,\n empty = 0;\n\n while (i >= 0) {\n if (instance.isEmptyCol(i)) {\n empty++;\n } else if (ending) {\n break;\n }\n i--;\n }\n\n return empty;\n };\n\n /**\n * Check if all cells in the row declared by the `row` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyRow\n * @param {Number} row Row index.\n * @returns {Boolean} `true` if the row at the given `row` is empty, `false` otherwise.\n */\n this.isEmptyRow = function (row) {\n return priv.settings.isEmptyRow.call(instance, row);\n };\n\n /**\n * Check if all cells in the the column declared by the `col` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyCol\n * @param {Number} col Column index.\n * @returns {Boolean} `true` if the column at the given `col` is empty, `false` otherwise.\n */\n this.isEmptyCol = function (col) {\n return priv.settings.isEmptyCol.call(instance, col);\n };\n\n /**\n * Select cell specified by `row` and `col` values or a range of cells finishing at `endRow`, `endCol`.\n * By default, viewport will be scrolled to selection.\n * After the `selectCell` method had finished, the instance will be listening to keyboard input on the document.\n *\n * @memberof Core#\n * @function selectCell\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Number} [endRow] End row index (if selecting a range).\n * @param {Number} [endCol] End column index (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {Boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCell = function (row, col, endRow, endCol, scrollToCell, changeListener) {\n var coords;\n\n changeListener = (0, _mixed.isUndefined)(changeListener) || changeListener === true;\n\n if (typeof row !== 'number' || row < 0 || row >= instance.countRows()) {\n return false;\n }\n if (typeof col !== 'number' || col < 0 || col >= instance.countCols()) {\n return false;\n }\n if ((0, _mixed.isDefined)(endRow)) {\n if (typeof endRow !== 'number' || endRow < 0 || endRow >= instance.countRows()) {\n return false;\n }\n if (typeof endCol !== 'number' || endCol < 0 || endCol >= instance.countCols()) {\n return false;\n }\n }\n coords = new _src.CellCoords(row, col);\n priv.selRange = new _src.CellRange(coords, coords, coords);\n\n if (changeListener) {\n instance.listen();\n }\n\n if ((0, _mixed.isUndefined)(endRow)) {\n selection.setRangeEnd(priv.selRange.from, scrollToCell);\n } else {\n selection.setRangeEnd(new _src.CellCoords(endRow, endCol), scrollToCell);\n }\n instance.selection.finish();\n\n return true;\n };\n\n /**\n * Select the cell specified by the `row` and `prop` arguments, or a range finishing at `endRow`, `endProp`.\n * By default, viewport will be scrolled to selection.\n *\n * @memberof Core#\n * @function selectCellByProp\n * @param {Number} row Row index.\n * @param {String} prop Property name.\n * @param {Number} [endRow] End row index (if selecting a range).\n * @param {String} [endProp] End property name (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, viewport will be scrolled to the selection.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCellByProp = function (row, prop, endRow, endProp, scrollToCell) {\n var _instance5;\n\n arguments[1] = datamap.propToCol(arguments[1]);\n\n if ((0, _mixed.isDefined)(arguments[3])) {\n arguments[3] = datamap.propToCol(arguments[3]);\n }\n\n return (_instance5 = instance).selectCell.apply(_instance5, arguments);\n };\n\n /**\n * Deselects the current cell selection on grid.\n *\n * @memberof Core#\n * @function deselectCell\n */\n this.deselectCell = function () {\n selection.deselect();\n };\n\n /**\n * Scroll viewport to coords specified by the `row` and `column` arguments.\n *\n * @since 0.24.3\n * @memberof Core#\n * @function scrollViewportTo\n * @param {Number} [row] Row index.\n * @param {Number} [column] Column index.\n * @param {Boolean} [snapToBottom = false] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {Boolean} [snapToRight = false] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @returns {Boolean} `true` if scroll was successful, `false` otherwise.\n */\n this.scrollViewportTo = function (row, column) {\n var snapToBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var snapToRight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (row !== void 0 && (row < 0 || row >= instance.countRows())) {\n return false;\n }\n if (column !== void 0 && (column < 0 || column >= instance.countCols())) {\n return false;\n }\n\n var result = false;\n\n if (row !== void 0 && column !== void 0) {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n if (typeof row === 'number' && typeof column !== 'number') {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n\n result = true;\n }\n if (typeof column === 'number' && typeof row !== 'number') {\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n\n return result;\n };\n\n /**\n * Removes grid from the DOM.\n *\n * @memberof Core#\n * @function destroy\n * @fires Hooks#afterDestroy\n */\n this.destroy = function () {\n\n instance._clearTimeouts();\n if (instance.view) {\n // in case HT is destroyed before initialization has finished\n instance.view.destroy();\n }\n if (dataSource) {\n dataSource.destroy();\n }\n dataSource = null;\n\n (0, _element.empty)(instance.rootElement);\n eventManager.destroy();\n\n instance.runHooks('afterDestroy');\n _pluginHooks2.default.getSingleton().destroy(instance);\n\n for (var i in instance) {\n if ((0, _object.hasOwnProperty)(instance, i)) {\n // replace instance methods with post mortem\n if ((0, _function.isFunction)(instance[i])) {\n instance[i] = postMortem;\n } else if (i !== 'guid') {\n // replace instance properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n instance[i] = null;\n }\n }\n }\n\n // replace private properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n if (datamap) {\n datamap.destroy();\n }\n datamap = null;\n priv = null;\n grid = null;\n selection = null;\n editorManager = null;\n instance = null;\n GridSettings = null;\n };\n\n /**\n * Replacement for all methods after Handsotnable was destroyed.\n *\n * @private\n */\n function postMortem() {\n throw new Error('This method cannot be called because this Handsontable instance has been destroyed');\n }\n\n /**\n * Returns the active editor object.\n *\n * @memberof Core#\n * @function getActiveEditor\n * @returns {Object} The active editor object.\n */\n this.getActiveEditor = function () {\n return editorManager.getActiveEditor();\n };\n\n /**\n * Returns plugin instance using the plugin name provided.\n *\n * @memberof Core#\n * @function getPlugin\n * @param {String} pluginName The plugin name.\n * @returns {*} The plugin instance.\n * @since 0.15.0\n */\n this.getPlugin = function (pluginName) {\n return (0, _plugins.getPlugin)(this, pluginName);\n };\n\n /**\n * Returns the Handsontable instance.\n *\n * @memberof Core#\n * @function getInstance\n * @returns {Handsontable} The Handsontable instance.\n */\n this.getInstance = function () {\n return instance;\n };\n\n /**\n * Adds listener to the specified hook name (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function addHook\n * @see Hooks#add\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHook('beforeInit', myCallback);\n * ```\n */\n this.addHook = function (key, callback) {\n _pluginHooks2.default.getSingleton().add(key, callback, instance);\n };\n\n /**\n * Check if for a specified hook name there are added listeners (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function hasHook\n * @see Hooks#has\n * @param {String} key Hook name\n * @return {Boolean}\n *\n * @example\n * ```js\n * var hasBeforeInitListeners = hot.hasHook('beforeInit');\n * ```\n */\n this.hasHook = function (key) {\n return _pluginHooks2.default.getSingleton().has(key, instance);\n };\n\n /**\n * Adds listener to specified hook name (only for this Handsontable instance).\n * After the listener is triggered, it will be automatically removed.\n *\n * @memberof Core#\n * @function addHookOnce\n * @see Hooks#once\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHookOnce('beforeInit', myCallback);\n * ```\n */\n this.addHookOnce = function (key, callback) {\n _pluginHooks2.default.getSingleton().once(key, callback, instance);\n };\n\n /**\n * Removes the hook listener previously registered with {@link Core#addHook}.\n *\n * @memberof Core#\n * @function removeHook\n * @see Hooks#remove\n * @param {String} key Hook name.\n * @param {Function} callback Function which have been registered via {@link Core#addHook}.\n *\n * @example\n * ```js\n * hot.removeHook('beforeInit', myCallback);\n * ```\n */\n this.removeHook = function (key, callback) {\n _pluginHooks2.default.getSingleton().remove(key, callback, instance);\n };\n\n /**\n * Run the callbacks for the hook provided in the `key` argument using the parameters given in the other arguments.\n *\n * @memberof Core#\n * @function runHooks\n * @see Hooks#run\n * @param {String} key Hook name.\n * @param {*} [p1] Argument passed to the callback.\n * @param {*} [p2] Argument passed to the callback.\n * @param {*} [p3] Argument passed to the callback.\n * @param {*} [p4] Argument passed to the callback.\n * @param {*} [p5] Argument passed to the callback.\n * @param {*} [p6] Argument passed to the callback.\n * @returns {*}\n *\n * @example\n * ```js\n * hot.runHooks('beforeInit');\n * ```\n */\n this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {\n return _pluginHooks2.default.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);\n };\n\n this.timeouts = [];\n\n /**\n * Sets timeout. Purpose of this method is to clear all known timeouts when `destroy` method is called.\n *\n * @param {*} handle\n * @private\n */\n this._registerTimeout = function (handle) {\n this.timeouts.push(handle);\n };\n\n /**\n * Clears all known timeouts.\n *\n * @private\n */\n this._clearTimeouts = function () {\n for (var i = 0, ilen = this.timeouts.length; i < ilen; i++) {\n clearTimeout(this.timeouts[i]);\n }\n };\n\n /**\n * Handsontable version\n *\n * @type {String}\n */\n // this.version = Handsontable.version;\n\n _pluginHooks2.default.getSingleton().run(instance, 'construct');\n};\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.spreadsheetColumnLabel = spreadsheetColumnLabel;\nexports.spreadsheetColumnIndex = spreadsheetColumnIndex;\nexports.createSpreadsheetData = createSpreadsheetData;\nexports.createSpreadsheetObjectData = createSpreadsheetObjectData;\nexports.createEmptySpreadsheetData = createEmptySpreadsheetData;\nexports.translateRowsToColumns = translateRowsToColumns;\nexports.cellMethodLookupFactory = cellMethodLookupFactory;\n\nvar _cellTypes = __webpack_require__(63);\n\nvar _object = __webpack_require__(2);\n\nvar COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nvar COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc.\n *\n * @param {Number} index Column index.\n * @returns {String}\n */\nfunction spreadsheetColumnLabel(index) {\n var dividend = index + 1;\n var columnLabel = '';\n var modulo = void 0;\n\n while (dividend > 0) {\n modulo = (dividend - 1) % COLUMN_LABEL_BASE_LENGTH;\n columnLabel = String.fromCharCode(65 + modulo) + columnLabel;\n dividend = parseInt((dividend - modulo) / COLUMN_LABEL_BASE_LENGTH, 10);\n }\n\n return columnLabel;\n}\n\n/**\n * Generates spreadsheet-like column index from theirs labels: A, B, C ...., Z, AA, AB, etc.\n *\n * @param {String} label Column label.\n * @returns {Number}\n */\nfunction spreadsheetColumnIndex(label) {\n var result = 0;\n\n if (label) {\n for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n --result;\n\n return result;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", ...\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate.\n * @returns {Array}\n */\nfunction createSpreadsheetData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = [];\n\n for (j = 0; j < columns; j++) {\n row.push(spreadsheetColumnLabel(j) + (i + 1));\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", as an array of objects.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} colCount Number of columns to generate.\n * @returns {Array}\n */\nfunction createSpreadsheetObjectData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var colCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = {};\n\n for (j = 0; j < colCount; j++) {\n row['prop' + j] = spreadsheetColumnLabel(j) + (i + 1);\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Generates an empty data object.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate\n * @returns {Array}\n */\nfunction createEmptySpreadsheetData(rows, columns) {\n var data = [];\n var row = void 0;\n\n for (var i = 0; i < rows; i++) {\n row = [];\n for (var j = 0; j < columns; j++) {\n row.push('');\n }\n data.push(row);\n }\n\n return data;\n}\n\nfunction translateRowsToColumns(input) {\n var i,\n ilen,\n j,\n jlen,\n output = [],\n olen = 0;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n for (j = 0, jlen = input[i].length; j < jlen; j++) {\n if (j == olen) {\n output.push([]);\n olen++;\n }\n output[j].push(input[i][j]);\n }\n }\n\n return output;\n}\n\n/**\n * Factory that produces a function for searching methods (or any properties) which could be defined directly in\n * table configuration or implicitly, within cell type definition.\n *\n * For example: renderer can be defined explicitly using \"renderer\" property in column configuration or it can be\n * defined implicitly using \"type\" property.\n *\n * Methods/properties defined explicitly always takes precedence over those defined through \"type\".\n *\n * If the method/property is not found in an object, searching is continued recursively through prototype chain, until\n * it reaches the Object.prototype.\n *\n *\n * @param methodName {String} name of the method/property to search (i.e. 'renderer', 'validator', 'copyable')\n * @param allowUndefined {Boolean} [optional] if false, the search is continued if methodName has not been found in cell \"type\"\n * @returns {Function}\n */\nfunction cellMethodLookupFactory(methodName, allowUndefined) {\n\n allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined;\n\n return function cellMethodLookup(row, col) {\n return function getMethodFromProperties(properties) {\n\n if (!properties) {\n return; // method not found\n } else if ((0, _object.hasOwnProperty)(properties, methodName) && properties[methodName] !== void 0) {\n // check if it is own and is not empty\n return properties[methodName]; // method defined directly\n } else if ((0, _object.hasOwnProperty)(properties, 'type') && properties.type) {\n // check if it is own and is not empty\n var type;\n\n if (typeof properties.type != 'string') {\n throw new Error('Cell type must be a string ');\n }\n type = (0, _cellTypes.getCellType)(properties.type);\n\n if ((0, _object.hasOwnProperty)(type, methodName)) {\n return type[methodName]; // method defined in type.\n } else if (allowUndefined) {\n return; // method does not defined in type (eg. validator), returns undefined\n }\n }\n\n return getMethodFromProperties(Object.getPrototypeOf(properties));\n }(typeof row == 'number' ? this.getCellMeta(row, col) : row);\n };\n}\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.columnFactory = columnFactory;\n\nvar _object = __webpack_require__(2);\n\n/* eslint-disable import/prefer-default-export */\n/**\n * Factory for columns constructors.\n *\n * @param {Object} GridSettings\n * @param {Array} conflictList\n * @return {Object} ColumnSettings\n */\nfunction columnFactory(GridSettings, conflictList) {\n function ColumnSettings() {};\n\n (0, _object.inherit)(ColumnSettings, GridSettings);\n\n // Clear conflict settings\n for (var i = 0, len = conflictList.length; i < len; i++) {\n ColumnSettings.prototype[conflictList[i]] = void 0;\n }\n\n return ColumnSettings;\n}\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class GhostTable\n * @util\n */\nvar GhostTable = function () {\n function GhostTable(hotInstance) {\n _classCallCheck(this, GhostTable);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * Container element where every table will be injected.\n *\n * @type {HTMLElement|null}\n */\n this.container = null;\n /**\n * Flag which determine is table was injected to DOM.\n *\n * @type {Boolean}\n */\n this.injected = false;\n /**\n * Added rows collection.\n *\n * @type {Array}\n */\n this.rows = [];\n /**\n * Added columns collection.\n *\n * @type {Array}\n */\n this.columns = [];\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Ghost table settings.\n *\n * @type {Object}\n * @default {Object}\n */\n this.settings = {\n useHeaders: true\n };\n }\n\n /**\n * Add row.\n *\n * @param {Number} row Row index.\n * @param {Map} samples Samples Map object.\n */\n\n\n _createClass(GhostTable, [{\n key: 'addRow',\n value: function addRow(row, samples) {\n if (this.columns.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.rows.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n var rowObject = { row: row };\n this.rows.push(rowObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tr.appendChild(this.createRow(row));\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n\n /**\n * Add a row consisting of the column headers.\n */\n\n }, {\n key: 'addColumnHeadersRow',\n value: function addColumnHeadersRow(samples) {\n if (this.hot.getColHeader(0) != null) {\n var rowObject = { row: -1 };\n this.rows.push(rowObject);\n\n this.container = this.createContainer(this.hot.rootElement.className);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tHead.appendChild(this.createColumnHeadersRow());\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n }\n\n /**\n * Add column.\n *\n * @param {Number} column Column index.\n * @param {Map} samples Samples Map object.\n */\n\n }, {\n key: 'addColumn',\n value: function addColumn(column, samples) {\n if (this.rows.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.columns.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n var columnObject = { col: column };\n this.columns.push(columnObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n\n if (this.getSetting('useHeaders') && this.hot.getColHeader(column) !== null) {\n this.hot.view.appendColHeader(column, this.table.th);\n }\n this.table.tBody.appendChild(this.createCol(column));\n this.container.container.appendChild(this.table.fragment);\n\n columnObject.table = this.table.table;\n }\n\n /**\n * Get calculated heights.\n *\n * @param {Function} callback Callback which will be fired for each calculated row.\n */\n\n }, {\n key: 'getHeights',\n value: function getHeights(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n (0, _array.arrayEach)(this.rows, function (row) {\n // -1 <- reduce border-top from table\n callback(row.row, (0, _element.outerHeight)(row.table) - 1);\n });\n }\n\n /**\n * Get calculated widths.\n *\n * @param {Function} callback Callback which will be fired for each calculated column.\n */\n\n }, {\n key: 'getWidths',\n value: function getWidths(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n (0, _array.arrayEach)(this.columns, function (column) {\n callback(column.col, (0, _element.outerWidth)(column.table));\n });\n }\n\n /**\n * Set the Ghost Table settings to the provided object.\n *\n * @param {Object} settings New Ghost Table Settings\n */\n\n }, {\n key: 'setSettings',\n value: function setSettings(settings) {\n this.settings = settings;\n }\n\n /**\n * Set a single setting of the Ghost Table.\n *\n * @param {String} name Setting name.\n * @param {*} value Setting value.\n */\n\n }, {\n key: 'setSetting',\n value: function setSetting(name, value) {\n if (!this.settings) {\n this.settings = {};\n }\n\n this.settings[name] = value;\n }\n\n /**\n * Get the Ghost Table settings.\n *\n * @returns {Object|null}\n */\n\n }, {\n key: 'getSettings',\n value: function getSettings() {\n return this.settings;\n }\n\n /**\n * Get a single Ghost Table setting.\n *\n * @param {String} name\n * @returns {Boolean|null}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(name) {\n if (this.settings) {\n return this.settings[name];\n }\n return null;\n }\n\n /**\n * Create colgroup col elements.\n *\n * @returns {DocumentFragment}\n */\n\n }, {\n key: 'createColGroupsCol',\n value: function createColGroupsCol() {\n var _this = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n fragment.appendChild(this.createColElement(-1));\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n fragment.appendChild(_this.createColElement(string.col));\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table row element.\n *\n * @param {Number} row Row index.\n * @returns {DocumentFragment} Returns created table row elements.\n */\n\n }, {\n key: 'createRow',\n value: function createRow(row) {\n var _this2 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var th = d.createElement('th');\n\n if (this.hot.hasRowHeaders()) {\n this.hot.view.appendRowHeader(row, th);\n\n fragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var column = string.col;\n var cellProperties = _this2.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this2.hot.getCellRenderer(cellProperties);\n var td = d.createElement('td');\n\n renderer(_this2.hot, td, row, column, _this2.hot.colToProp(column), string.value, cellProperties);\n fragment.appendChild(td);\n });\n });\n\n return fragment;\n }\n }, {\n key: 'createColumnHeadersRow',\n value: function createColumnHeadersRow() {\n var _this3 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n var th = d.createElement('th');\n this.hot.view.appendColHeader(-1, th);\n fragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var column = string.col;\n\n var th = d.createElement('th');\n\n _this3.hot.view.appendColHeader(column, th);\n fragment.appendChild(th);\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table column elements.\n *\n * @param {Number} column Column index.\n * @returns {DocumentFragment} Returns created column table column elements.\n */\n\n }, {\n key: 'createCol',\n value: function createCol(column) {\n var _this4 = this;\n\n var d = document;\n var fragment = d.createDocumentFragment();\n\n this.samples.forEach(function (sample) {\n (0, _array.arrayEach)(sample.strings, function (string) {\n var row = string.row;\n var cellProperties = _this4.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this4.hot.getCellRenderer(cellProperties);\n var td = d.createElement('td');\n var tr = d.createElement('tr');\n\n renderer(_this4.hot, td, row, column, _this4.hot.colToProp(column), string.value, cellProperties);\n tr.appendChild(td);\n fragment.appendChild(tr);\n });\n });\n\n return fragment;\n }\n\n /**\n * Remove table from document and reset internal state.\n */\n\n }, {\n key: 'clean',\n value: function clean() {\n this.rows.length = 0;\n this.rows[-1] = void 0;\n this.columns.length = 0;\n\n if (this.samples) {\n this.samples.clear();\n }\n this.samples = null;\n this.removeTable();\n }\n\n /**\n * Inject generated table into document.\n *\n * @param {HTMLElement} [parent=null]\n */\n\n }, {\n key: 'injectTable',\n value: function injectTable() {\n var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (!this.injected) {\n (parent || this.hot.rootElement).appendChild(this.container.fragment);\n this.injected = true;\n }\n }\n\n /**\n * Remove table from document.\n */\n\n }, {\n key: 'removeTable',\n value: function removeTable() {\n if (this.injected && this.container.container.parentNode) {\n this.container.container.parentNode.removeChild(this.container.container);\n this.container = null;\n this.injected = false;\n }\n }\n\n /**\n * Create col element.\n *\n * @param {Number} column Column index.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createColElement',\n value: function createColElement(column) {\n var d = document;\n var col = d.createElement('col');\n\n col.style.width = this.hot.view.wt.wtTable.getStretchedColumnWidth(column) + 'px';\n\n return col;\n }\n\n /**\n * Create table element.\n *\n * @param {String} className\n * @returns {Object}\n */\n\n }, {\n key: 'createTable',\n value: function createTable() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var table = d.createElement('table');\n var tHead = d.createElement('thead');\n var tBody = d.createElement('tbody');\n var colGroup = d.createElement('colgroup');\n var tr = d.createElement('tr');\n var th = d.createElement('th');\n\n if (this.isVertical()) {\n table.appendChild(colGroup);\n }\n if (this.isHorizontal()) {\n tr.appendChild(th);\n tHead.appendChild(tr);\n table.style.tableLayout = 'auto';\n table.style.width = 'auto';\n }\n table.appendChild(tHead);\n\n if (this.isVertical()) {\n tBody.appendChild(tr);\n }\n table.appendChild(tBody);\n (0, _element.addClass)(table, className);\n fragment.appendChild(table);\n\n return { fragment: fragment, table: table, tHead: tHead, tBody: tBody, colGroup: colGroup, tr: tr, th: th };\n }\n\n /**\n * Create container for tables.\n *\n * @param {String} className\n * @returns {Object}\n */\n\n }, {\n key: 'createContainer',\n value: function createContainer() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var d = document;\n var fragment = d.createDocumentFragment();\n var container = d.createElement('div');\n\n className = 'htGhostTable htAutoSize ' + className.trim();\n (0, _element.addClass)(container, className);\n fragment.appendChild(container);\n\n return { fragment: fragment, container: container };\n }\n\n /**\n * Checks if table is raised vertically (checking rows).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isVertical',\n value: function isVertical() {\n return !!(this.rows.length && !this.columns.length);\n }\n\n /**\n * Checks if table is raised horizontally (checking columns).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isHorizontal',\n value: function isHorizontal() {\n return !!(this.columns.length && !this.rows.length);\n }\n }]);\n\n return GhostTable;\n}();\n\nexports.default = GhostTable;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar addToUnscopables = __webpack_require__(37)\n , step = __webpack_require__(167)\n , Iterators = __webpack_require__(45)\n , toIObject = __webpack_require__(23);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(166)(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A cell range is a set of exactly two CellCoords (that can be the same or different)\n *\n * @class CellRange\n */\nvar CellRange = function () {\n /**\n * @param {CellCoords} highlight Used to draw bold border around a cell where selection was\n * started and to edit the cell when you press Enter\n * @param {CellCoords} from Usually the same as highlight, but in Excel there is distinction - one can change\n * highlight within a selection\n * @param {CellCoords} to End selection\n */\n function CellRange(highlight, from, to) {\n _classCallCheck(this, CellRange);\n\n this.highlight = highlight;\n this.from = from;\n this.to = to;\n }\n\n /**\n * Checks if given coords are valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n\n\n _createClass(CellRange, [{\n key: 'isValid',\n value: function isValid(wotInstance) {\n return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);\n }\n\n /**\n * Checks if this cell range is restricted to one cell\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSingle',\n value: function isSingle() {\n return this.from.row === this.to.row && this.from.col === this.to.col;\n }\n\n /**\n * Returns selected range height (in number of rows)\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getHeight',\n value: function getHeight() {\n return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;\n }\n\n /**\n * Returns selected range width (in number of columns)\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getWidth',\n value: function getWidth() {\n return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;\n }\n\n /**\n * Checks if given cell coords is within `from` and `to` cell coords of this range\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'includes',\n value: function includes(cellCoords) {\n var row = cellCoords.row,\n col = cellCoords.col;\n\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n return topLeft.row <= row && bottomRight.row >= row && topLeft.col <= col && bottomRight.col >= col;\n }\n\n /**\n * Checks if given range is within of this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'includesRange',\n value: function includesRange(testedRange) {\n return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());\n }\n\n /**\n * Checks if given range is equal to this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEqual',\n value: function isEqual(testedRange) {\n return Math.min(this.from.row, this.to.row) == Math.min(testedRange.from.row, testedRange.to.row) && Math.max(this.from.row, this.to.row) == Math.max(testedRange.from.row, testedRange.to.row) && Math.min(this.from.col, this.to.col) == Math.min(testedRange.from.col, testedRange.to.col) && Math.max(this.from.col, this.to.col) == Math.max(testedRange.from.col, testedRange.to.col);\n }\n\n /**\n * Checks if tested range overlaps with the range.\n * Range A is considered to to be overlapping with range B if intersection of A and B or B and A is not empty.\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'overlaps',\n value: function overlaps(testedRange) {\n return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSouthEastOf',\n value: function isSouthEastOf(testedCoords) {\n return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNorthWestOf',\n value: function isNorthWestOf(testedCoords) {\n return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);\n }\n\n /**\n * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'expand',\n value: function expand(cellCoords) {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {\n this.from = new _coords2.default(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));\n this.to = new _coords2.default(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));\n\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {CellRange} expandingRange\n * @returns {Boolean}\n */\n\n }, {\n key: 'expandByRange',\n value: function expandByRange(expandingRange) {\n if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {\n return false;\n }\n\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var topRight = this.getTopRightCorner();\n var bottomLeft = this.getBottomLeftCorner();\n\n var expandingTopLeft = expandingRange.getTopLeftCorner();\n var expandingBottomRight = expandingRange.getBottomRightCorner();\n\n var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);\n var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);\n var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);\n var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);\n\n var finalFrom = new _coords2.default(resultTopRow, resultTopCol),\n finalTo = new _coords2.default(resultBottomRow, resultBottomCol);\n var isCorner = new CellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange),\n onlyMerge = expandingRange.isEqual(new CellRange(finalFrom, finalFrom, finalTo));\n\n if (isCorner && !onlyMerge) {\n if (this.from.col > finalFrom.col) {\n finalFrom.col = resultBottomCol;\n finalTo.col = resultTopCol;\n }\n if (this.from.row > finalFrom.row) {\n finalFrom.row = resultBottomRow;\n finalTo.row = resultTopRow;\n }\n }\n this.from = finalFrom;\n this.to = finalTo;\n\n return true;\n }\n\n /**\n * @returns {String}\n */\n\n }, {\n key: 'getDirection',\n value: function getDirection() {\n if (this.from.isNorthWestOf(this.to)) {\n // NorthWest - SouthEast\n return 'NW-SE';\n } else if (this.from.isNorthEastOf(this.to)) {\n // NorthEast - SouthWest\n return 'NE-SW';\n } else if (this.from.isSouthEastOf(this.to)) {\n // SouthEast - NorthWest\n return 'SE-NW';\n } else if (this.from.isSouthWestOf(this.to)) {\n // SouthWest - NorthEast\n return 'SW-NE';\n }\n }\n\n /**\n * @param {String} direction\n */\n\n }, {\n key: 'setDirection',\n value: function setDirection(direction) {\n switch (direction) {\n case 'NW-SE':\n var _ref = [this.getTopLeftCorner(), this.getBottomRightCorner()];\n this.from = _ref[0];\n this.to = _ref[1];\n\n break;\n case 'NE-SW':\n var _ref2 = [this.getTopRightCorner(), this.getBottomLeftCorner()];\n this.from = _ref2[0];\n this.to = _ref2[1];\n\n break;\n case 'SE-NW':\n var _ref3 = [this.getBottomRightCorner(), this.getTopLeftCorner()];\n this.from = _ref3[0];\n this.to = _ref3[1];\n\n break;\n case 'SW-NE':\n var _ref4 = [this.getBottomLeftCorner(), this.getTopRightCorner()];\n this.from = _ref4[0];\n this.to = _ref4[1];\n\n break;\n default:\n break;\n }\n }\n\n /**\n * Get top left corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getTopLeftCorner',\n value: function getTopLeftCorner() {\n return new _coords2.default(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom right corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getBottomRightCorner',\n value: function getBottomRightCorner() {\n return new _coords2.default(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get top right corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getTopRightCorner',\n value: function getTopRightCorner() {\n return new _coords2.default(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom left corner of this range\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getBottomLeftCorner',\n value: function getBottomLeftCorner() {\n return new _coords2.default(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {*}\n */\n\n }, {\n key: 'isCorner',\n value: function isCorner(coords, expandedRange) {\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {\n return true;\n }\n }\n }\n\n return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {CellCoords}\n */\n\n }, {\n key: 'getOppositeCorner',\n value: function getOppositeCorner(coords, expandedRange) {\n if (!(coords instanceof _coords2.default)) {\n return false;\n }\n\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col))) {\n return this.getBottomRightCorner();\n }\n if (this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col))) {\n return this.getBottomLeftCorner();\n }\n if (this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col))) {\n return this.getTopRightCorner();\n }\n if (this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {\n return this.getTopLeftCorner();\n }\n }\n }\n\n if (coords.isEqual(this.getBottomRightCorner())) {\n return this.getTopLeftCorner();\n } else if (coords.isEqual(this.getTopLeftCorner())) {\n return this.getBottomRightCorner();\n } else if (coords.isEqual(this.getTopRightCorner())) {\n return this.getBottomLeftCorner();\n } else if (coords.isEqual(this.getBottomLeftCorner())) {\n return this.getTopRightCorner();\n }\n }\n\n /**\n * @param {CellRange} range\n * @returns {Array}\n */\n\n }, {\n key: 'getBordersSharedWith',\n value: function getBordersSharedWith(range) {\n if (!this.includesRange(range)) {\n return [];\n }\n\n var thisBorders = {\n top: Math.min(this.from.row, this.to.row),\n bottom: Math.max(this.from.row, this.to.row),\n left: Math.min(this.from.col, this.to.col),\n right: Math.max(this.from.col, this.to.col)\n };\n var rangeBorders = {\n top: Math.min(range.from.row, range.to.row),\n bottom: Math.max(range.from.row, range.to.row),\n left: Math.min(range.from.col, range.to.col),\n right: Math.max(range.from.col, range.to.col)\n };\n var result = [];\n\n if (thisBorders.top == rangeBorders.top) {\n result.push('top');\n }\n if (thisBorders.right == rangeBorders.right) {\n result.push('right');\n }\n if (thisBorders.bottom == rangeBorders.bottom) {\n result.push('bottom');\n }\n if (thisBorders.left == rangeBorders.left) {\n result.push('left');\n }\n\n return result;\n }\n\n /**\n * Get inner selected cell coords defined by this range\n *\n * @returns {Array}\n */\n\n }, {\n key: 'getInner',\n value: function getInner() {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {\n out.push(new _coords2.default(r, c));\n }\n }\n }\n return out;\n }\n\n /**\n * Get all selected cell coords defined by this range\n *\n * @returns {Array}\n */\n\n }, {\n key: 'getAll',\n value: function getAll() {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (topLeft.row === r && topLeft.col === c) {\n out.push(topLeft);\n } else if (bottomRight.row === r && bottomRight.col === c) {\n out.push(bottomRight);\n } else {\n out.push(new _coords2.default(r, c));\n }\n }\n }\n\n return out;\n }\n\n /**\n * Runs a callback function against all cells in the range. You can break the iteration by returning\n * `false` in the callback function\n *\n * @param callback {Function}\n */\n\n }, {\n key: 'forAll',\n value: function forAll(callback) {\n var topLeft = this.getTopLeftCorner();\n var bottomRight = this.getBottomRightCorner();\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n var breakIteration = callback(r, c);\n\n if (breakIteration === false) {\n return;\n }\n }\n }\n }\n }]);\n\n return CellRange;\n}();\n\nexports.default = CellRange;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = separatorItem;\nvar KEY = exports.KEY = '---------';\n\nfunction separatorItem() {\n return {\n name: KEY\n };\n}\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $defineProperty = __webpack_require__(19)\n , createDesc = __webpack_require__(40);\n\nmodule.exports = function(object, index, value){\n if(index in object)$defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , document = __webpack_require__(13).document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports) {\n\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar MATCH = __webpack_require__(10)('match');\nmodule.exports = function(KEY){\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch(e){\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch(f){ /* empty */ }\n } return true;\n};\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(38);\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ITERATOR = __webpack_require__(10)('iterator')\n , SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function(){ SAFE_CLOSING = true; };\n Array.from(riter, function(){ throw 2; });\n} catch(e){ /* empty */ }\n\nmodule.exports = function(exec, skipClosing){\n if(!skipClosing && !SAFE_CLOSING)return false;\n var safe = false;\n try {\n var arr = [7]\n , iter = arr[ITERATOR]();\n iter.next = function(){ return {done: safe = true}; };\n arr[ITERATOR] = function(){ return iter; };\n exec(arr);\n } catch(e){ /* empty */ }\n return safe;\n};\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(18)\n , dPs = __webpack_require__(286)\n , enumBugKeys = __webpack_require__(74)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO')\n , Empty = function(){ /* empty */ }\n , PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function(){\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(73)('iframe')\n , i = enumBugKeys.length\n , lt = '<'\n , gt = '>'\n , iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(159).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties){\n var result;\n if(O !== null){\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty;\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pIE = __webpack_require__(47)\n , createDesc = __webpack_require__(40)\n , toIObject = __webpack_require__(23)\n , toPrimitive = __webpack_require__(85)\n , has = __webpack_require__(22)\n , IE8_DOM_DEFINE = __webpack_require__(160)\n , gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(21) ? gOPD : function getOwnPropertyDescriptor(O, P){\n O = toIObject(O);\n P = toPrimitive(P, true);\n if(IE8_DOM_DEFINE)try {\n return gOPD(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(169)\n , hiddenKeys = __webpack_require__(74).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){\n return $keys(O, hiddenKeys);\n};\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar shared = __webpack_require__(82)('keys')\n , uid = __webpack_require__(49);\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = __webpack_require__(164)\n , defined = __webpack_require__(30);\n\nmodule.exports = function(that, searchString, NAME){\n if(isRegExp(searchString))throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(29)\n , invoke = __webpack_require__(282)\n , html = __webpack_require__(159)\n , cel = __webpack_require__(73)\n , global = __webpack_require__(13)\n , process = global.process\n , setTask = global.setImmediate\n , clearTask = global.clearImmediate\n , MessageChannel = global.MessageChannel\n , counter = 0\n , queue = {}\n , ONREADYSTATECHANGE = 'onreadystatechange'\n , defer, channel, port;\nvar run = function(){\n var id = +this;\n if(queue.hasOwnProperty(id)){\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function(event){\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif(!setTask || !clearTask){\n setTask = function setImmediate(fn){\n var args = [], i = 1;\n while(arguments.length > i)args.push(arguments[i++]);\n queue[++counter] = function(){\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id){\n delete queue[id];\n };\n // Node.js 0.8-\n if(__webpack_require__(38)(process) == 'process'){\n defer = function(id){\n process.nextTick(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if(MessageChannel){\n channel = new MessageChannel;\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){\n defer = function(id){\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if(ONREADYSTATECHANGE in cel('script')){\n defer = function(id){\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function(id){\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(15);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_86__;\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _mixed = __webpack_require__(20);\n\n/**\n * @alias Options\n * @constructor\n * @description\n\n * ## Constructor options\n *\n * Constructor options are applied using an object literal passed as a second argument to the Handsontable constructor.\n *\n * ```js\n * var hot = new Handsontable(document.getElementById('example1'), {\n * data: myArray,\n * width: 400,\n * height: 300\n * });\n * ```\n *\n * ---\n * ## Cascading configuration\n *\n * Handsontable 0.9 and newer is using *Cascading Configuration*, which is a fast way to provide configuration options\n * for the entire table, including its columns and particular cells.\n *\n * Consider the following example:\n * ```js\n * var hot = new Handsontable(document.getElementById('example'), {\n * readOnly: true,\n * columns: [\n * {readOnly: false},\n * {},\n * {}\n * ],\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n *\n * if (row === 0 && col === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * }\n * });\n * ```\n *\n * The above notation will result in all TDs being *read only*, except for first column TDs which will be *editable*, except for the TD in top left corner which will still be *read only*.\n *\n * ### The Cascading Configuration model\n *\n * ##### 1. Constructor\n *\n * Configuration options that are provided using first-level `handsontable(container, {option: \"value\"})` and `updateSettings` method.\n *\n * ##### 2. Columns\n *\n * Configuration options that are provided using second-level object `handsontable(container, {columns: {option: \"value\"}]})`\n *\n * ##### 3. Cells\n *\n * Configuration options that are provided using second-level function `handsontable(container, {cells: function: (row, col, prop){ }})`\n *\n * ---\n * ## Architecture performance\n *\n * The Cascading Configuration model is based on prototypical inheritance. It is much faster and memory efficient compared\n * to the previous model that used jQuery extend. See: [http://jsperf.com/extending-settings](http://jsperf.com/extending-settings).\n *\n * ---\n * __Important notice:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n */\nfunction DefaultSettings() {};\n\nDefaultSettings.prototype = {\n /**\n * @description\n * Initial data source that will be bound to the data grid __by reference__ (editing data grid alters the data source).\n * Can be declared as an Array of Arrays, Array of Objects or a Function.\n *\n * See [Understanding binding as reference](http://docs.handsontable.com/tutorial-data-binding.html#page-reference).\n *\n * @type {Array|Function}\n * @default undefined\n */\n data: void 0,\n\n /**\n * @description\n * Defines the structure of a new row when data source is an array of objects.\n *\n * See [data-schema](http://docs.handsontable.com/tutorial-data-sources.html#page-data-schema) for examples.\n *\n * @type {Object}\n * @default undefined\n */\n dataSchema: void 0,\n\n /**\n * Width of the grid. Can be a value or a function that returns a value.\n *\n * @type {Number|Function}\n * @default undefined\n */\n width: void 0,\n\n /**\n * Height of the grid. Can be a number or a function that returns a number.\n *\n * @type {Number|Function}\n * @default undefined\n */\n height: void 0,\n\n /**\n * @description\n * Initial number of rows.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startRows: 5,\n\n /**\n * @description\n * Initial number of columns.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startCols: 5,\n\n /**\n * Setting `true` or `false` will enable or disable the default row headers (1, 2, 3).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set the index of the row is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * rowHeaders: true,\n * ...\n *\n * ...\n * // as array\n * rowHeaders: [1, 2, 3],\n * ...\n *\n * ...\n * // as function\n * rowHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n rowHeaders: void 0,\n\n /**\n * Setting `true` or `false` will enable or disable the default column headers (A, B, C).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set, then the index of the column is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * colHeaders: true,\n * ...\n *\n * ...\n * // as array\n * colHeaders: ['A', 'B', 'C'],\n * ...\n *\n * ...\n * // as function\n * colHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n colHeaders: null,\n\n /**\n * Defines column widths in pixels. Accepts number, string (that will be converted to a number),\n * array of numbers (if you want to define column width separately for each column) or a\n * function (if you want to set column width dynamically on each render).\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n */\n colWidths: void 0,\n\n /**\n * Defines row heights in pixels. Accepts numbers, strings (that will be converted into a number),\n * array of numbers (if you want to define row height separately for each row) or a\n * function (if you want to set row height dynamically on each render).\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n */\n rowHeights: void 0,\n\n /**\n * @description\n * Defines the cell properties and data binding for certain columns.\n *\n * __Notice:__ Using this option sets a fixed number of columns (options `startCols`, `minCols`, `maxCols` will be ignored).\n *\n * See [documentation -> datasources.html](http://docs.handsontable.com/tutorial-data-sources.html#page-nested) for examples.\n *\n * @type {Array}\n * @default undefined\n * @example\n * ```js\n * ...\n * columns: [\n * {\n * // column options for the first column\n * type: 'numeric',\n * format: '0,0.00 $'\n * },\n * {\n * // column options for the second column\n * type: 'text',\n * readOnly: true\n * }\n * ],\n * ...\n * ```\n */\n columns: void 0,\n\n /**\n * @description\n * Defines the cell properties for given `row`, `col`, `prop` coordinates.\n * Any constructor or column option may be overwritten for a particular cell (row/column combination)\n * using the `cells` property in the Handsontable constructor.\n *\n * __Note:__ Parameters `row` and `col` always represent __physical indexes__. Example below show how to execute\n * operations based on the __visual__ representation of Handsontable.\n *\n * @type {Function}\n * @default undefined\n * @example\n * ```js\n * ...\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n * var visualRowIndex = this.instance.toVisualRow(row);\n * var visualColIndex = this.instance.toVisualColumn(col);\n *\n * if (visualRowIndex === 0 && visualColIndex === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * },\n * ...\n * ```\n */\n cells: void 0,\n\n /**\n * Any constructor or column option may be overwritten for a particular cell (row/column combination), using `cell`\n * array passed to the Handsontable constructor.\n *\n * @type {Array}\n * @default []\n * @example\n * ```js\n * ...\n * cell: [\n * {row: 0, col: 0, readOnly: true}\n * ],\n * ...\n * ```\n */\n cell: [],\n\n /**\n * @description\n * If `true`, enables the {@link Comments} plugin, which enables an option to apply cell comments through the context menu\n * (configurable with context menu keys `commentsAddEdit`, `commentsRemove`).\n *\n * To initialize Handsontable with predefined comments, provide cell coordinates and comment text values in a form of an array.\n *\n * See [Comments](http://docs.handsontable.com/demo-comments_.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * comments: [{row: 1, col: 1, comment: {value: \"Test comment\"}}],\n * ...\n * ```\n */\n comments: false,\n\n /**\n * @description\n * If `true`, enables the Custom Borders plugin, which enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * customBorders: [\n * {range: {\n * from: {row: 1, col: 1},\n * to: {row: 3, col: 4}},\n * left: {},\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * {row: 2, col: 2, left: {width: 2, color: 'red'},\n * right: {width: 1, color: 'green'}, top: '', bottom: ''}\n * ],\n * ...\n * ```\n */\n customBorders: false,\n\n /**\n * Minimum number of rows. At least that number of rows will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minRows: 0,\n\n /**\n * Minimum number of columns. At least that number of columns will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minCols: 0,\n\n /**\n * Maximum number of rows. If set to a value lower than the initial row count, the data will be trimmed to the provided value as the number of rows.\n *\n * @type {Number}\n * @default Infinity\n */\n maxRows: Infinity,\n\n /**\n * Maximum number of cols. If set to a value lower than the initial col count, the data will be trimmed to the provided value as the number of cols.\n *\n * @type {Number}\n * @default Infinity\n */\n maxCols: Infinity,\n\n /**\n * When set to 1 (or more), Handsontable will add a new row at the end of grid if there are no more empty rows.\n * (unless the number of rows exceeds the one set in the `maxRows` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareRows: 0,\n\n /**\n * When set to 1 (or more), Handsontable will add a new column at the end of grid if there are no more empty columns.\n * (unless the number of rows exceeds the one set in the `maxCols` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareCols: 0,\n\n /**\n * If set to `false`, there won't be an option to insert new rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertRow: true,\n\n /**\n * If set to `false`, there won't be an option to insert new columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertColumn: true,\n\n /**\n * If set to `false`, there won't be an option to remove rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveRow: true,\n\n /**\n * If set to `false`, there won't be an option to remove columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveColumn: true,\n\n /**\n * If true, selection of multiple cells using keyboard or mouse is allowed.\n *\n * @type {Boolean}\n * @default true\n */\n multiSelect: true,\n\n /**\n * Enables the fill handle (drag-down and copy-down) functionality, which shows a small rectangle in bottom\n * right corner of the selected area, that let's you expand values to the adjacent cells.\n *\n * Possible values: `true` (to enable in all directions), `'vertical'` or `'horizontal'` (to enable in one direction),\n * `false` (to disable completely). Setting to `true` enables the fillHandle plugin.\n *\n * Since 0.23.0 you can pass object to plugin which allows you to add more options for this functionality. If `autoInsertRow`\n * option is `true`, fill-handler will create new rows till it reaches the last row. It is enabled by default.\n *\n * @example\n * ```js\n * ...\n * fillHandle: true // enable plugin in all directions and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: 'vertical' // enable plugin in vertical direction and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: { // enable plugin in both directions and with autoInsertRow as false\n * autoInsertRow: false,\n * }\n * // or\n * ...\n * fillHandle: { // enable plugin in vertical direction and with autoInsertRow as false\n * autoInsertRow: false,\n * direction: 'vertical' // 'vertical' or 'horizontal'\n * }\n * ```\n *\n * @type {Boolean|String|Object}\n * @default true\n */\n fillHandle: true,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the top of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsTop: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsTop: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the bottom of the table.\n *\n * @pro\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsBottom: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsBottom: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) columns on the left of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedColumnsLeft: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedColumnsLeft: 0,\n\n /**\n * If `true`, mouse click outside the grid will deselect the current selection.\n * Can be a function that takes the click event target and returns a boolean.\n *\n * @type {Boolean|Function}\n * @default true\n */\n outsideClickDeselects: true,\n\n /**\n * If `true`, <kbd>ENTER</kbd> begins editing mode (like in Google Docs). If `false`, <kbd>ENTER</kbd> moves to next\n * row (like Excel) and adds a new row if necessary. <kbd>TAB</kbd> adds new column if necessary.\n *\n * @type {Boolean}\n * @default true\n */\n enterBeginsEditing: true,\n\n /**\n * Defines the cursor movement after <kbd>ENTER</kbd> was pressed (<kbd>SHIFT</kbd> + <kbd>ENTER</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>ENTER</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>ENTER</kbd> or <kbd>SHIFT</kbd> + <kbd>ENTER</kbd>.\n *\n * @type {Object|Function}\n * @default {row: 1, col: 0}\n */\n enterMoves: { row: 1, col: 0 },\n\n /**\n * Defines the cursor movement after <kbd>TAB</kbd> is pressed (<kbd>SHIFT</kbd> + <kbd>TAB</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>TAB</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>TAB</kbd> or <kbd>SHIFT</kbd> + <kbd>TAB</kbd>.\n *\n * @type {Object}\n * @default {row: 0, col: 1}\n */\n tabMoves: { row: 0, col: 1 },\n\n /**\n * If `true`, pressing <kbd>TAB</kbd> or right arrow in the last column will move to first column in next row.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapRow: false,\n\n /**\n * If `true`, pressing <kbd>ENTER</kbd> or down arrow in the last row will move to the first row in the next column.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapCol: false,\n\n /**\n * Maximum number of rows than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @type {Number}\n * @default 1000\n */\n copyRowsLimit: 1000,\n\n /**\n * Maximum number of columns than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @type {Number}\n * @default 1000\n */\n copyColsLimit: 1000,\n\n /**\n * @description\n * Defines paste (<kbd>CTRL</kbd> + <kbd>V</kbd>) behavior.\n * * Default value `\"overwrite\"` will paste clipboard value over current selection.\n * * When set to `\"shift_down\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved down.\n * * When set to `\"shift_right\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved right.\n *\n * @type {String}\n * @default 'overwrite'\n */\n pasteMode: 'overwrite',\n\n /**\n * @description\n * Turns on saving the state of column sorting, column positions and column sizes in local storage.\n *\n * You can save any sort of data in local storage to preserve table state between page reloads.\n * In order to enable data storage mechanism, `persistentState` option must be set to `true` (you can set it\n * either during Handsontable initialization or using the `updateSettings` method). When `persistentState` is enabled it exposes 3 hooks:\n *\n * __persistentStateSave__ (key: String, value: Mixed)\n *\n * * Saves value under given key in browser local storage.\n *\n * __persistentStateLoad__ (key: String, valuePlaceholder: Object)\n *\n * * Loads `value`, saved under given key, form browser local storage. The loaded `value` will be saved in `valuePlaceholder.value`\n * (this is due to specific behaviour of `Hooks.run()` method). If no value have been saved under key `valuePlaceholder.value`\n * will be `undefined`.\n *\n * __persistentStateReset__ (key: String)\n *\n * * Clears the value saved under `key`. If no `key` is given, all values associated with table will be cleared.\n *\n * __Note:__ The main reason behind using `persistentState` hooks rather than regular LocalStorage API is that it\n * ensures separation of data stored by multiple Handsontable instances. In other words, if you have two (or more)\n * instances of Handsontable on one page, data saved by one instance won't be accessible by the second instance.\n * Those two instances can store data under the same key and no data would be overwritten.\n *\n * __Important:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n *\n * @type {Boolean}\n * @default false\n */\n persistentState: void 0,\n\n /**\n * Class name for all visible rows in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentRowClassName: 'currentRow' // This will add a 'currentRow' class name to appropriate table cells.\n * ```\n */\n currentRowClassName: void 0,\n\n /**\n * Class name for all visible columns in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentColClassName: 'currentColumn' // This will add a 'currentColumn' class name to appropriate table cells.\n * ```\n */\n currentColClassName: void 0,\n\n /**\n * Class name for all visible headers in current selection.\n *\n * @type {String}\n * @since 0.27.0\n * @default 'ht__highlight'\n * @example\n * ```js\n * currentHeaderClassName: 'ht__highlight' // This will add a 'ht__highlight' class name to appropriate table headers.\n * ```\n */\n currentHeaderClassName: 'ht__highlight',\n /**\n * Class name for the Handsontable container element.\n *\n * @type {String|Array}\n * @default undefined\n */\n className: void 0,\n\n /**\n * Class name for all tables inside container element.\n *\n * @since 0.17.0\n * @type {String|Array}\n * @default undefined\n */\n tableClassName: void 0,\n\n /**\n * @description\n * Defines how the columns react, when the declared table width is different than the calculated sum of all column widths.\n * [See more](http://docs.handsontable.com/demo-stretching.html) mode. Possible values:\n * * `'none'` Disable stretching\n * * `'last'` Stretch only the last column\n * * `'all'` Stretch all the columns evenly\n *\n * @type {String}\n * @default 'none'\n */\n stretchH: 'none',\n\n /**\n * Lets you overwrite the default `isEmptyRow` method, which checks if row at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} row\n * @returns {Boolean}\n */\n isEmptyRow: function isEmptyRow(row) {\n var col, colLen, value, meta;\n\n for (col = 0, colLen = this.countCols(); col < colLen; col++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && (0, _mixed.isDefined)(value)) {\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n meta = this.getCellMeta(row, col);\n\n return isObjectEquals(this.getSchema()[meta.prop], value);\n }\n return false;\n }\n }\n\n return true;\n },\n\n\n /**\n * Lets you overwrite the default `isEmptyCol` method, which checks if column at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} col\n * @returns {Boolean}\n */\n isEmptyCol: function isEmptyCol(col) {\n var row, rowLen, value;\n\n for (row = 0, rowLen = this.countRows(); row < rowLen; row++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && (0, _mixed.isDefined)(value)) {\n return false;\n }\n }\n\n return true;\n },\n\n\n /**\n * When set to `true`, the table is re-rendered when it is detected that it was made visible in DOM.\n *\n * @type {Boolean}\n * @default true\n */\n observeDOMVisibility: true,\n\n /**\n * If set to `true`, Handsontable will accept values that were marked as invalid by the cell `validator`.\n * It will result with *invalid* cells being treated as *valid* (will save the *invalid* value into the Handsontable data source).\n * If set to `false`, Handsontable will *not* accept the invalid values and won't allow the user to close the editor.\n * This option will be particularly useful when used with the Autocomplete's `strict` mode.\n *\n * @type {Boolean}\n * @default true\n * @since 0.9.5\n */\n allowInvalid: true,\n\n /**\n * If set to `true`, Handsontable will accept values that are empty (`null`, `undefined` or `''`).\n * If set to `false`, Handsontable will *not* accept the empty values and mark cell as invalid.\n *\n * @example\n * ```js\n * ...\n * allowEmpty: true // allow empty values for all cells (whole table)\n * ...\n * // or\n * ...\n * columns: [\n * // allow empty values only for 'date' column\n * {data: 'date', dateFormat: 'DD/MM/YYYY', allowEmpty: true}\n * ]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default true\n * @since 0.23.0\n */\n allowEmpty: true,\n\n /**\n * CSS class name for cells that did not pass validation.\n *\n * @type {String}\n * @default 'htInvalid'\n */\n invalidCellClassName: 'htInvalid',\n\n /**\n * When set to an non-empty string, displayed as the cell content for empty cells. If a value of a different type is provided,\n * it will be stringified and applied as a string.\n *\n * @type {Mixed}\n * @default false\n */\n placeholder: false,\n\n /**\n * CSS class name for cells that have a placeholder in use.\n *\n * @type {String}\n * @default 'htPlaceholder'\n */\n placeholderCellClassName: 'htPlaceholder',\n\n /**\n * CSS class name for read-only cells.\n *\n * @type {String}\n * @default 'htDimmed'\n */\n readOnlyCellClassName: 'htDimmed',\n\n /**\n * @description\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `checkbox`,\n * * `html`,\n * * `numeric`,\n * * `password`.\n * * `text`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-custom-renderers.html) the custom renderer under specified name and use\n * its name as an alias in your configuration.\n *\n * If a function is provided, it will receive the following arguments:\n * ```js\n * function(instance, TD, row, col, prop, value, cellProperties) {}\n * ```\n *\n * You can read more about custom renderes [in the documentation](http://docs.handsontable.com/demo-custom-renderers.html).\n *\n * @example\n * ```js\n * ...\n * Handsontable.renderers.registerRenderer('my.renderer', function(instance, TD, row, col, prop, value, cellProperties) {\n * TD.innerHTML = value;\n * });\n * ...\n * columns: [\n * {\n * editor: 'select',\n * renderer: 'autocomplete' // as string\n * },\n * {\n * renderer: 'my.renderer' // custom renderer as an alias\n * },\n * {\n * // renderer as custom function\n * renderer: function(hotInstance, TD, row, col, prop, value, cellProperties) {\n * TD.style.color = 'blue';\n * TD.innerHTML = value;\n * }\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function}\n * @default undefined\n */\n renderer: void 0,\n\n /**\n * CSS class name added to the commented cells.\n *\n * @type {String}\n * @default 'htCommentCell'\n */\n commentedCellClassName: 'htCommentCell',\n\n /**\n * If set to `true`, it enables the browser's native selection of a fragment of the text within a single cell, between adjacent cells or in a whole table.\n * If set to `'cell'`, it enables the possibility of selecting a fragment of the text within a single cell's body.\n *\n * @type {Boolean|String}\n * @default false\n */\n fragmentSelection: false,\n\n /**\n * @description\n * Make cell [read only](http://docs.handsontable.com/demo-read-only.html).\n *\n * @type {Boolean}\n * @default false\n */\n readOnly: false,\n\n /**\n * @description\n * When added to a `column` property, it skips the column on paste and pastes the data on the next column to the right.\n *\n * @type {Boolean}\n * @default false\n */\n skipColumnOnPaste: false,\n\n /**\n * @description\n * Setting to true enables the search plugin (see [demo](http://docs.handsontable.com/demo-search-for-values.html)).\n *\n * @type {Boolean}\n * @default false\n */\n search: false,\n\n /**\n * @description\n * Shortcut to define the combination of the cell renderer, editor and validator for the column, cell or whole table.\n *\n * Possible values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [numeric](http://docs.handsontable.com/demo-numeric.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * text\n * * [time](http://docs.handsontable.com/demo-time.html)\n *\n * Or you can register the custom cell type under specified name and use\n * its name as an alias in your configuration.\n *\n * @example\n * ```js\n * ...\n * Handsontable.cellTypes.registerCellType('my.type', {\n * editor: MyEditorClass,\n * renderer: function(hot, td, row, col, prop, value, cellProperties) {\n * td.innerHTML = value;\n * },\n * validator: function(value, callback) {\n * callback(value === 'foo' ? true : false);\n * }\n * });\n * ...\n * columns: [\n * {\n * type: 'text'\n * },\n * {\n * type: 'my.type' // an alias to custom type\n * },\n * {\n * type: 'checkbox'\n * }\n * ]\n * ...\n * ```\n *\n * @type {String}\n * @default 'text'\n */\n type: 'text',\n\n /**\n * @description\n * Make cell copyable (pressing <kbd>CTRL</kbd> + <kbd>C</kbd> on your keyboard moves its value to system clipboard).\n *\n * __Note:__ this setting is `false` by default for cells with type `password`.\n *\n * @type {Boolean}\n * @default true\n * @since 0.10.2\n */\n copyable: true,\n\n /**\n * Defines the editor for the table/column/cell.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [mobile](http://docs.handsontable.com/demo-mobiles-and-tablets.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * [select](http://docs.handsontable.com/demo-select.html)\n * * text\n *\n * Or you can [register](http://docs.handsontable.com/tutorial-cell-editor.html#registering-an-editor) the custom editor under specified name and use\n * its name as an alias in your configuration.\n *\n * To disable cell editing completely set `editor` property to `false`.\n *\n * @example\n * ```js\n * ...\n * columns: [\n * {\n * editor: 'select'\n * },\n * {\n * editor: false\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function|Boolean}\n * @default 'text'\n */\n editor: void 0,\n\n /**\n * @description\n * Autocomplete definitions. See [autocomplete demo](http://docs.handsontable.com/demo-autocomplete.html) for examples and definitions.\n *\n * @type {Array}\n * @default undefined\n */\n autoComplete: void 0,\n\n /**\n * Control number of choices for the autocomplete (or dropdown) typed cells. After exceeding it, a scrollbar for the dropdown list of choices will appear.\n *\n * @since 0.18.0\n * @type {Number}\n * @default 10\n */\n visibleRows: 10,\n\n /**\n * Makes autocomplete or dropdown width the same as the edited cell width. If `false` then editor will be scaled\n * according to its content.\n *\n * @since 0.17.0\n * @type {Boolean}\n * @default true\n */\n trimDropdown: true,\n\n /**\n * Setting to true enables the debug mode, currently used to test the correctness of the row and column\n * header fixed positioning on a layer above the master table.\n *\n * @type {Boolean}\n * @default false\n */\n debug: false,\n\n /**\n * When set to `true`, the text of the cell content is wrapped if it does not fit in the fixed column width.\n *\n * @type {Boolean}\n * @default true\n * @since 0.11.0\n */\n wordWrap: true,\n\n /**\n * CSS class name added to cells with cell meta `wordWrap: false`.\n *\n * @type {String}\n * @default 'htNoWrap'\n * @since 0.11.0\n */\n noWordWrapClassName: 'htNoWrap',\n\n /**\n * @description\n * Defines if the right-click context menu should be enabled. Context menu allows to create new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n *\n * or array of any available strings:\n * * `[\"row_above\", \"row_below\", \"col_left\", \"col_right\",\n * \"remove_row\", \"remove_col\", \"---------\", \"undo\", \"redo\"]`.\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as a array\n * contextMenu: ['row_above', 'row_below', '--------', 'undo', 'redo']\n * ...\n * ```\n *\n * @type {Boolean|Array|Object}\n * @default undefined\n */\n contextMenu: void 0,\n\n /**\n * @description\n * Defines new actions copy/paste for context menu. This functionality is dependent on ZeroClipboard from which you\n * should pass the swf file path under `swfPath` object key.\n *\n * @example\n * ```js\n * ...\n * contextMenuCopyPaste: {swfPath: '[path to file]'}\n * ...\n * ```\n *\n * @type {Object}\n */\n contextMenuCopyPaste: void 0,\n\n /**\n * @description\n * Disable or enable the copy/paste functionality.\n *\n * @example\n * ```js\n * ...\n * copyPaste: false,\n * ...\n * ```\n *\n * @type {Boolean}\n * @default undefined\n */\n copyPaste: void 0,\n\n /**\n * If `true`, undo/redo functionality is enabled.\n *\n * @type {Boolean}\n * @default undefined\n */\n undo: void 0,\n\n /**\n * @description\n * Turns on [Column sorting](http://docs.handsontable.com/demo-sorting-data.html).\n * Can be either a boolean (true/false) or an object with a declared sorting options. See the below example:\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n *\n * @type {Boolean|Object}\n * @default undefined\n */\n columnSorting: void 0,\n\n /**\n * @description\n * Turns on [Manual column move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * column order, if set to an array of column indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnMove: true\n * ...\n * // as a array with initial order (move column index at 0 to 1 and move column index at 1 to 4)\n * manualColumnMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnMove: void 0,\n\n /**\n * @description\n * Turns on [Manual column resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * column resized widths, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnResize: true\n * ...\n * // as a array with initial widths (column at 0 index has 40px and column at 1 index has 50px)\n * manualColumnResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnResize: void 0,\n\n /**\n * @description\n * Turns on [Manual row move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * row order, if set to an array of row indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowMove: true\n * ...\n * // as a array with initial order (move row index at 0 to 1 and move row index at 1 to 4)\n * manualRowMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowMove: void 0,\n\n /**\n * @description\n * Turns on [Manual row resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * row resized heights, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowResize: true\n * ...\n * // as a array with initial heights (row at 0 index has 40px and row at 1 index has 50px)\n * manualRowResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowResize: void 0,\n\n /**\n * @description\n * If set to `true`, it enables a possibility to merge cells. If set to an array of objects, it merges the cells provided in the objects (see the example below).\n * [More information on the demo page.](http://docs.handsontable.com/demo-merge-cells.html)\n *\n * @example\n * ```js\n * // enables the mergeCells plugin:\n * margeCells: true\n * ...\n * // declares a list of merged sections:\n * mergeCells: [\n * {row: 1, col: 1, rowspan: 3, colspan: 3}, // rowspan and colspan properties declare the width and height of a merged section in cells\n * {row: 3, col: 4, rowspan: 2, colspan: 2},\n * {row: 5, col: 6, rowspan: 3, colspan: 3}\n * ]\n * ```\n * @type {Boolean|Array}\n * @default false\n */\n mergeCells: false,\n\n /**\n * Number of rows to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable to attempt to calculate the best offset performance-wise.\n *\n * You may test out different values to find the best one that works for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportRowRenderingOffset: 'auto',\n\n /**\n * Number of columns to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable try calculating the best offset performance-wise.\n *\n * You may experiment with the value to find the one that works best for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportColumnRenderingOffset: 'auto',\n\n /**\n * A function, regular expression or a string, which will be used in the process of cell validation.\n * If a function is used, be sure to execute the callback argument with either `true` (`callback(true)`) if the validation passed\n * or with `false` (`callback(false)`), if the validation failed.\n * Note, that `this` in the function points to the `cellProperties` object.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `date`,\n * * `numeric`,\n * * `time`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-data-validation.html) the validator function under specified name and use\n * its name as an alias in your configuration.\n *\n * See more [in the demo](http://docs.handsontable.com/demo-data-validation.html).\n *\n * @example\n * ```js\n * // as a function\n * columns: [\n * {\n * validator: function(value, callback) { // validation rules }\n * }\n * ]\n * ...\n * // as a regexp\n * columns: [\n * {\n * validator: /^[0-9]$/ // regular expression\n * }\n * ]\n * // as a string\n * columns: [\n * {\n * validator: 'numeric'\n * }\n * ]\n * ```\n * @type {Function|RegExp|String}\n * @default undefined\n * @since 0.9.5\n */\n validator: void 0,\n\n /**\n * @description\n * Disable visual cells selection.\n *\n * Possible values:\n * * `true` - Disables any type of visual selection (current and area selection),\n * * `false` - Enables any type of visual selection. This is default value.\n * * `current` - Disables the selection of a currently selected cell, the area selection is still present.\n * * `area` - Disables the area selection, the currently selected cell selection is still present.\n *\n * @type {Boolean|String|Array}\n * @default false\n * @since 0.13.2\n * @example\n * ```js\n * ...\n * // as boolean\n * disableVisualSelection: true,\n * ...\n *\n * ...\n * // as string ('current' or 'area')\n * disableVisualSelection: 'current',\n * ...\n *\n * ...\n * // as array\n * disableVisualSelection: ['current', 'area'],\n * ...\n * ```\n */\n disableVisualSelection: false,\n\n /**\n * @description\n * Set whether to display the current sorting order indicator (a triangle icon in the column header, specifying the sorting order).\n *\n * @type {Boolean}\n * @default false\n * @since 0.15.0-beta3\n */\n sortIndicator: void 0,\n\n /**\n * Disable or enable ManualColumnFreeze plugin.\n *\n * @type {Boolean}\n * @default false\n */\n manualColumnFreeze: void 0,\n\n /**\n * @description\n * Defines whether Handsontable should trim the whitespace at the beginning and the end of the cell contents.\n *\n * @type {Boolean}\n * @default true\n */\n trimWhitespace: true,\n\n settings: void 0,\n\n /**\n * @description\n * Defines data source for Autocomplete or Dropdown cell types.\n *\n * @example\n * ```js\n * ...\n * // source as a array\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C', 'D']\n * }]\n * ...\n * // source as a function\n * columns: [{\n * type: 'autocomplete',\n * source: function(query, callback) {\n * fetch('http://example.com/query?q=' + query, function(response) {\n * callback(response.items);\n * })\n * }\n * }]\n * ...\n * ```\n *\n * @type {Array|Function}\n * @default undefined\n */\n source: void 0,\n\n /**\n * @description\n * Defines the column header name.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * title: 'First name',\n * type: 'text',\n * },\n * {\n * title: 'Last name',\n * type: 'text',\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default undefined\n */\n title: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is checked.\n *\n * @example\n * ```js\n * checkedTemplate: 'good'\n *\n * // if a checkbox-typed cell is checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'good'.\n * ```\n * @type {Boolean|String}\n * @default true\n */\n checkedTemplate: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is unchecked.\n *\n * @example\n * ```js\n * uncheckedTemplate: 'bad'\n *\n * // if a checkbox-typed cell is not checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'bad'.\n * ```\n * @type {Boolean|String}\n * @default false\n */\n uncheckedTemplate: void 0,\n\n /**\n * @description\n * Object which describes if renderer should create checkbox element with label element as a parent. Option desired for\n * [checkbox](http://docs.handsontable.com/demo-checkbox.html)-typed cells.\n *\n * By default the [checkbox](http://docs.handsontable.com/demo-checkbox.html) renderer renders the checkbox without a label.\n *\n * Possible object properties:\n * * `property` - Defines the property name of the data object, which will to be used as a label.\n * (eg. `label: {property: 'name.last'}`). This option works only if data was passed as an array of objects.\n * * `position` - String which describes where to place the label text (before or after checkbox element).\n * Valid values are `'before'` and '`after`' (defaults to `'after'`).\n * * `value` - String or a Function which will be used as label text.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'checkbox',\n * label: {position: 'after', value: 'My label: '}\n * }]\n * ...\n * ```\n *\n * @since 0.19.0\n * @type {Object}\n * @default undefined\n */\n label: void 0,\n\n /**\n * Display format. See [numbrojs](http://numbrojs.com). This option is desired for\n * [numeric](http://docs.handsontable.com/demo-numeric.html)-typed cells.\n *\n * Since 0.26.0 Handsontable uses [numbro](http://numbrojs.com/) as a main library for numbers formatting.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'numeric',\n * format: '0,00'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default '0'\n */\n format: void 0,\n\n /**\n * Language display format. See [numbrojs](http://numbrojs.com/languages.html#supported-languages). This option is desired for\n * [numeric](http://docs.handsontable.com/demo-numeric.html)-typed cells.\n *\n * Since 0.26.0 Handsontable uses [numbro](http://numbrojs.com/) as a main library for numbers formatting.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'numeric',\n * language: 'en-US'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default 'en-US'\n */\n language: void 0,\n\n /**\n * @description\n * Data source for [select](http://docs.handsontable.com/demo-select.html)-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * editor: 'select',\n * selectOptions: ['A', 'B', 'C'],\n * }]\n * ...\n * ```\n *\n * @type {Array}\n */\n selectOptions: void 0,\n\n /**\n * Enables or disables the autoColumnSize plugin. Default value is `undefined`, which has the same effect as `true`.\n * Disabling this plugin can increase performance, as no size-related calculations would be done.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` option is available since 0.16.0.\n *\n * You can also use the `useHeaders` option to take the column headers with into calculation.\n *\n * @example\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n *\n * ...\n * // use headers width while calculation the column width\n * autoColumnSize: {useHeaders: true},\n * ...\n *\n * ```\n *\n * @type {Object|Boolean}\n * @default {syncLimit: 50}\n */\n autoColumnSize: void 0,\n\n /**\n * Enables or disables autoRowSize plugin. Default value is `undefined`, which has the same effect as `false` (disabled).\n * Enabling this plugin can decrease performance, as size-related calculations would be performed.\n *\n * Row height calculations are divided into sync and async stages. Each of these stages has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` options is available since 0.16.0.\n *\n * @example\n * ```js\n * ...\n * // as number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n * @type {Object|Boolean}\n * @default {syncLimit: 1000}\n */\n autoRowSize: void 0,\n\n /**\n * Date validation format.\n *\n * Option desired for `'date'` - typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'MM/DD/YYYY'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default 'DD/MM/YYYY'\n */\n dateFormat: void 0,\n\n /**\n * If `true` then dates will be automatically formatted to match the desired format.\n *\n * Option desired for `'date'`-typed typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'YYYY-MM-DD',\n * correctFormat: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default false\n */\n correctFormat: false,\n\n /**\n * Definition of default value which will fill the empty cells.\n *\n * Option desired for `'date'`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * defaultData: '2015-02-02'\n * }]\n * ...\n * ```\n *\n * @type {String}\n */\n defaultDate: void 0,\n\n /**\n * If set to `true`, the value entered into the cell must match (case-sensitive) the autocomplete source. Otherwise, cell won't pass the validation.\n * When filtering the autocomplete source list, the editor will be working in case-insensitive mode.\n *\n * Option desired for `autocomplete`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C'],\n * strict: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n */\n strict: void 0,\n\n /**\n * @description\n * If typed `true`, data defined in `source` of the autocomplete or dropdown cell will be treated as HTML.\n *\n * __Warning:__ Enabling this option can cause serious XSS vulnerabilities.\n *\n * Option desired for `'autocomplete'`-typed cells.\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * allowHtml: true,\n * source: ['<b>foo</b>', '<b>bar</b>']\n * }]\n * ...\n * ```\n * @type {Boolean}\n * @default false\n */\n allowHtml: false,\n\n /**\n * If typed `true` then virtual rendering mechanism for handsontable will be disabled.\n *\n * @type {Boolean}\n */\n renderAllRows: void 0,\n\n /**\n * Prevents table to overlap outside the parent element. If `'horizontal'` option is chosen then table will appear horizontal\n * scrollbar in case where parent's width is narrower then table's width.\n *\n * Possible values:\n * * `false` - Disables functionality (Default option).\n * * `horizontal` - Prevents horizontal overflow table.\n * * `vertical` - Prevents vertical overflow table (Not implemented yet).\n *\n * @since 0.20.3\n * @example\n * ```js\n * ...\n * preventOverflow: 'horizontal'\n * ...\n * ```\n *\n * @type {String|Boolean}\n */\n preventOverflow: false,\n\n /**\n * @description\n * Plugin allowing binding the table rows with their headers.\n * If the plugin is enabled, the table row headers will \"stick\" to the rows, when they are hidden/moved. Basically, if at the initialization\n * row 0 has a header titled \"A\", it will have it no matter what you do with the table.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|String}\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * bindRowsWithHeaders: true\n * });\n * ...\n * ```\n *\n */\n bindRowsWithHeaders: void 0,\n\n /**\n * @description\n * The CollapsibleColumns plugin allows collapsing of columns, covered by a header with the `colspan` property defined.\n *\n * Clicking the \"collapse/expand\" button collapses (or expands) all \"child\" headers except the first one.\n *\n * Setting the `collapsibleColumns` property to `true` will display a \"collapse/expand\" button in every header with a defined\n * `colspan` property.\n *\n * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array of objects, as in\n * the example below.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n * @example\n * ```js\n * ...\n * collapsibleColumns: [\n * {row: -4, col: 1, collapsible: true},\n * {row: -3, col: 5, collapsible: true}\n * ]\n * ...\n * // or\n * ...\n * collapsibleColumns: true\n * ...\n * ```\n */\n collapsibleColumns: void 0,\n\n /**\n * @description\n * Allows making pre-defined calculations on the cell values and display the results within Handsontable.\n * See the demo for more information.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n columnSummary: void 0,\n\n /**\n * This plugin allows adding a configurable dropdown menu to the table's column headers.\n * The dropdown menu acts like the Context Menu, but is triggered by clicking the button in the header.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object|Array}\n */\n dropdownMenu: void 0,\n\n /**\n * The filters plugin.\n * It allows filtering the table data either by the built-in component or with the API.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean}\n */\n filters: void 0,\n\n /**\n * It allows Handsontable to process formula expressions defined in the provided data.\n *\n * @pro\n * @since 1.7.0\n * @type {Boolean}\n */\n formulas: void 0,\n\n /**\n * @description\n * GanttChart plugin enables a possibility to create a Gantt chart using a Handsontable instance.\n * In this case, the whole table becomes read-only.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n ganttChart: void 0,\n\n /**\n * @description\n * Allows adding a tooltip to the table headers.\n *\n * Available options:\n * * the `rows` property defines if tooltips should be added to row headers,\n * * the `columns` property defines if tooltips should be added to column headers,\n * * the `onlyTrimmed` property defines if tooltips should be added only to headers, which content is trimmed by the header itself (the content being wider then the header).\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n headerTooltips: void 0,\n\n /**\n * Plugin allowing hiding of certain columns.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenColumns: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenRows: void 0,\n\n /**\n * @description\n * Allows creating a nested header structure, using the HTML's colspan attribute.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Array}\n */\n nestedHeaders: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n */\n trimRows: void 0,\n\n /**\n * @description\n * Allows setting a custom width of the row headers. You can provide a number or an array of widths, if many row header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n rowHeaderWidth: void 0,\n\n /**\n * @description\n * Allows setting a custom height of the column headers. You can provide a number or an array of heights, if many column header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n columnHeaderHeight: void 0,\n\n /**\n * @description\n * Enabling this plugin switches table into one-way data binding where changes are applied into data source (from outside table)\n * will be automatically reflected in the table.\n *\n * For every data change [afterChangesObserved](Hooks.html#event:afterChangesObserved) hook will be fired.\n *\n * @type {Boolean}\n * @default false\n */\n observeChanges: void 0,\n\n /**\n * @description\n * When passed to the `column` property, allows specifying a custom sorting function for the desired column.\n *\n * @since 0.24.0\n * @type {Function}\n * @example\n * ```js\n * columns: [\n * {\n * sortFunction: function(sortOrder) {\n * return function(a, b) {\n * // sorting function body.\n * //\n * // Function parameters:\n * // sortOrder: If true, the order is ascending, if false - descending. undefined = original order\n * // a, b: Two compared elements. These are 2-element arrays, with the first element being the row index, the second - cell value.\n * }\n * }\n * }\n * ]\n * ```\n */\n sortFunction: void 0,\n\n /**\n * If defined as 'true', the Autocomplete's suggestion list would be sorted by relevance (the closer to the left the match is, the higher the suggestion).\n *\n * Option desired for cells of the `'autocomplete'` type.\n *\n * @type {Boolean}\n * @default true\n */\n sortByRelevance: true,\n\n /**\n * If defined as 'true', when the user types into the input area the Autocomplete's suggestion list is updated to only\n * include those choices starting with what has been typed; if defined as 'false' all suggestions remain shown, with\n * those matching what has been typed marked in bold.\n *\n * @type {Boolean}\n * @default true\n */\n filter: true,\n\n /**\n * If defined as 'true', filtering in the Autocomplete Editor will be case-sensitive.\n *\n * @type {Boolean}\n * @default: false\n */\n filteringCaseSensitive: false\n};\n\nexports.default = DefaultSettings;\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.getNormalizedDate = getNormalizedDate;\n/* eslint-disable import/prefer-default-export */\n\n/**\n * Get normalized Date object for the ISO formatted date strings.\n * Natively, the date object parsed from a ISO 8601 string will be offsetted by the timezone difference, which may result in returning a wrong date.\n * See: Github issue #3338.\n *\n * @param {String} dateString String representing the date.\n * @returns {Date} The proper Date object.\n */\nfunction getNormalizedDate(dateString) {\n var nativeDate = new Date(dateString);\n\n // NaN if dateString is not in ISO format\n if (!isNaN(new Date(dateString + \"T00:00\").getDate())) {\n\n // Compensate timezone offset\n return new Date(nativeDate.getTime() + nativeDate.getTimezoneOffset() * 60000);\n }\n\n return nativeDate;\n}\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'Array', {copyWithin: __webpack_require__(275)});\n\n__webpack_require__(37)('copyWithin');\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'Array', {fill: __webpack_require__(276)});\n\n__webpack_require__(37)('fill');\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = __webpack_require__(3)\n , $find = __webpack_require__(53)(6)\n , KEY = 'findIndex'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(37)(KEY);\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = __webpack_require__(3)\n , $find = __webpack_require__(53)(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(37)(KEY);\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar ctx = __webpack_require__(29)\n , $export = __webpack_require__(3)\n , toObject = __webpack_require__(41)\n , call = __webpack_require__(165)\n , isArrayIter = __webpack_require__(161)\n , toLength = __webpack_require__(24)\n , createProperty = __webpack_require__(72)\n , getIterFn = __webpack_require__(176);\n\n$export($export.S + $export.F * !__webpack_require__(77)(function(iter){ Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){\n var O = toObject(arrayLike)\n , C = typeof this == 'function' ? this : Array\n , aLen = arguments.length\n , mapfn = aLen > 1 ? arguments[1] : undefined\n , mapping = mapfn !== undefined\n , index = 0\n , iterFn = getIterFn(O)\n , length, result, step, iterator;\n if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){\n for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for(result = new C(length); length > index; index++){\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(3)\n , createProperty = __webpack_require__(72);\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * __webpack_require__(31)(function(){\n function F(){}\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */){\n var index = 0\n , aLen = arguments.length\n , result = new (typeof this == 'function' ? this : Array)(aLen);\n while(aLen > index)createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19).f\n , createDesc = __webpack_require__(40)\n , has = __webpack_require__(22)\n , FProto = Function.prototype\n , nameRE = /^\\s*function ([^ (]*)/\n , NAME = 'name';\n\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(21) && dP(FProto, NAME, {\n configurable: true,\n get: function(){\n try {\n var that = this\n , name = ('' + that).match(nameRE)[1];\n has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));\n return name;\n } catch(e){\n return '';\n }\n }\n});\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(157);\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(54)('Map', function(get){\n return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key){\n var entry = strong.getEntry(this, key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value){\n return strong.def(this, key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.1 Number.EPSILON\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.2 Number.isFinite(number)\nvar $export = __webpack_require__(3)\n , _isFinite = __webpack_require__(13).isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it){\n return typeof it == 'number' && _isFinite(it);\n }\n});\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {isInteger: __webpack_require__(163)});\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.4 Number.isNaN(number)\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number){\n return number != number;\n }\n});\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = __webpack_require__(3)\n , isInteger = __webpack_require__(163)\n , abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number){\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = __webpack_require__(3);\n\n$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(3);\n\n$export($export.S + $export.F, 'Object', {assign: __webpack_require__(168)});\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.10 Object.is(value1, value2)\nvar $export = __webpack_require__(3);\n$export($export.S, 'Object', {is: __webpack_require__(290)});\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(3);\n$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(171).set});\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(57)\n , global = __webpack_require__(13)\n , ctx = __webpack_require__(29)\n , classof = __webpack_require__(156)\n , $export = __webpack_require__(3)\n , isObject = __webpack_require__(15)\n , aFunction = __webpack_require__(71)\n , anInstance = __webpack_require__(52)\n , forOf = __webpack_require__(56)\n , speciesConstructor = __webpack_require__(291)\n , task = __webpack_require__(84).set\n , microtask = __webpack_require__(285)()\n , PROMISE = 'Promise'\n , TypeError = global.TypeError\n , process = global.process\n , $Promise = global[PROMISE]\n , process = global.process\n , isNode = classof(process) == 'process'\n , empty = function(){ /* empty */ }\n , Internal, GenericPromiseCapability, Wrapper;\n\nvar USE_NATIVE = !!function(){\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1)\n , FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function(exec){ exec(empty, empty); };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch(e){ /* empty */ }\n}();\n\n// helpers\nvar sameConstructor = function(a, b){\n // with library wrapper special case\n return a === b || a === $Promise && b === Wrapper;\n};\nvar isThenable = function(it){\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar newPromiseCapability = function(C){\n return sameConstructor($Promise, C)\n ? new PromiseCapability(C)\n : new GenericPromiseCapability(C);\n};\nvar PromiseCapability = GenericPromiseCapability = function(C){\n var resolve, reject;\n this.promise = new C(function($$resolve, $$reject){\n if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\nvar perform = function(exec){\n try {\n exec();\n } catch(e){\n return {error: e};\n }\n};\nvar notify = function(promise, isReject){\n if(promise._n)return;\n promise._n = true;\n var chain = promise._c;\n microtask(function(){\n var value = promise._v\n , ok = promise._s == 1\n , i = 0;\n var run = function(reaction){\n var handler = ok ? reaction.ok : reaction.fail\n , resolve = reaction.resolve\n , reject = reaction.reject\n , domain = reaction.domain\n , result, then;\n try {\n if(handler){\n if(!ok){\n if(promise._h == 2)onHandleUnhandled(promise);\n promise._h = 1;\n }\n if(handler === true)result = value;\n else {\n if(domain)domain.enter();\n result = handler(value);\n if(domain)domain.exit();\n }\n if(result === reaction.promise){\n reject(TypeError('Promise-chain cycle'));\n } else if(then = isThenable(result)){\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch(e){\n reject(e);\n }\n };\n while(chain.length > i)run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if(isReject && !promise._h)onUnhandled(promise);\n });\n};\nvar onUnhandled = function(promise){\n task.call(global, function(){\n var value = promise._v\n , abrupt, handler, console;\n if(isUnhandled(promise)){\n abrupt = perform(function(){\n if(isNode){\n process.emit('unhandledRejection', value, promise);\n } else if(handler = global.onunhandledrejection){\n handler({promise: promise, reason: value});\n } else if((console = global.console) && console.error){\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if(abrupt)throw abrupt.error;\n });\n};\nvar isUnhandled = function(promise){\n if(promise._h == 1)return false;\n var chain = promise._a || promise._c\n , i = 0\n , reaction;\n while(chain.length > i){\n reaction = chain[i++];\n if(reaction.fail || !isUnhandled(reaction.promise))return false;\n } return true;\n};\nvar onHandleUnhandled = function(promise){\n task.call(global, function(){\n var handler;\n if(isNode){\n process.emit('rejectionHandled', promise);\n } else if(handler = global.onrejectionhandled){\n handler({promise: promise, reason: promise._v});\n }\n });\n};\nvar $reject = function(value){\n var promise = this;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if(!promise._a)promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function(value){\n var promise = this\n , then;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if(promise === value)throw TypeError(\"Promise can't be resolved itself\");\n if(then = isThenable(value)){\n microtask(function(){\n var wrapper = {_w: promise, _d: false}; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch(e){\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch(e){\n $reject.call({_w: promise, _d: false}, e); // wrap\n }\n};\n\n// constructor polyfill\nif(!USE_NATIVE){\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor){\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch(err){\n $reject.call(this, err);\n }\n };\n Internal = function Promise(executor){\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(59)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected){\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if(this._a)this._a.push(reaction);\n if(this._s)notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function(onRejected){\n return this.then(undefined, onRejected);\n }\n });\n PromiseCapability = function(){\n var promise = new Internal;\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});\n__webpack_require__(48)($Promise, PROMISE);\n__webpack_require__(172)(PROMISE);\nWrapper = __webpack_require__(44)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r){\n var capability = newPromiseCapability(this)\n , $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x){\n // instanceof instead of internal slot check because we should fix it without replacement native Promise core\n if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;\n var capability = newPromiseCapability(this)\n , $$resolve = capability.resolve;\n $$resolve(x);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(77)(function(iter){\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , resolve = capability.resolve\n , reject = capability.reject;\n var abrupt = perform(function(){\n var values = []\n , index = 0\n , remaining = 1;\n forOf(iterable, false, function(promise){\n var $index = index++\n , alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function(value){\n if(alreadyCalled)return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , reject = capability.reject;\n var abrupt = perform(function(){\n forOf(iterable, false, function(promise){\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 21.2.5.3 get RegExp.prototype.flags()\nif(__webpack_require__(21) && /./g.flags != 'g')__webpack_require__(19).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(280)\n});\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@match logic\n__webpack_require__(55)('match', 1, function(defined, MATCH, $match){\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@replace logic\n__webpack_require__(55)('replace', 2, function(defined, REPLACE, $replace){\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue){\n 'use strict';\n var O = defined(this)\n , fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@search logic\n__webpack_require__(55)('search', 1, function(defined, SEARCH, $search){\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp){\n 'use strict';\n var O = defined(this)\n , fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// @@split logic\n__webpack_require__(55)('split', 2, function(defined, SPLIT, $split){\n 'use strict';\n var isRegExp = __webpack_require__(164)\n , _split = $split\n , $push = [].push\n , $SPLIT = 'split'\n , LENGTH = 'length'\n , LAST_INDEX = 'lastIndex';\n if(\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ){\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function(separator, limit){\n var string = String(this);\n if(separator === undefined && limit === 0)return [];\n // If `separator` is not a regex, use native split\n if(!isRegExp(separator))return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while(match = separatorCopy.exec(string)){\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if(lastIndex > lastLastIndex){\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){\n for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;\n });\n if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if(output[LENGTH] >= splitLimit)break;\n }\n if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if(lastLastIndex === string[LENGTH]){\n if(lastLength || !separatorCopy.test(''))output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if('0'[$SPLIT](undefined, 0)[LENGTH]){\n $split = function(separator, limit){\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit){\n var O = defined(this)\n , fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(157);\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(54)('Set', function(get){\n return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value){\n return strong.def(this, value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(3)\n , $at = __webpack_require__(292)(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos){\n return $at(this, pos);\n }\n});\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n\nvar $export = __webpack_require__(3)\n , toLength = __webpack_require__(24)\n , context = __webpack_require__(83)\n , ENDS_WITH = 'endsWith'\n , $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(75)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /*, endPosition = @length */){\n var that = context(this, searchString, ENDS_WITH)\n , endPosition = arguments.length > 1 ? arguments[1] : undefined\n , len = toLength(that.length)\n , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)\n , search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , toIndex = __webpack_require__(60)\n , fromCharCode = String.fromCharCode\n , $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars\n var res = []\n , aLen = arguments.length\n , i = 0\n , code;\n while(aLen > i){\n code = +arguments[i++];\n if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n\nvar $export = __webpack_require__(3)\n , context = __webpack_require__(83)\n , INCLUDES = 'includes';\n\n$export($export.P + $export.F * __webpack_require__(75)(INCLUDES), 'String', {\n includes: function includes(searchString /*, position = 0 */){\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , toIObject = __webpack_require__(23)\n , toLength = __webpack_require__(24);\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite){\n var tpl = toIObject(callSite.raw)\n , len = toLength(tpl.length)\n , aLen = arguments.length\n , res = []\n , i = 0;\n while(len > i){\n res.push(String(tpl[i++]));\n if(i < aLen)res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3);\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: __webpack_require__(174)\n});\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n\nvar $export = __webpack_require__(3)\n , toLength = __webpack_require__(24)\n , context = __webpack_require__(83)\n , STARTS_WITH = 'startsWith'\n , $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(75)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /*, position = 0 */){\n var that = context(this, searchString, STARTS_WITH)\n , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))\n , search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(13)\n , has = __webpack_require__(22)\n , DESCRIPTORS = __webpack_require__(21)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , META = __webpack_require__(46).KEY\n , $fails = __webpack_require__(31)\n , shared = __webpack_require__(82)\n , setToStringTag = __webpack_require__(48)\n , uid = __webpack_require__(49)\n , wks = __webpack_require__(10)\n , wksExt = __webpack_require__(175)\n , wksDefine = __webpack_require__(293)\n , keyOf = __webpack_require__(284)\n , enumKeys = __webpack_require__(279)\n , isArray = __webpack_require__(162)\n , anObject = __webpack_require__(18)\n , toIObject = __webpack_require__(23)\n , toPrimitive = __webpack_require__(85)\n , createDesc = __webpack_require__(40)\n , _create = __webpack_require__(78)\n , gOPNExt = __webpack_require__(287)\n , $GOPD = __webpack_require__(79)\n , $DP = __webpack_require__(19)\n , $keys = __webpack_require__(39)\n , gOPD = $GOPD.f\n , dP = $DP.f\n , gOPN = gOPNExt.f\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , PROTOTYPE = 'prototype'\n , HIDDEN = wks('_hidden')\n , TO_PRIMITIVE = wks('toPrimitive')\n , isEnum = {}.propertyIsEnumerable\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , OPSymbols = shared('op-symbols')\n , ObjectProto = Object[PROTOTYPE]\n , USE_NATIVE = typeof $Symbol == 'function'\n , QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(dP({}, 'a', {\n get: function(){ return dP(this, 'a', {value: 7}).a; }\n })).a != 7;\n}) ? function(it, key, D){\n var protoDesc = gOPD(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n dP(it, key, D);\n if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){\n return typeof it == 'symbol';\n} : function(it){\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D){\n if(it === ObjectProto)$defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if(has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n it = toIObject(it);\n key = toPrimitive(key, true);\n if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;\n var D = gOPD(it, key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = gOPN(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var IS_OP = it === ObjectProto\n , names = gOPN(IS_OP ? OPSymbols : toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif(!USE_NATIVE){\n $Symbol = function Symbol(){\n if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function(value){\n if(this === ObjectProto)$set.call(OPSymbols, value);\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString(){\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(80).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(47).f = $propertyIsEnumerable;\n __webpack_require__(58).f = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !__webpack_require__(57)){\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function(name){\n return wrap(wks(name));\n }\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});\n\nfor(var symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);\n\nfor(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n if(isSymbol(key))return keyOf(SymbolRegistry, key);\n throw TypeError(key + ' is not a symbol!');\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , replacer, $replacer;\n while(arguments.length > i)args.push(arguments[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(32)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar each = __webpack_require__(53)(0)\n , redefine = __webpack_require__(33)\n , meta = __webpack_require__(46)\n , assign = __webpack_require__(168)\n , weak = __webpack_require__(158)\n , isObject = __webpack_require__(15)\n , getWeak = meta.getWeak\n , isExtensible = Object.isExtensible\n , uncaughtFrozenStore = weak.ufstore\n , tmp = {}\n , InternalMap;\n\nvar wrapper = function(get){\n return function WeakMap(){\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key){\n if(isObject(key)){\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value){\n return weak.def(this, key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = __webpack_require__(54)('WeakMap', wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){\n InternalMap = weak.getConstructor(wrapper);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function(key){\n var proto = $WeakMap.prototype\n , method = proto[key];\n redefine(proto, key, function(a, b){\n // store frozen objects on internal weakmap shim\n if(isObject(a) && !isExtensible(a)){\n if(!this._f)this._f = new InternalMap;\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar weak = __webpack_require__(158);\n\n// 23.4 WeakSet Objects\n__webpack_require__(54)('WeakSet', function(get){\n return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value){\n return weak.def(this, value, true);\n }\n}, weak, false, true);\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/Array.prototype.includes\nvar $export = __webpack_require__(3)\n , $includes = __webpack_require__(155)(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /*, fromIndex = 0 */){\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n__webpack_require__(37)('includes');\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(3)\n , $entries = __webpack_require__(170)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it){\n return $entries(it);\n }\n});\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = __webpack_require__(3)\n , ownKeys = __webpack_require__(289)\n , toIObject = __webpack_require__(23)\n , gOPD = __webpack_require__(79)\n , createProperty = __webpack_require__(72);\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){\n var O = toIObject(object)\n , getDesc = gOPD.f\n , keys = ownKeys(O)\n , result = {}\n , i = 0\n , key;\n while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));\n return result;\n }\n});\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(3)\n , $values = __webpack_require__(170)(false);\n\n$export($export.S, 'Object', {\n values: function values(it){\n return $values(it);\n }\n});\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(3)\n , $pad = __webpack_require__(173);\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(3)\n , $pad = __webpack_require__(173);\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $iterators = __webpack_require__(68)\n , redefine = __webpack_require__(33)\n , global = __webpack_require__(13)\n , hide = __webpack_require__(32)\n , Iterators = __webpack_require__(45)\n , wks = __webpack_require__(10)\n , ITERATOR = wks('iterator')\n , TO_STRING_TAG = wks('toStringTag')\n , ArrayValues = Iterators.Array;\n\nfor(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){\n var NAME = collections[i]\n , Collection = global[NAME]\n , proto = Collection && Collection.prototype\n , key;\n if(proto){\n if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);\n if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);\n }\n}\n\n/***/ }),\n/* 131 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(3)\n , $task = __webpack_require__(84);\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * SheetClip - Spreadsheet Clipboard Parser\n * version 0.2\n *\n * This tiny library transforms JavaScript arrays to strings that are pasteable by LibreOffice, OpenOffice,\n * Google Docs and Microsoft Excel.\n *\n * Copyright 2012, Marcin Warpechowski\n * Licensed under the MIT license.\n * http://github.com/warpech/sheetclip/\n */\n/*jslint white: true*/\n(function (global) {\n \"use strict\";\n\n function countQuotes(str) {\n return str.split('\"').length - 1;\n }\n\n var SheetClip = {\n /**\n * Decode spreadsheet string into array\n *\n * @param {String} str\n * @returns {Array}\n */\n parse: function parse(str) {\n var r,\n rLen,\n rows,\n arr = [],\n a = 0,\n c,\n cLen,\n multiline,\n last;\n\n rows = str.split('\\n');\n\n if (rows.length > 1 && rows[rows.length - 1] === '') {\n rows.pop();\n }\n for (r = 0, rLen = rows.length; r < rLen; r += 1) {\n rows[r] = rows[r].split('\\t');\n\n for (c = 0, cLen = rows[r].length; c < cLen; c += 1) {\n if (!arr[a]) {\n arr[a] = [];\n }\n if (multiline && c === 0) {\n last = arr[a].length - 1;\n arr[a][last] = arr[a][last] + '\\n' + rows[r][0];\n\n if (multiline && countQuotes(rows[r][0]) & 1) {\n //& 1 is a bitwise way of performing mod 2\n multiline = false;\n arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/\"\"/g, '\"');\n }\n } else {\n if (c === cLen - 1 && rows[r][c].indexOf('\"') === 0 && countQuotes(rows[r][c]) & 1) {\n arr[a].push(rows[r][c].substring(1).replace(/\"\"/g, '\"'));\n multiline = true;\n } else {\n arr[a].push(rows[r][c].replace(/\"\"/g, '\"'));\n multiline = false;\n }\n }\n }\n if (!multiline) {\n a += 1;\n }\n }\n\n return arr;\n },\n\n /**\n * Encode array into valid spreadsheet string\n *\n * @param arr\n * @returns {String}\n */\n stringify: function stringify(arr) {\n var r,\n rLen,\n c,\n cLen,\n str = '',\n val;\n\n for (r = 0, rLen = arr.length; r < rLen; r += 1) {\n cLen = arr[r].length;\n\n for (c = 0; c < cLen; c += 1) {\n if (c > 0) {\n str += '\\t';\n }\n val = arr[r][c];\n\n if (typeof val === 'string') {\n if (val.indexOf('\\n') > -1) {\n str += '\"' + val.replace(/\"/g, '\"\"') + '\"';\n } else {\n str += val;\n }\n } else if (val === null || val === void 0) {\n // void 0 resolves to undefined\n str += '';\n } else {\n str += val;\n }\n }\n\n if (r !== rLen - 1) {\n str += '\\n';\n }\n }\n\n return str;\n }\n };\n\n if (true) {\n exports.parse = SheetClip.parse;\n exports.stringify = SheetClip.stringify;\n } else {}\n})(window);\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * json-patch-duplex.js version: 0.5.7\n * (c) 2013 Joachim Wester\n * MIT license\n */\nvar __extends = undefined && undefined.__extends || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OriginalError = Error;\nvar jsonpatch;\n(function (jsonpatch) {\n var _objectKeys = function _objectKeys(obj) {\n if (_isArray(obj)) {\n var keys = new Array(obj.length);\n for (var k = 0; k < keys.length; k++) {\n keys[k] = \"\" + k;\n }\n return keys;\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keys = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n return keys;\n };\n function _equals(a, b) {\n switch (typeof a === 'undefined' ? 'undefined' : _typeof(a)) {\n case 'undefined': //backward compatibility, but really I think we should return false\n case 'boolean':\n case 'string':\n case 'number':\n return a === b;\n case 'object':\n if (a === null) return b === null;\n if (_isArray(a)) {\n if (!_isArray(b) || a.length !== b.length) return false;\n for (var i = 0, l = a.length; i < l; i++) {\n if (!_equals(a[i], b[i])) return false;\n }return true;\n }\n var bKeys = _objectKeys(b);\n var bLength = bKeys.length;\n if (_objectKeys(a).length !== bLength) return false;\n for (var i = 0; i < bLength; i++) {\n if (!_equals(a[i], b[i])) return false;\n }return true;\n default:\n return false;\n }\n }\n /* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n /* The operations applicable to an object */\n var objOps = {\n add: function add(obj, key) {\n obj[key] = this.value;\n return true;\n },\n remove: function remove(obj, key) {\n delete obj[key];\n return true;\n },\n replace: function replace(obj, key) {\n obj[key] = this.value;\n return true;\n },\n move: function move(obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [{ op: \"remove\", path: this.from }]);\n apply(tree, [{ op: \"add\", path: this.path, value: temp.value }]);\n return true;\n },\n copy: function copy(obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [{ op: \"add\", path: this.path, value: temp.value }]);\n return true;\n },\n test: function test(obj, key) {\n return _equals(obj[key], this.value);\n },\n _get: function _get(obj, key) {\n this.value = obj[key];\n }\n };\n /* The operations applicable to an array. Many are the same as for the object */\n var arrOps = {\n add: function add(arr, i) {\n arr.splice(i, 0, this.value);\n return true;\n },\n remove: function remove(arr, i) {\n arr.splice(i, 1);\n return true;\n },\n replace: function replace(arr, i) {\n arr[i] = this.value;\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n };\n /* The operations applicable to object root. Many are the same as for the object */\n var rootOps = {\n add: function add(obj) {\n rootOps.remove.call(this, obj);\n for (var key in this.value) {\n if (this.value.hasOwnProperty(key)) {\n obj[key] = this.value[key];\n }\n }\n return true;\n },\n remove: function remove(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n objOps.remove.call(this, obj, key);\n }\n }\n return true;\n },\n replace: function replace(obj) {\n apply(obj, [{ op: \"remove\", path: this.path }]);\n apply(obj, [{ op: \"add\", path: this.path, value: this.value }]);\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: function test(obj) {\n return JSON.stringify(obj) === JSON.stringify(this.value);\n },\n _get: function _get(obj) {\n this.value = obj;\n }\n };\n var observeOps = {\n add: function add(patches, path) {\n var patch = {\n op: \"add\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name] };\n patches.push(patch);\n },\n 'delete': function _delete(patches, path) {\n var patch = {\n op: \"remove\",\n path: path + escapePathComponent(this.name)\n };\n patches.push(patch);\n },\n update: function update(patches, path) {\n var patch = {\n op: \"replace\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name]\n };\n patches.push(patch);\n }\n };\n function escapePathComponent(str) {\n if (str.indexOf('/') === -1 && str.indexOf('~') === -1) return str;\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n } else if (_typeof(root[key]) === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n }\n function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new OriginalError(\"Object not found in root\");\n }\n return '/' + path;\n }\n var beforeDict = [];\n var Mirror = function () {\n function Mirror(obj) {\n this.observers = [];\n this.obj = obj;\n }\n return Mirror;\n }();\n var ObserverInfo = function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n }();\n function getMirror(obj) {\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === obj) {\n return beforeDict[i];\n }\n }\n }\n function getObserverFromMirror(mirror, callback) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].callback === callback) {\n return mirror.observers[j].observer;\n }\n }\n }\n function removeObserverFromMirror(mirror, observer) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].observer === observer) {\n mirror.observers.splice(j, 1);\n return;\n }\n }\n }\n function unobserve(root, observer) {\n observer.unobserve();\n }\n jsonpatch.unobserve = unobserve;\n function deepClone(obj) {\n if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === \"object\") {\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n } else {\n return obj; //no need to clone primitives\n }\n }\n function observe(obj, callback) {\n var patches = [];\n var root = obj;\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.push(mirror);\n } else {\n observer = getObserverFromMirror(mirror, callback);\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var intervals = this.intervals || [100, 1000, 10000, 60000];\n if (intervals.push === void 0) {\n throw new OriginalError(\"jsonpatch.intervals must be an array\");\n }\n var currentInterval = 0;\n var dirtyCheck = function dirtyCheck() {\n generate(observer);\n };\n var fastCheck = function fastCheck() {\n clearTimeout(observer.next);\n observer.next = setTimeout(function () {\n dirtyCheck();\n currentInterval = 0;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }, 0);\n };\n var slowCheck = function slowCheck() {\n dirtyCheck();\n if (currentInterval == intervals.length) currentInterval = intervals.length - 1;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n };\n if (typeof window !== 'undefined') {\n if (window.addEventListener) {\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keydown', fastCheck);\n } else {\n document.documentElement.attachEvent('onmousedown', fastCheck);\n document.documentElement.attachEvent('onmouseup', fastCheck);\n document.documentElement.attachEvent('onkeydown', fastCheck);\n }\n }\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n if (window.removeEventListener) {\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n } else {\n document.documentElement.detachEvent('onmousedown', fastCheck);\n document.documentElement.detachEvent('onmouseup', fastCheck);\n document.documentElement.detachEvent('onkeydown', fastCheck);\n }\n }\n };\n mirror.observers.push(new ObserverInfo(callback, observer));\n return observer;\n }\n jsonpatch.observe = observe;\n function generate(observer) {\n var mirror;\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === observer.object) {\n mirror = beforeDict[i];\n break;\n }\n }\n _generate(mirror.value, observer.object, observer.patches, \"\");\n if (observer.patches.length) {\n apply(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n }\n jsonpatch.generate = generate;\n // Dirty check if obj is different from mirror, generate patches and update mirror\n function _generate(mirror, obj, patches, path) {\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (obj.hasOwnProperty(key)) {\n var newVal = obj[key];\n if ((typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) == \"object\" && oldVal != null && (typeof newVal === 'undefined' ? 'undefined' : _typeof(newVal)) == \"object\" && newVal != null) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key));\n } else {\n if (oldVal != newVal) {\n changed = true;\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: deepClone(newVal) });\n }\n }\n } else {\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!mirror.hasOwnProperty(key)) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: deepClone(obj[key]) });\n }\n }\n }\n var _isArray;\n if (Array.isArray) {\n _isArray = Array.isArray;\n } else {\n _isArray = function _isArray(obj) {\n return obj.push && typeof obj.length === 'number';\n };\n }\n //3x faster than cached /^\\d+$/.test(str)\n function isInteger(str) {\n var i = 0;\n var len = str.length;\n var charCode;\n while (i < len) {\n charCode = str.charCodeAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n }\n /// Apply a json-patch operation on an object tree\n function apply(tree, patches, validate) {\n var result = false,\n p = 0,\n plen = patches.length,\n patch,\n key;\n while (p < plen) {\n patch = patches[p];\n p++;\n // Find the object\n var path = patch.path || \"\";\n var keys = path.split('/');\n var obj = tree;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n while (true) {\n key = keys[t];\n if (validate) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n } else if (t == len - 1) {\n existingPathFragment = patch.path;\n }\n if (existingPathFragment !== undefined) {\n this.validator(patch, p - 1, tree, existingPathFragment);\n }\n }\n }\n t++;\n if (key === undefined) {\n if (t >= len) {\n result = rootOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n if (_isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n } else {\n if (validate && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", p - 1, patch.path, patch);\n }\n key = parseInt(key, 10);\n }\n if (t >= len) {\n if (validate && patch.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", p - 1, patch.path, patch);\n }\n result = arrOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n } else {\n if (key && key.indexOf('~') != -1) key = key.replace(/~1/g, '/').replace(/~0/g, '~'); // escape chars\n if (t >= len) {\n result = objOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n obj = obj[key];\n }\n }\n return result;\n }\n jsonpatch.apply = apply;\n function compare(tree1, tree2) {\n var patches = [];\n _generate(tree1, tree2, patches, '');\n return patches;\n }\n jsonpatch.compare = compare;\n var JsonPatchError = function (_super) {\n __extends(JsonPatchError, _super);\n function JsonPatchError(message, name, index, operation, tree) {\n _super.call(this, message);\n this.message = message;\n this.name = name;\n this.index = index;\n this.operation = operation;\n this.tree = tree;\n }\n return JsonPatchError;\n }(OriginalError);\n jsonpatch.JsonPatchError = JsonPatchError;\n jsonpatch.Error = JsonPatchError;\n /**\n * Recursively checks whether an object has any undefined values inside.\n */\n function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (typeof obj == \"array\" || (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == \"object\") {\n for (var i in obj) {\n if (hasUndefined(obj[i])) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [tree] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `tree`\n */\n function validator(operation, index, tree, existingPathFragment) {\n if ((typeof operation === 'undefined' ? 'undefined' : _typeof(operation)) !== 'object' || operation === null || _isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, tree);\n } else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, tree);\n } else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, tree);\n } else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, tree);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, tree);\n } else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, tree);\n } else if (tree) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, tree);\n }\n } else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, tree);\n }\n } else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = jsonpatch.validate([existingValue], tree);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, tree);\n }\n }\n }\n }\n jsonpatch.validator = validator;\n /**\n * Validates a sequence of operations. If `tree` parameter is provided, the sequence is additionally validated against the object tree.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param tree\n * @returns {JsonPatchError|undefined}\n */\n function validate(sequence, tree) {\n try {\n if (!_isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (tree) {\n tree = JSON.parse(JSON.stringify(tree)); //clone tree so that we can safely try applying operations\n apply.call(this, tree, sequence, true);\n } else {\n for (var i = 0; i < sequence.length; i++) {\n this.validator(sequence[i], i);\n }\n }\n } catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n } else {\n throw e;\n }\n }\n }\n jsonpatch.validate = validate;\n})(jsonpatch || (jsonpatch = {}));\nif (true) {\n exports.apply = jsonpatch.apply;\n exports.observe = jsonpatch.observe;\n exports.unobserve = jsonpatch.unobserve;\n exports.generate = jsonpatch.generate;\n exports.compare = jsonpatch.compare;\n exports.validate = jsonpatch.validate;\n exports.validator = jsonpatch.validator;\n exports.JsonPatchError = jsonpatch.JsonPatchError;\n exports.Error = jsonpatch.Error;\n}\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _object = __webpack_require__(2);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n */\nvar Border = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n function Border(wotInstance, settings) {\n _classCallCheck(this, Border);\n\n if (!settings) {\n return;\n }\n this.eventManager = new _eventManager2.default(wotInstance);\n this.instance = wotInstance;\n this.wot = wotInstance;\n this.settings = settings;\n this.mouseDown = false;\n this.main = null;\n\n this.top = null;\n this.left = null;\n this.bottom = null;\n this.right = null;\n\n this.topStyle = null;\n this.leftStyle = null;\n this.bottomStyle = null;\n this.rightStyle = null;\n\n this.cornerDefaultStyle = {\n width: '5px',\n height: '5px',\n borderWidth: '2px',\n borderStyle: 'solid',\n borderColor: '#FFF'\n };\n this.corner = null;\n this.cornerStyle = null;\n\n this.createBorders(settings);\n this.registerListeners();\n }\n\n /**\n * Register all necessary events\n */\n\n\n _createClass(Border, [{\n key: 'registerListeners',\n value: function registerListeners() {\n var _this2 = this;\n\n this.eventManager.addEventListener(document.body, 'mousedown', function () {\n return _this2.onMouseDown();\n });\n this.eventManager.addEventListener(document.body, 'mouseup', function () {\n return _this2.onMouseUp();\n });\n\n var _loop = function _loop(c, len) {\n _this2.eventManager.addEventListener(_this2.main.childNodes[c], 'mouseenter', function (event) {\n return _this2.onMouseEnter(event, _this2.main.childNodes[c]);\n });\n };\n\n for (var c = 0, len = this.main.childNodes.length; c < len; c++) {\n _loop(c, len);\n }\n }\n\n /**\n * Mouse down listener\n *\n * @private\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown() {\n this.mouseDown = true;\n }\n\n /**\n * Mouse up listener\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n this.mouseDown = false;\n }\n\n /**\n * Mouse enter listener for fragment selection functionality.\n *\n * @private\n * @param {Event} event Dom event\n * @param {HTMLElement} parentElement Part of border element.\n */\n\n }, {\n key: 'onMouseEnter',\n value: function onMouseEnter(event, parentElement) {\n if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {\n return;\n }\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n\n var _this = this;\n var bounds = parentElement.getBoundingClientRect();\n // Hide border to prevents selection jumping when fragmentSelection is enabled.\n parentElement.style.display = 'none';\n\n function isOutside(event) {\n if (event.clientY < Math.floor(bounds.top)) {\n return true;\n }\n if (event.clientY > Math.ceil(bounds.top + bounds.height)) {\n return true;\n }\n if (event.clientX < Math.floor(bounds.left)) {\n return true;\n }\n if (event.clientX > Math.ceil(bounds.left + bounds.width)) {\n return true;\n }\n }\n\n function handler(event) {\n if (isOutside(event)) {\n _this.eventManager.removeEventListener(document.body, 'mousemove', handler);\n parentElement.style.display = 'block';\n }\n }\n\n this.eventManager.addEventListener(document.body, 'mousemove', handler);\n }\n\n /**\n * Create border elements\n *\n * @param {Object} settings\n */\n\n }, {\n key: 'createBorders',\n value: function createBorders(settings) {\n this.main = document.createElement('div');\n\n var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];\n var style = this.main.style;\n style.position = 'absolute';\n style.top = 0;\n style.left = 0;\n\n for (var i = 0; i < 5; i++) {\n var position = borderDivs[i];\n var div = document.createElement('div');\n div.className = 'wtBorder ' + (this.settings.className || ''); // + borderDivs[i];\n\n if (this.settings[position] && this.settings[position].hide) {\n div.className += ' hidden';\n }\n style = div.style;\n style.backgroundColor = this.settings[position] && this.settings[position].color ? this.settings[position].color : settings.border.color;\n style.height = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';\n style.width = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';\n\n this.main.appendChild(div);\n }\n this.top = this.main.childNodes[0];\n this.left = this.main.childNodes[1];\n this.bottom = this.main.childNodes[2];\n this.right = this.main.childNodes[3];\n\n this.topStyle = this.top.style;\n this.leftStyle = this.left.style;\n this.bottomStyle = this.bottom.style;\n this.rightStyle = this.right.style;\n\n this.corner = this.main.childNodes[4];\n this.corner.className += ' corner';\n this.cornerStyle = this.corner.style;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n this.cornerStyle.height = this.cornerDefaultStyle.height;\n this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');\n\n if ((0, _browser.isMobileBrowser)()) {\n this.createMultipleSelectorHandles();\n }\n this.disappear();\n\n if (!this.wot.wtTable.bordersHolder) {\n this.wot.wtTable.bordersHolder = document.createElement('div');\n this.wot.wtTable.bordersHolder.className = 'htBorders';\n this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);\n }\n this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);\n }\n\n /**\n * Create multiple selector handler for mobile devices\n */\n\n }, {\n key: 'createMultipleSelectorHandles',\n value: function createMultipleSelectorHandles() {\n this.selectionHandles = {\n topLeft: document.createElement('DIV'),\n topLeftHitArea: document.createElement('DIV'),\n bottomRight: document.createElement('DIV'),\n bottomRightHitArea: document.createElement('DIV')\n };\n var width = 10;\n var hitAreaWidth = 40;\n\n this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';\n this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';\n this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';\n this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';\n\n this.selectionHandles.styles = {\n topLeft: this.selectionHandles.topLeft.style,\n topLeftHitArea: this.selectionHandles.topLeftHitArea.style,\n bottomRight: this.selectionHandles.bottomRight.style,\n bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style\n };\n\n var hitAreaStyle = {\n position: 'absolute',\n height: hitAreaWidth + 'px',\n width: hitAreaWidth + 'px',\n 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px'\n };\n\n for (var prop in hitAreaStyle) {\n if ((0, _object.hasOwnProperty)(hitAreaStyle, prop)) {\n this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];\n this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];\n }\n }\n\n var handleStyle = {\n position: 'absolute',\n height: width + 'px',\n width: width + 'px',\n 'border-radius': parseInt(width / 1.5, 10) + 'px',\n background: '#F5F5FF',\n border: '1px solid #4285c8'\n };\n\n for (var _prop in handleStyle) {\n if ((0, _object.hasOwnProperty)(handleStyle, _prop)) {\n this.selectionHandles.styles.bottomRight[_prop] = handleStyle[_prop];\n this.selectionHandles.styles.topLeft[_prop] = handleStyle[_prop];\n }\n }\n this.main.appendChild(this.selectionHandles.topLeft);\n this.main.appendChild(this.selectionHandles.bottomRight);\n this.main.appendChild(this.selectionHandles.topLeftHitArea);\n this.main.appendChild(this.selectionHandles.bottomRightHitArea);\n }\n }, {\n key: 'isPartRange',\n value: function isPartRange(row, col) {\n if (this.wot.selections.area.cellRange) {\n if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) {\n return true;\n }\n }\n\n return false;\n }\n }, {\n key: 'updateMultipleSelectionHandlesPosition',\n value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {\n var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);\n var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);\n\n this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px';\n this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px';\n\n this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - hitAreaWidth / 4 * 3, 10) + 'px';\n this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - hitAreaWidth / 4 * 3, 10) + 'px';\n\n this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px';\n this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px';\n\n this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px';\n this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px';\n\n if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) {\n this.selectionHandles.styles.topLeft.display = 'block';\n this.selectionHandles.styles.topLeftHitArea.display = 'block';\n\n if (this.isPartRange(row, col)) {\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n } else {\n this.selectionHandles.styles.bottomRight.display = 'block';\n this.selectionHandles.styles.bottomRightHitArea.display = 'block';\n }\n } else {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.topLeftHitArea.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n }\n\n if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {\n this.selectionHandles.styles.topLeft.zIndex = '9999';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';\n } else {\n this.selectionHandles.styles.topLeft.zIndex = '';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '';\n }\n }\n\n /**\n * Show border around one or many cells\n *\n * @param {Array} corners\n */\n\n }, {\n key: 'appear',\n value: function appear(corners) {\n if (this.disabled) {\n return;\n }\n var isMultiple, fromTD, toTD, fromOffset, toOffset, containerOffset, top, minTop, left, minLeft, height, width, fromRow, fromColumn, toRow, toColumn, trimmingContainer, cornerOverlappingContainer, ilen;\n\n ilen = this.wot.wtTable.getRenderedRowsCount();\n\n for (var i = 0; i < ilen; i++) {\n var s = this.wot.wtTable.rowFilter.renderedToSource(i);\n\n if (s >= corners[0] && s <= corners[2]) {\n fromRow = s;\n break;\n }\n }\n\n for (var _i = ilen - 1; _i >= 0; _i--) {\n var _s = this.wot.wtTable.rowFilter.renderedToSource(_i);\n\n if (_s >= corners[0] && _s <= corners[2]) {\n toRow = _s;\n break;\n }\n }\n\n ilen = this.wot.wtTable.getRenderedColumnsCount();\n\n for (var _i2 = 0; _i2 < ilen; _i2++) {\n var _s2 = this.wot.wtTable.columnFilter.renderedToSource(_i2);\n\n if (_s2 >= corners[1] && _s2 <= corners[3]) {\n fromColumn = _s2;\n break;\n }\n }\n\n for (var _i3 = ilen - 1; _i3 >= 0; _i3--) {\n var _s3 = this.wot.wtTable.columnFilter.renderedToSource(_i3);\n\n if (_s3 >= corners[1] && _s3 <= corners[3]) {\n toColumn = _s3;\n break;\n }\n }\n if (fromRow === void 0 || fromColumn === void 0) {\n this.disappear();\n\n return;\n }\n isMultiple = fromRow !== toRow || fromColumn !== toColumn;\n fromTD = this.wot.wtTable.getCell(new _coords2.default(fromRow, fromColumn));\n toTD = isMultiple ? this.wot.wtTable.getCell(new _coords2.default(toRow, toColumn)) : fromTD;\n fromOffset = (0, _element.offset)(fromTD);\n toOffset = isMultiple ? (0, _element.offset)(toTD) : fromOffset;\n containerOffset = (0, _element.offset)(this.wot.wtTable.TABLE);\n\n minTop = fromOffset.top;\n height = toOffset.top + (0, _element.outerHeight)(toTD) - minTop;\n minLeft = fromOffset.left;\n width = toOffset.left + (0, _element.outerWidth)(toTD) - minLeft;\n\n top = minTop - containerOffset.top - 1;\n left = minLeft - containerOffset.left - 1;\n var style = (0, _element.getComputedStyle)(fromTD);\n\n if (parseInt(style.borderTopWidth, 10) > 0) {\n top += 1;\n height = height > 0 ? height - 1 : 0;\n }\n if (parseInt(style.borderLeftWidth, 10) > 0) {\n left += 1;\n width = width > 0 ? width - 1 : 0;\n }\n\n this.topStyle.top = top + 'px';\n this.topStyle.left = left + 'px';\n this.topStyle.width = width + 'px';\n this.topStyle.display = 'block';\n\n this.leftStyle.top = top + 'px';\n this.leftStyle.left = left + 'px';\n this.leftStyle.height = height + 'px';\n this.leftStyle.display = 'block';\n\n var delta = Math.floor(this.settings.border.width / 2);\n\n this.bottomStyle.top = top + height - delta + 'px';\n this.bottomStyle.left = left + 'px';\n this.bottomStyle.width = width + 'px';\n this.bottomStyle.display = 'block';\n\n this.rightStyle.top = top + 'px';\n this.rightStyle.left = left + width - delta + 'px';\n this.rightStyle.height = height + 1 + 'px';\n this.rightStyle.display = 'block';\n\n if ((0, _browser.isMobileBrowser)() || !this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn)) {\n this.cornerStyle.display = 'none';\n } else {\n this.cornerStyle.top = top + height - 4 + 'px';\n this.cornerStyle.left = left + width - 4 + 'px';\n this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n\n // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.\n this.cornerStyle.display = 'none';\n\n trimmingContainer = (0, _element.getTrimmingContainer)(this.wot.wtTable.TABLE);\n\n if (toColumn === this.wot.getSetting('totalColumns') - 1) {\n cornerOverlappingContainer = toTD.offsetLeft + (0, _element.outerWidth)(toTD) + parseInt(this.cornerDefaultStyle.width, 10) / 2 >= (0, _element.innerWidth)(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width, 10) / 2) + 'px';\n this.cornerStyle.borderRightWidth = 0;\n }\n }\n\n if (toRow === this.wot.getSetting('totalRows') - 1) {\n cornerOverlappingContainer = toTD.offsetTop + (0, _element.outerHeight)(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2 >= (0, _element.innerHeight)(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height, 10) / 2) + 'px';\n this.cornerStyle.borderBottomWidth = 0;\n }\n }\n\n this.cornerStyle.display = 'block';\n }\n\n if ((0, _browser.isMobileBrowser)()) {\n this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height);\n }\n }\n\n /**\n * Hide border\n */\n\n }, {\n key: 'disappear',\n value: function disappear() {\n this.topStyle.display = 'none';\n this.leftStyle.display = 'none';\n this.bottomStyle.display = 'none';\n this.rightStyle.display = 'none';\n this.cornerStyle.display = 'none';\n\n if ((0, _browser.isMobileBrowser)()) {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n }\n }\n\n /**\n * @param {Function} setting\n * @returns {*}\n */\n\n }, {\n key: 'hasSetting',\n value: function hasSetting(setting) {\n if (typeof setting === 'function') {\n return setting();\n }\n\n return !!setting;\n }\n }]);\n\n return Border;\n}();\n\nexports.default = Border;\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\n\n/**\n * Calculates indexes of columns to render OR columns that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportColumnsCalculator\n */\n\nvar ViewportColumnsCalculator = function () {\n _createClass(ViewportColumnsCalculator, null, [{\n key: 'DEFAULT_WIDTH',\n\n /**\n * Default column width\n *\n * @type {Number}\n */\n get: function get() {\n return 50;\n }\n\n /**\n * @param {Number} viewportWidth Width of the viewport\n * @param {Number} scrollOffset Current horizontal scroll position of the viewport\n * @param {Number} totalColumns Total number of rows\n * @param {Function} columnWidthFn Function that returns the width of the column at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Boolean} stretchH\n * @param {Function} [stretchingColumnWidthFn] Function that returns the new width of the stretched column.\n */\n\n }]);\n\n function ViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) {\n var stretchingColumnWidthFn = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function (width) {\n return width;\n };\n\n _classCallCheck(this, ViewportColumnsCalculator);\n\n privatePool.set(this, {\n viewportWidth: viewportWidth,\n scrollOffset: scrollOffset,\n totalColumns: totalColumns,\n columnWidthFn: columnWidthFn,\n overrideFn: overrideFn,\n onlyFullyVisible: onlyFullyVisible,\n stretchingColumnWidthFn: stretchingColumnWidthFn\n });\n\n /**\n * Number of rendered/visible columns\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startColumn = null;\n\n /**\n * Index of the last rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endColumn = null;\n\n /**\n * Position of the first rendered/visible column (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.stretchAllRatio = 0;\n this.stretchLastWidth = 0;\n this.stretch = stretchH;\n this.totalTargetWidth = 0;\n this.needVerifyLastColumnWidth = true;\n this.stretchAllColumnsWidth = [];\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n\n\n _createClass(ViewportColumnsCalculator, [{\n key: 'calculate',\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n var columnWidth = void 0;\n\n var priv = privatePool.get(this);\n var onlyFullyVisible = priv.onlyFullyVisible;\n var overrideFn = priv.overrideFn;\n var scrollOffset = priv.scrollOffset;\n var totalColumns = priv.totalColumns;\n var viewportWidth = priv.viewportWidth;\n\n for (var i = 0; i < totalColumns; i++) {\n columnWidth = this._getColumnWidth(i);\n\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startColumn = i;\n }\n\n // +1 pixel for row header width compensation for horizontal scroll > 0\n var compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;\n\n if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + compensatedViewportWidth) {\n if (this.startColumn == null) {\n this.startColumn = i;\n }\n this.endColumn = i;\n }\n startPositions.push(sum);\n sum += columnWidth;\n\n if (!onlyFullyVisible) {\n this.endColumn = i;\n }\n if (sum >= scrollOffset + viewportWidth) {\n needReverse = false;\n break;\n }\n }\n\n if (this.endColumn === totalColumns - 1 && needReverse) {\n this.startColumn = this.endColumn;\n\n while (this.startColumn > 0) {\n var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];\n\n if (viewportSum <= viewportWidth || !onlyFullyVisible) {\n this.startColumn--;\n }\n if (viewportSum > viewportWidth) {\n break;\n }\n }\n }\n\n if (this.startColumn !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startColumn];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startColumn !== null) {\n this.count = this.endColumn - this.startColumn + 1;\n }\n }\n\n /**\n * Recalculate columns stretching.\n *\n * @param {Number} totalWidth\n */\n\n }, {\n key: 'refreshStretching',\n value: function refreshStretching(totalWidth) {\n if (this.stretch === 'none') {\n return;\n }\n this.totalTargetWidth = totalWidth;\n\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n var sumAll = 0;\n\n for (var i = 0; i < totalColumns; i++) {\n var columnWidth = this._getColumnWidth(i);\n var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);\n\n if (typeof permanentColumnWidth === 'number') {\n totalWidth -= permanentColumnWidth;\n } else {\n sumAll += columnWidth;\n }\n }\n var remainingSize = totalWidth - sumAll;\n\n if (this.stretch === 'all' && remainingSize > 0) {\n this.stretchAllRatio = totalWidth / sumAll;\n this.stretchAllColumnsWidth = [];\n this.needVerifyLastColumnWidth = true;\n } else if (this.stretch === 'last' && totalWidth !== Infinity) {\n var _columnWidth = this._getColumnWidth(totalColumns - 1);\n var lastColumnWidth = remainingSize + _columnWidth;\n\n this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : _columnWidth;\n }\n }\n\n /**\n * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.\n *\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number|null}\n */\n\n }, {\n key: 'getStretchedColumnWidth',\n value: function getStretchedColumnWidth(column, baseWidth) {\n var result = null;\n\n if (this.stretch === 'all' && this.stretchAllRatio !== 0) {\n result = this._getStretchedAllColumnWidth(column, baseWidth);\n } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {\n result = this._getStretchedLastColumnWidth(column);\n }\n\n return result;\n }\n\n /**\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number}\n * @private\n */\n\n }, {\n key: '_getStretchedAllColumnWidth',\n value: function _getStretchedAllColumnWidth(column, baseWidth) {\n var sumRatioWidth = 0;\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (!this.stretchAllColumnsWidth[column]) {\n var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);\n var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);\n\n if (newStretchedWidth === void 0) {\n this.stretchAllColumnsWidth[column] = stretchedWidth;\n } else {\n this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;\n }\n }\n\n if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {\n this.needVerifyLastColumnWidth = false;\n\n for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {\n sumRatioWidth += this.stretchAllColumnsWidth[i];\n }\n if (sumRatioWidth !== this.totalTargetWidth) {\n this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;\n }\n }\n\n return this.stretchAllColumnsWidth[column];\n }\n\n /**\n * @param {Number} column\n * @returns {Number|null}\n * @private\n */\n\n }, {\n key: '_getStretchedLastColumnWidth',\n value: function _getStretchedLastColumnWidth(column) {\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (column === totalColumns - 1) {\n return this.stretchLastWidth;\n }\n\n return null;\n }\n\n /**\n * @param {Number} column Column index.\n * @returns {Number}\n * @private\n */\n\n }, {\n key: '_getColumnWidth',\n value: function _getColumnWidth(column) {\n var width = privatePool.get(this).columnWidthFn(column);\n\n if (width === void 0) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n }\n }]);\n\n return ViewportColumnsCalculator;\n}();\n\nexports.default = ViewportColumnsCalculator;\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar privatePool = new WeakMap();\n\n/**\n * Calculates indexes of rows to render OR rows that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportRowsCalculator\n */\n\nvar ViewportRowsCalculator = function () {\n _createClass(ViewportRowsCalculator, null, [{\n key: \"DEFAULT_HEIGHT\",\n\n /**\n * Default row height\n *\n * @type {Number}\n */\n get: function get() {\n return 23;\n }\n\n /**\n * @param {Number} viewportHeight Height of the viewport\n * @param {Number} scrollOffset Current vertical scroll position of the viewport\n * @param {Number} totalRows Total number of rows\n * @param {Function} rowHeightFn Function that returns the height of the row at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Number} horizontalScrollbarHeight\n */\n\n }]);\n\n function ViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {\n _classCallCheck(this, ViewportRowsCalculator);\n\n privatePool.set(this, {\n viewportHeight: viewportHeight,\n scrollOffset: scrollOffset,\n totalRows: totalRows,\n rowHeightFn: rowHeightFn,\n overrideFn: overrideFn,\n onlyFullyVisible: onlyFullyVisible,\n horizontalScrollbarHeight: horizontalScrollbarHeight\n });\n\n /**\n * Number of rendered/visible rows\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startRow = null;\n\n /**\n * Index of the last rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endRow = null;\n\n /**\n * Position of the first rendered/visible row (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n\n\n _createClass(ViewportRowsCalculator, [{\n key: \"calculate\",\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n\n var priv = privatePool.get(this);\n var onlyFullyVisible = priv.onlyFullyVisible;\n var overrideFn = priv.overrideFn;\n var rowHeightFn = priv.rowHeightFn;\n var scrollOffset = priv.scrollOffset;\n var totalRows = priv.totalRows;\n var viewportHeight = priv.viewportHeight;\n var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;\n var rowHeight = void 0;\n\n // Calculate the number (start and end index) of rows needed\n for (var i = 0; i < totalRows; i++) {\n rowHeight = rowHeightFn(i);\n\n if (rowHeight === undefined) {\n rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;\n }\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startRow = i;\n }\n\n // the row is within the \"visible range\"\n if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n if (this.startRow === null) {\n this.startRow = i;\n }\n this.endRow = i;\n }\n startPositions.push(sum);\n sum += rowHeight;\n\n if (!onlyFullyVisible) {\n this.endRow = i;\n }\n if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n needReverse = false;\n break;\n }\n }\n\n // If the estimation has reached the last row and there is still some space available in the viewport,\n // we need to render in reverse in order to fill the whole viewport with rows\n if (this.endRow === totalRows - 1 && needReverse) {\n this.startRow = this.endRow;\n\n while (this.startRow > 0) {\n // rowHeight is the height of the last row\n var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];\n\n if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {\n this.startRow--;\n }\n if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {\n break;\n }\n }\n }\n\n if (this.startRow !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startRow];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startRow !== null) {\n this.count = this.endRow - this.startRow + 1;\n }\n }\n }]);\n\n return ViewportRowsCalculator;\n}();\n\nexports.default = ViewportRowsCalculator;\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _string = __webpack_require__(27);\n\nvar _event = __webpack_require__(138);\n\nvar _event2 = _interopRequireDefault(_event);\n\nvar _overlays = __webpack_require__(141);\n\nvar _overlays2 = _interopRequireDefault(_overlays);\n\nvar _scroll = __webpack_require__(142);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _settings = __webpack_require__(143);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _table = __webpack_require__(144);\n\nvar _table2 = _interopRequireDefault(_table);\n\nvar _viewport = __webpack_require__(146);\n\nvar _viewport2 = _interopRequireDefault(_viewport);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Walkontable\n */\nvar Walkontable = function () {\n /**\n * @param {Object} settings\n */\n function Walkontable(settings) {\n _classCallCheck(this, Walkontable);\n\n var originalHeaders = [];\n\n // this is the namespace for global events\n this.guid = 'wt_' + (0, _string.randomString)();\n\n // bootstrap from settings\n if (settings.cloneSource) {\n this.cloneSource = settings.cloneSource;\n this.cloneOverlay = settings.cloneOverlay;\n this.wtSettings = settings.cloneSource.wtSettings;\n this.wtTable = new _table2.default(this, settings.table, settings.wtRootElement);\n this.wtScroll = new _scroll2.default(this);\n this.wtViewport = settings.cloneSource.wtViewport;\n this.wtEvent = new _event2.default(this);\n this.selections = this.cloneSource.selections;\n } else {\n this.wtSettings = new _settings2.default(this, settings);\n this.wtTable = new _table2.default(this, settings.table);\n this.wtScroll = new _scroll2.default(this);\n this.wtViewport = new _viewport2.default(this);\n this.wtEvent = new _event2.default(this);\n this.selections = this.getSetting('selections');\n this.wtOverlays = new _overlays2.default(this);\n this.exportSettingsAsClassNames();\n }\n\n // find original headers\n if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {\n for (var c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {\n originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);\n }\n if (!this.getSetting('columnHeaders').length) {\n this.update('columnHeaders', [function (column, TH) {\n (0, _element.fastInnerText)(TH, originalHeaders[column]);\n }]);\n }\n }\n this.drawn = false;\n this.drawInterrupted = false;\n }\n\n /**\n * Force rerender of Walkontable\n *\n * @param {Boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway\n * @returns {Walkontable}\n */\n\n\n _createClass(Walkontable, [{\n key: 'draw',\n value: function draw() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.drawInterrupted = false;\n\n if (!fastDraw && !(0, _element.isVisible)(this.wtTable.TABLE)) {\n // draw interrupted because TABLE is not visible\n this.drawInterrupted = true;\n } else {\n this.wtTable.draw(fastDraw);\n }\n\n return this;\n }\n\n /**\n * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,\n * if not set or set to false, returns TD from the master table.\n *\n * @param {CellCoords} coords\n * @param {Boolean} [topmost=false]\n * @returns {Object}\n */\n\n }, {\n key: 'getCell',\n value: function getCell(coords) {\n var topmost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!topmost) {\n return this.wtTable.getCell(coords);\n }\n\n var totalRows = this.wtSettings.getSetting('totalRows');\n var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');\n var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');\n var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');\n\n if (coords.row < fixedRowsTop && coords.col < fixedColumns) {\n return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < fixedRowsTop) {\n return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);\n } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {\n return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);\n }\n } else if (coords.col < fixedColumns) {\n return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {\n return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);\n }\n }\n\n return this.wtTable.getCell(coords);\n }\n\n /**\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n\n }, {\n key: 'update',\n value: function update(settings, value) {\n return this.wtSettings.update(settings, value);\n }\n\n /**\n * Scroll the viewport to a row at the given index in the data source\n *\n * @param {Number} row\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollVertical',\n value: function scrollVertical(row) {\n this.wtOverlays.topOverlay.scrollTo(row);\n this.getSetting('onScrollVertically');\n\n return this;\n }\n\n /**\n * Scroll the viewport to a column at the given index in the data source\n *\n * @param {Number} column\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollHorizontal',\n value: function scrollHorizontal(column) {\n this.wtOverlays.leftOverlay.scrollTo(column);\n this.getSetting('onScrollHorizontally');\n\n return this;\n }\n\n /**\n * Scrolls the viewport to a cell (rerenders if needed)\n *\n * @param {CellCoords} coords\n * @returns {Walkontable}\n */\n\n }, {\n key: 'scrollViewport',\n value: function scrollViewport(coords) {\n this.wtScroll.scrollViewport(coords);\n\n return this;\n }\n\n /**\n * @returns {Array}\n */\n\n }, {\n key: 'getViewport',\n value: function getViewport() {\n return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];\n }\n\n /**\n * Get overlay name\n *\n * @returns {String}\n */\n\n }, {\n key: 'getOverlayName',\n value: function getOverlayName() {\n return this.cloneOverlay ? this.cloneOverlay.type : 'master';\n }\n\n /**\n * Check overlay type of this Walkontable instance.\n *\n * @param {String} name Clone type @see {Overlay.CLONE_TYPES}.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isOverlayName',\n value: function isOverlayName(name) {\n if (this.cloneOverlay) {\n return this.cloneOverlay.type === name;\n }\n\n return false;\n }\n\n /**\n * Export settings as class names added to the parent element of the table.\n */\n\n }, {\n key: 'exportSettingsAsClassNames',\n value: function exportSettingsAsClassNames() {\n var _this = this;\n\n var toExport = {\n rowHeaders: ['array'],\n columnHeaders: ['array']\n };\n var allClassNames = [];\n var newClassNames = [];\n\n (0, _object.objectEach)(toExport, function (optionType, key) {\n if (optionType.indexOf('array') > -1 && _this.getSetting(key).length) {\n newClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));\n }\n allClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));\n });\n (0, _element.removeClass)(this.wtTable.wtRootElement.parentNode, allClassNames);\n (0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);\n }\n\n /**\n * Get/Set Walkontable instance setting\n *\n * @param {String} key\n * @param {*} [param1]\n * @param {*} [param2]\n * @param {*} [param3]\n * @param {*} [param4]\n * @returns {*}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(key, param1, param2, param3, param4) {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.wtSettings.getSetting(key, param1, param2, param3, param4);\n }\n\n /**\n * Checks if setting exists\n *\n * @param {String} key\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasSetting',\n value: function hasSetting(key) {\n return this.wtSettings.has(key);\n }\n\n /**\n * Destroy instance\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.wtOverlays.destroy();\n this.wtEvent.destroy();\n }\n }]);\n\n return Walkontable;\n}();\n\nexports.default = Walkontable;\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _function = __webpack_require__(35);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n *\n */\nfunction Event(instance) {\n var that = this;\n var eventManager = new _eventManager2.default(instance);\n\n this.instance = instance;\n\n var dblClickOrigin = [null, null];\n this.dblClickTimeout = [null, null];\n\n var onMouseDown = function onMouseDown(event) {\n var activeElement = document.activeElement;\n var getParentNode = (0, _function.partial)(_element.getParent, event.realTarget);\n var realTarget = event.realTarget;\n\n // ignore focusable element from mouse down processing (https://github.com/handsontable/handsontable/issues/3555)\n if (realTarget === activeElement || getParentNode(0) === activeElement || getParentNode(1) === activeElement) {\n return;\n }\n\n var cell = that.parentCell(realTarget);\n\n if ((0, _element.hasClass)(realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerMouseDown', event, realTarget);\n } else if (cell.TD) {\n if (that.instance.hasSetting('onCellMouseDown')) {\n that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);\n }\n }\n\n if (event.button !== 2) {\n // if not right mouse button\n if (cell.TD) {\n dblClickOrigin[0] = cell.TD;\n clearTimeout(that.dblClickTimeout[0]);\n that.dblClickTimeout[0] = setTimeout(function () {\n dblClickOrigin[0] = null;\n }, 1000);\n }\n }\n };\n\n var onTouchMove = function onTouchMove(event) {\n that.instance.touchMoving = true;\n };\n\n var longTouchTimeout;\n\n var onTouchStart = function onTouchStart(event) {\n var container = this;\n\n eventManager.addEventListener(this, 'touchmove', onTouchMove);\n\n // Prevent cell selection when scrolling with touch event - not the best solution performance-wise\n that.checkIfTouchMove = setTimeout(function () {\n if (that.instance.touchMoving === true) {\n that.instance.touchMoving = void 0;\n\n eventManager.removeEventListener('touchmove', onTouchMove, false);\n }\n\n onMouseDown(event);\n }, 30);\n };\n\n var onMouseOver = function onMouseOver(event) {\n var table, td, mainWOT;\n\n if (that.instance.hasSetting('onCellMouseOver')) {\n table = that.instance.wtTable.TABLE;\n td = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);\n mainWOT = that.instance.cloneSource || that.instance;\n\n if (td && td !== mainWOT.lastMouseOver && (0, _element.isChildOf)(td, table)) {\n mainWOT.lastMouseOver = td;\n\n that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);\n }\n }\n };\n\n var onMouseOut = function onMouseOut(event) {\n var table = void 0;\n var lastTD = void 0;\n var nextTD = void 0;\n\n if (that.instance.hasSetting('onCellMouseOut')) {\n table = that.instance.wtTable.TABLE;\n lastTD = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);\n nextTD = (0, _element.closestDown)(event.relatedTarget, ['TD', 'TH'], table);\n\n if (lastTD && lastTD !== nextTD && (0, _element.isChildOf)(lastTD, table)) {\n that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(lastTD), lastTD, that.instance);\n }\n }\n };\n\n var onMouseUp = function onMouseUp(event) {\n if (event.button !== 2) {\n // if not right mouse button\n var cell = that.parentCell(event.realTarget);\n\n if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {\n if ((0, _element.hasClass)(event.realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);\n } else {\n that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);\n }\n\n dblClickOrigin[0] = null;\n dblClickOrigin[1] = null;\n } else if (cell.TD === dblClickOrigin[0]) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n\n dblClickOrigin[1] = cell.TD;\n clearTimeout(that.dblClickTimeout[1]);\n that.dblClickTimeout[1] = setTimeout(function () {\n dblClickOrigin[1] = null;\n }, 500);\n } else if (cell.TD && that.instance.hasSetting('onCellMouseUp')) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n }\n }\n };\n\n var onTouchEnd = function onTouchEnd(event) {\n clearTimeout(longTouchTimeout);\n // that.instance.longTouch == void 0;\n\n event.preventDefault();\n onMouseUp(event);\n\n // eventManager.removeEventListener(that.instance.wtTable.holder, \"mouseup\", onMouseUp);\n };\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseout', onMouseOut);\n eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);\n\n // check if full HOT instance, or detached WOT AND run on mobile device\n if (this.instance.wtTable.holder.parentNode.parentNode && (0, _browser.isMobileBrowser)() && !that.instance.wtTable.isWorkingOnClone()) {\n var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.');\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function (event) {\n that.instance.touchApplied = true;\n if ((0, _element.isChildOf)(event.target, classSelector)) {\n onTouchStart.call(event.target, event);\n }\n });\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function (event) {\n that.instance.touchApplied = false;\n if ((0, _element.isChildOf)(event.target, classSelector)) {\n onTouchEnd.call(event.target, event);\n }\n });\n\n if (!that.instance.momentumScrolling) {\n that.instance.momentumScrolling = {};\n }\n eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function (event) {\n clearTimeout(that.instance.momentumScrolling._timeout);\n\n if (!that.instance.momentumScrolling.ongoing) {\n that.instance.getSetting('onBeforeTouchScroll');\n }\n that.instance.momentumScrolling.ongoing = true;\n\n that.instance.momentumScrolling._timeout = setTimeout(function () {\n if (!that.instance.touchApplied) {\n that.instance.momentumScrolling.ongoing = false;\n\n that.instance.getSetting('onAfterMomentumScroll');\n }\n }, 200);\n });\n }\n\n eventManager.addEventListener(window, 'resize', function () {\n if (that.instance.getSetting('stretchH') !== 'none') {\n that.instance.draw();\n }\n });\n\n this.destroy = function () {\n clearTimeout(this.dblClickTimeout[0]);\n clearTimeout(this.dblClickTimeout[1]);\n\n eventManager.destroy();\n };\n}\n\nEvent.prototype.parentCell = function (elem) {\n var cell = {};\n var TABLE = this.instance.wtTable.TABLE;\n var TD = (0, _element.closestDown)(elem, ['TD', 'TH'], TABLE);\n\n if (TD) {\n cell.coords = this.instance.wtTable.getCoords(TD);\n cell.TD = TD;\n } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'current')) {\n cell.coords = this.instance.selections.current.cellRange.highlight; // selections.current is current selected cell\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'area')) {\n if (this.instance.selections.area.cellRange) {\n cell.coords = this.instance.selections.area.cellRange.to; // selections.area is area selected cells\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n }\n }\n\n return cell;\n};\n\nexports.default = Event;\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class ColumnFilter\n */\nvar ColumnFilter = function () {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n function ColumnFilter(offset, total, countTH) {\n _classCallCheck(this, ColumnFilter);\n\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n\n _createClass(ColumnFilter, [{\n key: \"offsetted\",\n value: function offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsetted\",\n value: function unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"renderedToSource\",\n value: function renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceToRendered\",\n value: function sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"offsettedTH\",\n value: function offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsettedTH\",\n value: function unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"visibleRowHeadedColumnToSourceColumn\",\n value: function visibleRowHeadedColumnToSourceColumn(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceColumnToVisibleRowHeadedColumn\",\n value: function sourceColumnToVisibleRowHeadedColumn(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n }]);\n\n return ColumnFilter;\n}();\n\nexports.default = ColumnFilter;\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RowFilter\n */\nvar RowFilter = function () {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n function RowFilter(offset, total, countTH) {\n _classCallCheck(this, RowFilter);\n\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n\n _createClass(RowFilter, [{\n key: \"offsetted\",\n value: function offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsetted\",\n value: function unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"renderedToSource\",\n value: function renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceToRendered\",\n value: function sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"offsettedTH\",\n value: function offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"unOffsettedTH\",\n value: function unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"visibleColHeadedRowToSourceRow\",\n value: function visibleColHeadedRowToSourceRow(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n\n }, {\n key: \"sourceRowToVisibleColHeadedRow\",\n value: function sourceRowToVisibleColHeadedRow(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n }]);\n\n return RowFilter;\n}();\n\nexports.default = RowFilter;\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _unicode = __webpack_require__(16);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Overlays\n */\nvar Overlays = function () {\n /**\n * @param {Walkontable} wotInstance\n */\n function Overlays(wotInstance) {\n _classCallCheck(this, Overlays);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.eventManager = new _eventManager2.default(this.wot);\n\n this.wot.update('scrollbarWidth', (0, _element.getScrollbarWidth)());\n this.wot.update('scrollbarHeight', (0, _element.getScrollbarWidth)());\n\n this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n\n this.prepareOverlays();\n\n this.destroyed = false;\n this.keyPressed = false;\n this.spreaderLastSize = {\n width: null,\n height: null\n };\n this.overlayScrollPositions = {\n master: {\n top: 0,\n left: 0\n },\n top: {\n top: null,\n left: 0\n },\n bottom: {\n top: null,\n left: 0\n },\n left: {\n top: 0,\n left: null\n }\n };\n\n this.pendingScrollCallbacks = {\n master: {\n top: 0,\n left: 0\n },\n top: {\n left: 0\n },\n bottom: {\n left: 0\n },\n left: {\n top: 0\n }\n };\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n this.delegatedScrollCallback = false;\n\n this.registeredListeners = [];\n\n this.registerListeners();\n }\n\n /**\n * Prepare overlays based on user settings.\n *\n * @returns {Boolean} Returns `true` if changes applied to overlay needs scroll synchronization.\n */\n\n\n _createClass(Overlays, [{\n key: 'prepareOverlays',\n value: function prepareOverlays() {\n var syncScroll = false;\n\n if (this.topOverlay) {\n syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP, this.wot);\n }\n\n if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM)) {\n this.bottomOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n this.bottomLeftCornerOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n\n if (this.bottomOverlay) {\n syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM, this.wot);\n }\n\n if (this.leftOverlay) {\n syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.leftOverlay = _base2.default.createOverlay(_base2.default.CLONE_LEFT, this.wot);\n }\n\n if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.topLeftCornerOverlay) {\n syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.bottomLeftCornerOverlay) {\n syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.wot.getSetting('debug') && !this.debug) {\n this.debug = _base2.default.createOverlay(_base2.default.CLONE_DEBUG, this.wot);\n }\n\n return syncScroll;\n }\n\n /**\n * Refresh and redraw table\n */\n\n }, {\n key: 'refreshAll',\n value: function refreshAll() {\n if (!this.wot.drawn) {\n return;\n }\n if (!this.wot.wtTable.holder.parentNode) {\n // Walkontable was detached from DOM, but this handler was not removed\n this.destroy();\n\n return;\n }\n this.wot.draw(true);\n\n if (this.verticalScrolling) {\n this.leftOverlay.onScroll();\n }\n\n if (this.horizontalScrolling) {\n this.topOverlay.onScroll();\n }\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n }\n\n /**\n * Register all necessary event listeners.\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this = this;\n\n var topOverlayScrollable = this.topOverlay.mainTableScrollableElement;\n var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;\n\n var listenersToRegister = [];\n listenersToRegister.push([document.documentElement, 'keydown', function (event) {\n return _this.onKeyDown(event);\n }]);\n listenersToRegister.push([document.documentElement, 'keyup', function () {\n return _this.onKeyUp();\n }]);\n listenersToRegister.push([document, 'visibilitychange', function () {\n return _this.onKeyUp();\n }]);\n listenersToRegister.push([topOverlayScrollable, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n\n if (topOverlayScrollable !== leftOverlayScrollable) {\n listenersToRegister.push([leftOverlayScrollable, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topOverlay.needFullRender) {\n listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.bottomOverlay.needFullRender) {\n listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.leftOverlay.needFullRender) {\n listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }]);\n listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.topLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.bottomLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {\n return _this.onTableScroll(event);\n }]);\n }\n\n if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {\n // This is necessary?\n // eventManager.addEventListener(window, 'scroll', (event) => this.refreshAll(event));\n listenersToRegister.push([window, 'wheel', function (event) {\n var overlay = void 0;\n var deltaY = event.wheelDeltaY || event.deltaY;\n var deltaX = event.wheelDeltaX || event.deltaX;\n\n if (_this.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'top';\n } else if (_this.bottomOverlay.clone && _this.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottom';\n } else if (_this.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'left';\n } else if (_this.topLeftCornerOverlay && _this.topLeftCornerOverlay.clone && _this.topLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'topLeft';\n } else if (_this.bottomLeftCornerOverlay && _this.bottomLeftCornerOverlay.clone && _this.bottomLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottomLeft';\n }\n\n if (overlay == 'top' && deltaY !== 0 || overlay == 'left' && deltaX !== 0 || overlay == 'bottom' && deltaY !== 0 || (overlay === 'topLeft' || overlay === 'bottomLeft') && (deltaY !== 0 || deltaX !== 0)) {\n\n event.preventDefault();\n }\n }]);\n }\n\n while (listenersToRegister.length) {\n var listener = listenersToRegister.pop();\n this.eventManager.addEventListener(listener[0], listener[1], listener[2]);\n\n this.registeredListeners.push(listener);\n }\n }\n\n /**\n * Deregister all previously registered listeners.\n */\n\n }, {\n key: 'deregisterListeners',\n value: function deregisterListeners() {\n while (this.registeredListeners.length) {\n var listener = this.registeredListeners.pop();\n this.eventManager.removeEventListener(listener[0], listener[1], listener[2]);\n }\n }\n\n /**\n * Scroll listener\n *\n * @param {Event} event\n */\n\n }, {\n key: 'onTableScroll',\n value: function onTableScroll(event) {\n // if mobile browser, do not update scroll positions, as the overlays are hidden during the scroll\n if ((0, _browser.isMobileBrowser)()) {\n return;\n }\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target;\n\n // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n if (this.keyPressed) {\n if (masterVertical !== window && target !== window && !event.target.contains(masterVertical) || masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal)) {\n return;\n }\n }\n\n if (event.type === 'scroll') {\n this.syncScrollPositions(event);\n } else {\n this.translateMouseWheelToScroll(event);\n }\n }\n\n /**\n * Key down listener\n */\n\n }, {\n key: 'onKeyDown',\n value: function onKeyDown(event) {\n this.keyPressed = (0, _unicode.isKey)(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');\n }\n\n /**\n * Key up listener\n */\n\n }, {\n key: 'onKeyUp',\n value: function onKeyUp() {\n this.keyPressed = false;\n }\n\n /**\n * Translate wheel event into scroll event and sync scroll overlays position\n *\n * @private\n * @param {Event} event\n * @returns {Boolean}\n */\n\n }, {\n key: 'translateMouseWheelToScroll',\n value: function translateMouseWheelToScroll(event) {\n var topOverlay = this.topOverlay.clone.wtTable.holder;\n var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null;\n var leftOverlay = this.leftOverlay.clone.wtTable.holder;\n var topLeftCornerOverlay = this.topLeftCornerOverlay && this.topLeftCornerOverlay.clone ? this.topLeftCornerOverlay.clone.wtTable.holder : null;\n var bottomLeftCornerOverlay = this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone ? this.bottomLeftCornerOverlay.clone.wtTable.holder : null;\n var mouseWheelSpeedRatio = -0.2;\n var deltaY = event.wheelDeltaY || -1 * event.deltaY;\n var deltaX = event.wheelDeltaX || -1 * event.deltaX;\n var parentHolder = null;\n var eventMockup = { type: 'wheel' };\n var tempElem = event.target;\n var delta = null;\n\n // Fix for extremely slow header scrolling with a mousewheel on Firefox\n if (event.deltaMode === 1) {\n deltaY *= 120;\n deltaX *= 120;\n }\n\n while (tempElem != document && tempElem != null) {\n if (tempElem.className.indexOf('wtHolder') > -1) {\n parentHolder = tempElem;\n break;\n }\n tempElem = tempElem.parentNode;\n }\n eventMockup.target = parentHolder;\n\n if (parentHolder === topLeftCornerOverlay || parentHolder === bottomLeftCornerOverlay) {\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaX, 'x');\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaY, 'y');\n } else {\n if (parentHolder === topOverlay || parentHolder === bottomOverlay) {\n delta = deltaY;\n } else if (parentHolder === leftOverlay) {\n delta = deltaX;\n }\n\n this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * delta);\n }\n\n return false;\n }\n\n /**\n * Synchronize scroll position between master table and overlay table.\n *\n * @private\n * @param {Event|Object} event\n * @param {Number} [fakeScrollValue=null]\n * @param {String} [fakeScrollDirection=null] `x` or `y`.\n */\n\n }, {\n key: 'syncScrollPositions',\n value: function syncScrollPositions(event) {\n var fakeScrollValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var fakeScrollDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (this.destroyed) {\n return;\n }\n if (arguments.length === 0) {\n this.syncScrollWithMaster();\n\n return;\n }\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target;\n var tempScrollValue = 0;\n var scrollValueChanged = false;\n var topOverlay = void 0;\n var leftOverlay = void 0;\n var topLeftCornerOverlay = void 0;\n var bottomLeftCornerOverlay = void 0;\n var bottomOverlay = void 0;\n var delegatedScroll = false;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.topOverlay.needFullRender) {\n topOverlay = this.topOverlay.clone.wtTable.holder;\n }\n\n if (this.bottomOverlay.needFullRender) {\n bottomOverlay = this.bottomOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender) {\n leftOverlay = this.leftOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender && this.topOverlay.needFullRender) {\n topLeftCornerOverlay = this.topLeftCornerOverlay.clone.wtTable.holder;\n }\n\n if (this.leftOverlay.needFullRender && this.bottomOverlay.needFullRender) {\n bottomLeftCornerOverlay = this.bottomLeftCornerOverlay.clone.wtTable.holder;\n }\n\n if (target === document) {\n target = window;\n }\n\n if (target === masterHorizontal || target === masterVertical) {\n if (preventOverflow) {\n tempScrollValue = (0, _element.getScrollLeft)(this.scrollableElement);\n } else {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n }\n\n // if scrolling the master table - populate the scroll values to both top and left overlays\n this.horizontalScrolling = true;\n this.overlayScrollPositions.master.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.master.left > 0) {\n this.pendingScrollCallbacks.master.left--;\n } else {\n if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.top.left++;\n }\n\n topOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterHorizontal !== window;\n }\n\n if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.bottom.left++;\n }\n\n bottomOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterHorizontal !== window;\n }\n }\n\n tempScrollValue = (0, _element.getScrollTop)(target);\n\n this.verticalScrolling = true;\n this.overlayScrollPositions.master.top = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.master.top > 0) {\n this.pendingScrollCallbacks.master.top--;\n } else if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.left.top++;\n }\n\n leftOverlay.scrollTop = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n } else if (target === bottomOverlay) {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n\n // if scrolling the bottom overlay - populate the horizontal scroll to the master table\n this.horizontalScrolling = true;\n this.overlayScrollPositions.bottom.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.bottom.left > 0) {\n this.pendingScrollCallbacks.bottom.left--;\n } else {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.left++;\n }\n\n masterHorizontal.scrollLeft = tempScrollValue;\n\n if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.top.left++;\n }\n\n topOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollTop += fakeScrollValue;\n }\n } else if (target === topOverlay) {\n tempScrollValue = (0, _element.getScrollLeft)(target);\n\n // if scrolling the top overlay - populate the horizontal scroll to the master table\n this.horizontalScrolling = true;\n this.overlayScrollPositions.top.left = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.top.left > 0) {\n this.pendingScrollCallbacks.top.left--;\n } else {\n\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.left++;\n }\n\n masterHorizontal.scrollLeft = tempScrollValue;\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollTop += fakeScrollValue;\n }\n\n if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.bottom.left++;\n }\n\n bottomOverlay.scrollLeft = tempScrollValue;\n delegatedScroll = masterVertical !== window;\n }\n } else if (target === leftOverlay) {\n tempScrollValue = (0, _element.getScrollTop)(target);\n\n // if scrolling the left overlay - populate the vertical scroll to the master table\n if (this.overlayScrollPositions.left.top !== tempScrollValue) {\n this.verticalScrolling = true;\n this.overlayScrollPositions.left.top = tempScrollValue;\n scrollValueChanged = true;\n\n if (this.pendingScrollCallbacks.left.top > 0) {\n this.pendingScrollCallbacks.left.top--;\n } else {\n if (fakeScrollValue == null) {\n this.pendingScrollCallbacks.master.top++;\n }\n\n masterVertical.scrollTop = tempScrollValue;\n }\n }\n\n // \"fake\" scroll value calculated from the mousewheel event\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n masterVertical.scrollLeft += fakeScrollValue;\n }\n } else if (target === topLeftCornerOverlay || target === bottomLeftCornerOverlay) {\n if (fakeScrollValue !== null) {\n scrollValueChanged = true;\n\n if (fakeScrollDirection === 'x') {\n masterVertical.scrollLeft += fakeScrollValue;\n } else if (fakeScrollDirection === 'y') {\n masterVertical.scrollTop += fakeScrollValue;\n }\n }\n }\n\n if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') {\n if (this.delegatedScrollCallback) {\n this.delegatedScrollCallback = false;\n } else {\n this.refreshAll();\n }\n\n if (delegatedScroll) {\n this.delegatedScrollCallback = true;\n }\n }\n }\n\n /**\n * Synchronize overlay scrollbars with the master scrollbar\n */\n\n }, {\n key: 'syncScrollWithMaster',\n value: function syncScrollWithMaster() {\n var master = this.topOverlay.mainTableScrollableElement;\n var scrollLeft = master.scrollLeft,\n scrollTop = master.scrollTop;\n\n\n if (this.topOverlay.needFullRender) {\n this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.leftOverlay.needFullRender) {\n this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;\n }\n }\n\n /**\n * Update the main scrollable elements for all the overlays.\n */\n\n }, {\n key: 'updateMainScrollableElements',\n value: function updateMainScrollableElements() {\n this.deregisterListeners();\n\n this.leftOverlay.updateMainScrollableElement();\n this.topOverlay.updateMainScrollableElement();\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.updateMainScrollableElement();\n }\n\n this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);\n\n this.registerListeners();\n }\n\n /**\n *\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.eventManager.destroy();\n this.topOverlay.destroy();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.destroy();\n }\n this.leftOverlay.destroy();\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.destroy();\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.destroy();\n }\n\n if (this.debug) {\n this.debug.destroy();\n }\n this.destroyed = true;\n }\n\n /**\n * @param {Boolean} [fastDraw=false]\n */\n\n }, {\n key: 'refresh',\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {\n var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;\n var width = container.clientWidth;\n var height = container.clientHeight;\n\n if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {\n this.spreaderLastSize.width = width;\n this.spreaderLastSize.height = height;\n this.adjustElementsSize();\n }\n }\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.refresh(fastDraw);\n }\n\n this.leftOverlay.refresh(fastDraw);\n this.topOverlay.refresh(fastDraw);\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.debug) {\n this.debug.refresh(fastDraw);\n }\n }\n\n /**\n * Adjust overlays elements size and master table size\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var totalColumns = this.wot.getSetting('totalColumns');\n var totalRows = this.wot.getSetting('totalRows');\n var headerRowSize = this.wot.wtViewport.getRowHeaderWidth();\n var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();\n var hiderStyle = this.wot.wtTable.hider.style;\n\n hiderStyle.width = headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns) + 'px';\n hiderStyle.height = headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1 + 'px';\n\n this.topOverlay.adjustElementsSize(force);\n this.leftOverlay.adjustElementsSize(force);\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.adjustElementsSize(force);\n }\n }\n\n /**\n *\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n this.topOverlay.applyToDOM();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.applyToDOM();\n }\n\n this.leftOverlay.applyToDOM();\n }\n\n /**\n * Get the parent overlay of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {Object|null}\n */\n\n }, {\n key: 'getParentOverlay',\n value: function getParentOverlay(element) {\n if (!element) {\n return null;\n }\n\n var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];\n var result = null;\n\n (0, _array.arrayEach)(overlays, function (elem, i) {\n if (!elem) {\n return;\n }\n\n if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {\n result = elem.clone;\n }\n });\n\n return result;\n }\n }]);\n\n return Overlays;\n}();\n\nexports.default = Overlays;\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Scroll\n */\nvar Scroll = function () {\n /**\n * @param {Walkontable} wotInstance\n */\n function Scroll(wotInstance) {\n _classCallCheck(this, Scroll);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n }\n\n /**\n * Scrolls viewport to a cell by minimum number of cells\n *\n * @param {CellCoords} coords\n */\n\n\n _createClass(Scroll, [{\n key: 'scrollViewport',\n value: function scrollViewport(coords) {\n if (!this.wot.drawn) {\n return;\n }\n\n var _getVariables2 = this._getVariables(),\n topOverlay = _getVariables2.topOverlay,\n leftOverlay = _getVariables2.leftOverlay,\n totalRows = _getVariables2.totalRows,\n totalColumns = _getVariables2.totalColumns,\n fixedRowsTop = _getVariables2.fixedRowsTop,\n fixedRowsBottom = _getVariables2.fixedRowsBottom,\n fixedColumnsLeft = _getVariables2.fixedColumnsLeft;\n\n if (coords.row < 0 || coords.row > Math.max(totalRows - 1, 0)) {\n throw new Error('row ' + coords.row + ' does not exist');\n }\n\n if (coords.col < 0 || coords.col > Math.max(totalColumns - 1, 0)) {\n throw new Error('column ' + coords.col + ' does not exist');\n }\n\n if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {\n topOverlay.scrollTo(coords.row);\n } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {\n topOverlay.scrollTo(coords.row, true);\n }\n\n if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {\n leftOverlay.scrollTo(coords.col);\n } else if (coords.col > this.getLastVisibleColumn()) {\n leftOverlay.scrollTo(coords.col, true);\n }\n }\n\n /**\n * Get first visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n var _getVariables3 = this._getVariables(),\n topOverlay = _getVariables3.topOverlay,\n wtTable = _getVariables3.wtTable,\n wtViewport = _getVariables3.wtViewport,\n totalRows = _getVariables3.totalRows,\n fixedRowsTop = _getVariables3.fixedRowsTop;\n\n var firstVisibleRow = wtTable.getFirstVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var totalTableHeight = (0, _element.innerHeight)(wtTable.hider);\n var windowHeight = (0, _element.innerHeight)(window);\n var windowScrollTop = (0, _element.getScrollTop)(window);\n\n // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space\n if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n\n rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);\n\n (0, _number.rangeEachReverse)(totalRows, 1, function (row) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {\n // Return physical row + 1\n firstVisibleRow = row;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleRow;\n }\n\n /**\n * Get last visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n var _getVariables4 = this._getVariables(),\n topOverlay = _getVariables4.topOverlay,\n wtTable = _getVariables4.wtTable,\n wtViewport = _getVariables4.wtViewport,\n totalRows = _getVariables4.totalRows;\n\n var lastVisibleRow = wtTable.getLastVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var windowHeight = (0, _element.innerHeight)(window);\n var windowScrollTop = (0, _element.getScrollTop)(window);\n\n // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space\n if (rootElementOffset.top > windowScrollTop) {\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n\n (0, _number.rangeEach)(1, totalRows, function (row) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {\n // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)\n lastVisibleRow = row - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleRow;\n }\n\n /**\n * Get first visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n var _getVariables5 = this._getVariables(),\n leftOverlay = _getVariables5.leftOverlay,\n wtTable = _getVariables5.wtTable,\n wtViewport = _getVariables5.wtViewport,\n totalColumns = _getVariables5.totalColumns,\n fixedColumnsLeft = _getVariables5.fixedColumnsLeft;\n\n var firstVisibleColumn = wtTable.getFirstVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var totalTableWidth = (0, _element.innerWidth)(wtTable.hider);\n var windowWidth = (0, _element.innerWidth)(window);\n var windowScrollLeft = (0, _element.getScrollLeft)(window);\n\n // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space\n if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n (0, _number.rangeEachReverse)(totalColumns, 1, function (column) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {\n // Return physical column + 1\n firstVisibleColumn = column;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleColumn;\n }\n\n /**\n * Get last visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n var _getVariables6 = this._getVariables(),\n leftOverlay = _getVariables6.leftOverlay,\n wtTable = _getVariables6.wtTable,\n wtViewport = _getVariables6.wtViewport,\n totalColumns = _getVariables6.totalColumns;\n\n var lastVisibleColumn = wtTable.getLastVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);\n var windowWidth = (0, _element.innerWidth)(window);\n var windowScrollLeft = (0, _element.getScrollLeft)(window);\n\n // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space\n if (rootElementOffset.left > windowScrollLeft) {\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n (0, _number.rangeEach)(1, totalColumns, function (column) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {\n // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)\n lastVisibleColumn = column - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleColumn;\n }\n\n /**\n * Returns collection of variables used to rows and columns visibility calculations.\n *\n * @returns {Object}\n * @private\n */\n\n }, {\n key: '_getVariables',\n value: function _getVariables() {\n var wot = this.wot;\n var topOverlay = wot.wtOverlays.topOverlay;\n var leftOverlay = wot.wtOverlays.leftOverlay;\n var wtTable = wot.wtTable;\n var wtViewport = wot.wtViewport;\n var totalRows = wot.getSetting('totalRows');\n var totalColumns = wot.getSetting('totalColumns');\n var fixedRowsTop = wot.getSetting('fixedRowsTop');\n var fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');\n\n return {\n topOverlay: topOverlay,\n leftOverlay: leftOverlay,\n wtTable: wtTable,\n wtViewport: wtViewport,\n totalRows: totalRows,\n totalColumns: totalColumns,\n fixedRowsTop: fixedRowsTop,\n fixedRowsBottom: fixedRowsBottom,\n fixedColumnsLeft: fixedColumnsLeft\n };\n }\n }]);\n\n return Scroll;\n}();\n\nexports.default = Scroll;\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Settings\n */\nvar Settings = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n function Settings(wotInstance, settings) {\n var _this = this;\n\n _classCallCheck(this, Settings);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n\n // default settings. void 0 means it is required, null means it can be empty\n this.defaults = {\n table: void 0,\n debug: false, // shows WalkontableDebugOverlay\n\n // presentation mode\n externalRowCalculator: false,\n stretchH: 'none', // values: all, last, none\n currentRowClassName: null,\n currentColumnClassName: null,\n preventOverflow: function preventOverflow() {\n return false;\n },\n\n\n // data source\n data: void 0,\n freezeOverlays: false,\n fixedColumnsLeft: 0,\n fixedRowsTop: 0,\n fixedRowsBottom: 0,\n minSpareRows: 0,\n\n // this must be array of functions: [function (row, TH) {}]\n rowHeaders: function rowHeaders() {\n return [];\n },\n\n\n // this must be array of functions: [function (column, TH) {}]\n columnHeaders: function columnHeaders() {\n return [];\n },\n\n totalRows: void 0,\n totalColumns: void 0,\n cellRenderer: function cellRenderer(row, column, TD) {\n var cellData = _this.getSetting('data', row, column);\n\n (0, _element.fastInnerText)(TD, cellData === void 0 || cellData === null ? '' : cellData);\n },\n\n // columnWidth: 50,\n columnWidth: function columnWidth(col) {\n // return undefined means use default size for the rendered cell content\n },\n rowHeight: function rowHeight(row) {\n // return undefined means use default size for the rendered cell content\n },\n\n defaultRowHeight: 23,\n defaultColumnWidth: 50,\n selections: null,\n hideBorderOnMouseDownOver: false,\n viewportRowCalculatorOverride: null,\n viewportColumnCalculatorOverride: null,\n\n // callbacks\n onCellMouseDown: null,\n onCellMouseOver: null,\n onCellMouseOut: null,\n onCellMouseUp: null,\n\n // onCellMouseOut: null,\n onCellDblClick: null,\n onCellCornerMouseDown: null,\n onCellCornerDblClick: null,\n beforeDraw: null,\n onDraw: null,\n onBeforeDrawBorders: null,\n onScrollVertically: null,\n onScrollHorizontally: null,\n onBeforeTouchScroll: null,\n onAfterMomentumScroll: null,\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(width) {\n return width;\n },\n onModifyRowHeaderWidth: null,\n\n // constants\n scrollbarWidth: 10,\n scrollbarHeight: 10,\n\n renderAllRows: false,\n groups: false,\n rowHeaderWidth: null,\n columnHeaderHeight: null,\n headerClassName: null\n };\n\n // reference to settings\n this.settings = {};\n\n for (var i in this.defaults) {\n if ((0, _object.hasOwnProperty)(this.defaults, i)) {\n if (settings[i] !== void 0) {\n this.settings[i] = settings[i];\n } else if (this.defaults[i] === void 0) {\n throw new Error('A required setting \"' + i + '\" was not provided');\n } else {\n this.settings[i] = this.defaults[i];\n }\n }\n }\n }\n\n /**\n * Update settings\n *\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n\n\n _createClass(Settings, [{\n key: 'update',\n value: function update(settings, value) {\n if (value === void 0) {\n // settings is object\n for (var i in settings) {\n if ((0, _object.hasOwnProperty)(settings, i)) {\n this.settings[i] = settings[i];\n }\n }\n } else {\n // if value is defined then settings is the key\n this.settings[settings] = value;\n }\n return this.wot;\n }\n\n /**\n * Get setting by name\n *\n * @param {String} key\n * @param {*} param1\n * @param {*} param2\n * @param {*} param3\n * @param {*} param4\n * @returns {*}\n */\n\n }, {\n key: 'getSetting',\n value: function getSetting(key, param1, param2, param3, param4) {\n if (typeof this.settings[key] === 'function') {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.settings[key](param1, param2, param3, param4);\n } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {\n // perhaps this can be removed, it is only used in tests\n return this.settings[key][param1];\n }\n\n return this.settings[key];\n }\n\n /**\n * Checks if setting exists\n *\n * @param {Boolean} key\n * @returns {Boolean}\n */\n\n }, {\n key: 'has',\n value: function has(key) {\n return !!this.settings[key];\n }\n }]);\n\n return Settings;\n}();\n\nexports.default = Settings;\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _function = __webpack_require__(35);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nvar _column = __webpack_require__(139);\n\nvar _column2 = _interopRequireDefault(_column);\n\nvar _row = __webpack_require__(140);\n\nvar _row2 = _interopRequireDefault(_row);\n\nvar _tableRenderer = __webpack_require__(145);\n\nvar _tableRenderer2 = _interopRequireDefault(_tableRenderer);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *\n */\nvar Table = function () {\n /**\n * @param {Walkontable} wotInstance\n * @param {HTMLTableElement} table\n */\n function Table(wotInstance, table) {\n var _this = this;\n\n _classCallCheck(this, Table);\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.TABLE = table;\n this.TBODY = null;\n this.THEAD = null;\n this.COLGROUP = null;\n this.tableOffset = 0;\n this.holderOffset = 0;\n\n (0, _element.removeTextNodes)(this.TABLE);\n\n this.spreader = this.createSpreader(this.TABLE);\n this.hider = this.createHider(this.spreader);\n this.holder = this.createHolder(this.hider);\n\n this.wtRootElement = this.holder.parentNode;\n this.alignOverlaysWithTrimmingContainer();\n this.fixTableDomTree();\n\n this.colgroupChildrenLength = this.COLGROUP.childNodes.length;\n this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;\n this.tbodyChildrenLength = this.TBODY.childNodes.length;\n\n this.rowFilter = null;\n this.columnFilter = null;\n this.correctHeaderWidth = false;\n\n var origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth;\n\n // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)\n this.wot.wtSettings.settings.rowHeaderWidth = function () {\n return _this._modifyRowHeaderWidth(origRowHeaderWidth);\n };\n }\n\n /**\n *\n */\n\n\n _createClass(Table, [{\n key: 'fixTableDomTree',\n value: function fixTableDomTree() {\n this.TBODY = this.TABLE.querySelector('tbody');\n\n if (!this.TBODY) {\n this.TBODY = document.createElement('tbody');\n this.TABLE.appendChild(this.TBODY);\n }\n this.THEAD = this.TABLE.querySelector('thead');\n\n if (!this.THEAD) {\n this.THEAD = document.createElement('thead');\n this.TABLE.insertBefore(this.THEAD, this.TBODY);\n }\n this.COLGROUP = this.TABLE.querySelector('colgroup');\n\n if (!this.COLGROUP) {\n this.COLGROUP = document.createElement('colgroup');\n this.TABLE.insertBefore(this.COLGROUP, this.THEAD);\n }\n\n if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {\n this.THEAD.appendChild(document.createElement('TR'));\n }\n }\n\n /**\n * @param table\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createSpreader',\n value: function createSpreader(table) {\n var parent = table.parentNode;\n var spreader = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n spreader = document.createElement('div');\n spreader.className = 'wtSpreader';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(spreader, table);\n }\n spreader.appendChild(table);\n }\n spreader.style.position = 'relative';\n\n return spreader;\n }\n\n /**\n * @param spreader\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createHider',\n value: function createHider(spreader) {\n var parent = spreader.parentNode;\n var hider = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n hider = document.createElement('div');\n hider.className = 'wtHider';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(hider, spreader);\n }\n hider.appendChild(spreader);\n }\n\n return hider;\n }\n\n /**\n *\n * @param hider\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createHolder',\n value: function createHolder(hider) {\n var parent = hider.parentNode;\n var holder = void 0;\n\n if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {\n holder = document.createElement('div');\n holder.style.position = 'relative';\n holder.className = 'wtHolder';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(holder, hider);\n }\n if (!this.isWorkingOnClone()) {\n holder.parentNode.className += 'ht_master handsontable';\n }\n holder.appendChild(hider);\n }\n\n return holder;\n }\n }, {\n key: 'alignOverlaysWithTrimmingContainer',\n value: function alignOverlaysWithTrimmingContainer() {\n var trimmingElement = (0, _element.getTrimmingContainer)(this.wtRootElement);\n\n if (!this.isWorkingOnClone()) {\n this.holder.parentNode.style.position = 'relative';\n\n if (trimmingElement === window) {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (!preventOverflow) {\n this.holder.style.overflow = 'visible';\n this.wtRootElement.style.overflow = 'visible';\n }\n } else {\n this.holder.style.width = (0, _element.getStyle)(trimmingElement, 'width');\n this.holder.style.height = (0, _element.getStyle)(trimmingElement, 'height');\n this.holder.style.overflow = '';\n }\n }\n }\n }, {\n key: 'isWorkingOnClone',\n value: function isWorkingOnClone() {\n return !!this.wot.cloneSource;\n }\n\n /**\n * Redraws the table\n *\n * @param {Boolean} fastDraw If TRUE, will try to avoid full redraw and only update the border positions. If FALSE or UNDEFINED, will perform a full redraw\n * @returns {Table}\n */\n\n }, {\n key: 'draw',\n value: function draw(fastDraw) {\n var _wot = this.wot,\n wtOverlays = _wot.wtOverlays,\n wtViewport = _wot.wtViewport;\n\n var totalRows = this.instance.getSetting('totalRows');\n var rowHeaders = this.wot.getSetting('rowHeaders').length;\n var columnHeaders = this.wot.getSetting('columnHeaders').length;\n var syncScroll = false;\n\n if (!this.isWorkingOnClone()) {\n this.holderOffset = (0, _element.offset)(this.holder);\n fastDraw = wtViewport.createRenderCalculators(fastDraw);\n\n if (rowHeaders && !this.wot.getSetting('fixedColumnsLeft')) {\n var leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();\n var previousState = this.correctHeaderWidth;\n\n this.correctHeaderWidth = leftScrollPos > 0;\n\n if (previousState !== this.correctHeaderWidth) {\n fastDraw = false;\n }\n }\n }\n\n if (!this.isWorkingOnClone()) {\n syncScroll = wtOverlays.prepareOverlays();\n }\n\n if (fastDraw) {\n if (!this.isWorkingOnClone()) {\n // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator\n wtViewport.createVisibleCalculators();\n }\n if (wtOverlays) {\n wtOverlays.refresh(true);\n }\n } else {\n if (this.isWorkingOnClone()) {\n this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;\n } else {\n this.tableOffset = (0, _element.offset)(this.TABLE);\n }\n var startRow = void 0;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER)) {\n startRow = 0;\n } else if (_base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);\n } else {\n startRow = wtViewport.rowsRenderCalculator.startRow;\n }\n var startColumn = void 0;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_LEFT) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n startColumn = 0;\n } else {\n startColumn = wtViewport.columnsRenderCalculator.startColumn;\n }\n this.rowFilter = new _row2.default(startRow, totalRows, columnHeaders);\n this.columnFilter = new _column2.default(startColumn, this.wot.getSetting('totalColumns'), rowHeaders);\n\n this.alignOverlaysWithTrimmingContainer();\n this._doDraw(); // creates calculator after draw\n }\n this.refreshSelections(fastDraw);\n\n if (!this.isWorkingOnClone()) {\n wtOverlays.topOverlay.resetFixedPosition();\n\n if (wtOverlays.bottomOverlay.clone) {\n wtOverlays.bottomOverlay.resetFixedPosition();\n }\n\n wtOverlays.leftOverlay.resetFixedPosition();\n\n if (wtOverlays.topLeftCornerOverlay) {\n wtOverlays.topLeftCornerOverlay.resetFixedPosition();\n }\n\n if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {\n wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();\n }\n }\n if (syncScroll) {\n wtOverlays.syncScrollWithMaster();\n }\n this.wot.drawn = true;\n\n return this;\n }\n }, {\n key: '_doDraw',\n value: function _doDraw() {\n var wtRenderer = new _tableRenderer2.default(this);\n\n wtRenderer.render();\n }\n }, {\n key: 'removeClassFromCells',\n value: function removeClassFromCells(className) {\n var nodes = this.TABLE.querySelectorAll('.' + className);\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n (0, _element.removeClass)(nodes[i], className);\n }\n }\n }, {\n key: 'refreshSelections',\n value: function refreshSelections(fastDraw) {\n if (!this.wot.selections) {\n return;\n }\n var len = this.wot.selections.length;\n\n if (fastDraw) {\n for (var i = 0; i < len; i++) {\n // there was no rerender, so we need to remove classNames by ourselves\n if (this.wot.selections[i].settings.className) {\n this.removeClassFromCells(this.wot.selections[i].settings.className);\n }\n if (this.wot.selections[i].settings.highlightHeaderClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightHeaderClassName);\n }\n if (this.wot.selections[i].settings.highlightRowClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName);\n }\n if (this.wot.selections[i].settings.highlightColumnClassName) {\n this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName);\n }\n }\n }\n for (var _i = 0; _i < len; _i++) {\n this.wot.selections[_i].draw(this.wot, fastDraw);\n }\n }\n\n /**\n * Get cell element at coords.\n *\n * @param {CellCoords} coords\n * @returns {HTMLElement|Number} HTMLElement on success or Number one of the exit codes on error:\n * -1 row before viewport\n * -2 row after viewport\n */\n\n }, {\n key: 'getCell',\n value: function getCell(coords) {\n if (this.isRowBeforeRenderedRows(coords.row)) {\n // row before rendered rows\n return -1;\n } else if (this.isRowAfterRenderedRows(coords.row)) {\n // row after rendered rows\n return -2;\n }\n\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)];\n }\n }\n\n /**\n * getColumnHeader\n *\n * @param {Number} col Column index\n * @param {Number} [level=0] Header level (0 = most distant to the table)\n * @returns {Object} HTMLElement on success or undefined on error\n */\n\n }, {\n key: 'getColumnHeader',\n value: function getColumnHeader(col) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var TR = this.THEAD.childNodes[level];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];\n }\n }\n\n /**\n * getRowHeader\n *\n * @param {Number} row Row index\n * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`\n */\n\n }, {\n key: 'getRowHeader',\n value: function getRowHeader(row) {\n if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {\n return null;\n }\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n\n if (TR) {\n return TR.childNodes[0];\n }\n }\n\n /**\n * Returns cell coords object for a given TD (or a child element of a TD element).\n *\n * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).\n * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.\n */\n\n }, {\n key: 'getCoords',\n value: function getCoords(TD) {\n if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {\n TD = (0, _element.closest)(TD, ['TD', 'TH']);\n }\n\n if (TD === null) {\n return null;\n }\n\n var TR = TD.parentNode;\n var CONTAINER = TR.parentNode;\n var row = (0, _element.index)(TR);\n var col = TD.cellIndex;\n\n if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_TOP, TD)) {\n if (CONTAINER.nodeName === 'THEAD') {\n row -= CONTAINER.childNodes.length;\n }\n } else if (CONTAINER === this.THEAD) {\n row = this.rowFilter.visibleColHeadedRowToSourceRow(row);\n } else {\n row = this.rowFilter.renderedToSource(row);\n }\n\n if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_LEFT, TD)) {\n col = this.columnFilter.offsettedTH(col);\n } else {\n col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);\n }\n\n return new _coords2.default(row, col);\n }\n }, {\n key: 'getTrForRow',\n value: function getTrForRow(row) {\n return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n }\n }, {\n key: 'getFirstRenderedRow',\n value: function getFirstRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.startRow;\n }\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.startRow;\n }\n }, {\n key: 'getFirstRenderedColumn',\n value: function getFirstRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n\n }, {\n key: 'getLastRenderedRow',\n value: function getLastRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.endRow;\n }\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.endRow;\n }\n }, {\n key: 'getLastRenderedColumn',\n value: function getLastRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.endColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no column is visible\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.endColumn;\n }\n }, {\n key: 'isRowBeforeRenderedRows',\n value: function isRowBeforeRenderedRows(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) < 0 && row >= 0;\n }\n }, {\n key: 'isRowAfterViewport',\n value: function isRowAfterViewport(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow();\n }\n }, {\n key: 'isRowAfterRenderedRows',\n value: function isRowAfterRenderedRows(row) {\n return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow();\n }\n }, {\n key: 'isColumnBeforeViewport',\n value: function isColumnBeforeViewport(column) {\n return this.columnFilter && this.columnFilter.sourceToRendered(column) < 0 && column >= 0;\n }\n }, {\n key: 'isColumnAfterViewport',\n value: function isColumnAfterViewport(column) {\n return this.columnFilter && this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn();\n }\n }, {\n key: 'isLastRowFullyVisible',\n value: function isLastRowFullyVisible() {\n return this.getLastVisibleRow() === this.getLastRenderedRow();\n }\n }, {\n key: 'isLastColumnFullyVisible',\n value: function isLastColumnFullyVisible() {\n return this.getLastVisibleColumn() === this.getLastRenderedColumn();\n }\n }, {\n key: 'getRenderedColumnsCount',\n value: function getRenderedColumnsCount() {\n var columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {\n columnsCount = totalColumns;\n } else if (this.wot.isOverlayName(_base2.default.CLONE_LEFT) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);\n }\n\n return columnsCount;\n }\n }, {\n key: 'getRenderedRowsCount',\n value: function getRenderedRowsCount() {\n var rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;\n var totalRows = this.wot.getSetting('totalRows');\n\n if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {\n rowsCount = totalRows;\n } else if (this.wot.isOverlayName(_base2.default.CLONE_TOP) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);\n } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);\n }\n\n return rowsCount;\n }\n }, {\n key: 'getVisibleRowsCount',\n value: function getVisibleRowsCount() {\n return this.wot.wtViewport.rowsVisibleCalculator.count;\n }\n }, {\n key: 'allRowsInViewport',\n value: function allRowsInViewport() {\n return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();\n }\n\n /**\n * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height\n *\n * @param {Number} sourceRow\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeight',\n value: function getRowHeight(sourceRow) {\n var height = this.wot.wtSettings.settings.rowHeight(sourceRow);\n var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];\n\n if (oversizedHeight !== void 0) {\n height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);\n }\n\n return height;\n }\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight(level) {\n var height = this.wot.wtSettings.settings.defaultRowHeight;\n var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];\n\n if (oversizedHeight !== void 0) {\n height = height ? Math.max(height, oversizedHeight) : oversizedHeight;\n }\n\n return height;\n }\n }, {\n key: 'getVisibleColumnsCount',\n value: function getVisibleColumnsCount() {\n return this.wot.wtViewport.columnsVisibleCalculator.count;\n }\n }, {\n key: 'allColumnsInViewport',\n value: function allColumnsInViewport() {\n return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();\n }\n }, {\n key: 'getColumnWidth',\n value: function getColumnWidth(sourceColumn) {\n var width = this.wot.wtSettings.settings.columnWidth;\n\n if (typeof width === 'function') {\n width = width(sourceColumn);\n } else if ((typeof width === 'undefined' ? 'undefined' : _typeof(width)) === 'object') {\n width = width[sourceColumn];\n }\n\n return width || this.wot.wtSettings.settings.defaultColumnWidth;\n }\n }, {\n key: 'getStretchedColumnWidth',\n value: function getStretchedColumnWidth(sourceColumn) {\n var columnWidth = this.getColumnWidth(sourceColumn);\n var width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;\n var calculator = this.wot.wtViewport.columnsRenderCalculator;\n\n if (calculator) {\n var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);\n\n if (stretchedWidth) {\n width = stretchedWidth;\n }\n }\n\n return width;\n }\n\n /**\n * Modify row header widths provided by user in class contructor.\n *\n * @private\n */\n\n }, {\n key: '_modifyRowHeaderWidth',\n value: function _modifyRowHeaderWidth(rowHeaderWidthFactory) {\n var widths = (0, _function.isFunction)(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;\n\n if (Array.isArray(widths)) {\n widths = [].concat(_toConsumableArray(widths));\n widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);\n } else {\n widths = this._correctRowHeaderWidth(widths);\n }\n\n return widths;\n }\n\n /**\n * Correct row header width if necessary.\n *\n * @private\n */\n\n }, {\n key: '_correctRowHeaderWidth',\n value: function _correctRowHeaderWidth(width) {\n if (typeof width !== 'number') {\n width = this.wot.getSetting('defaultColumnWidth');\n }\n if (this.correctHeaderWidth) {\n width++;\n }\n\n return width;\n }\n }]);\n\n return Table;\n}();\n\nexports.default = Table;\n\n/***/ }),\n/* 145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar performanceWarningAppeared = false;\n\n/**\n * @class TableRenderer\n */\n\nvar TableRenderer = function () {\n /**\n * @param {WalkontableTable} wtTable\n */\n function TableRenderer(wtTable) {\n _classCallCheck(this, TableRenderer);\n\n this.wtTable = wtTable;\n this.wot = wtTable.instance;\n\n // legacy support\n this.instance = wtTable.instance;\n\n this.rowFilter = wtTable.rowFilter;\n this.columnFilter = wtTable.columnFilter;\n\n this.TABLE = wtTable.TABLE;\n this.THEAD = wtTable.THEAD;\n this.TBODY = wtTable.TBODY;\n this.COLGROUP = wtTable.COLGROUP;\n\n this.rowHeaders = [];\n this.rowHeaderCount = 0;\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n this.fixedRowsTop = 0;\n this.fixedRowsBottom = 0;\n }\n\n /**\n *\n */\n\n\n _createClass(TableRenderer, [{\n key: 'render',\n value: function render() {\n if (!this.wtTable.isWorkingOnClone()) {\n var skipRender = {};\n this.wot.getSetting('beforeDraw', true, skipRender);\n\n if (skipRender.skipRender === true) {\n return;\n }\n }\n\n this.rowHeaders = this.wot.getSetting('rowHeaders');\n this.rowHeaderCount = this.rowHeaders.length;\n this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n this.columnHeaders = this.wot.getSetting('columnHeaders');\n this.columnHeaderCount = this.columnHeaders.length;\n\n var columnsToRender = this.wtTable.getRenderedColumnsCount();\n var rowsToRender = this.wtTable.getRenderedRowsCount();\n var totalColumns = this.wot.getSetting('totalColumns');\n var totalRows = this.wot.getSetting('totalRows');\n var workspaceWidth = void 0;\n var adjusted = false;\n\n if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {\n\n // do NOT render headers on the bottom or bottom-left corner overlay\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n }\n\n if (totalColumns >= 0) {\n // prepare COL and TH elements for rendering\n this.adjustAvailableNodes();\n adjusted = true;\n\n // adjust column widths according to user widths settings\n this.renderColumnHeaders();\n\n // Render table rows\n this.renderRows(totalRows, rowsToRender, columnsToRender);\n\n if (!this.wtTable.isWorkingOnClone()) {\n workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();\n this.wot.wtViewport.containerWidth = null;\n }\n\n this.adjustColumnWidths(columnsToRender);\n this.markOversizedColumnHeaders();\n this.adjustColumnHeaderHeights();\n }\n\n if (!adjusted) {\n this.adjustAvailableNodes();\n }\n this.removeRedundantRows(rowsToRender);\n\n if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n this.markOversizedRows();\n }\n if (!this.wtTable.isWorkingOnClone()) {\n this.wot.wtViewport.createVisibleCalculators();\n this.wot.wtOverlays.refresh(false);\n\n this.wot.wtOverlays.applyToDOM();\n\n var hiderWidth = (0, _element.outerWidth)(this.wtTable.hider);\n var tableWidth = (0, _element.outerWidth)(this.wtTable.TABLE);\n\n if (hiderWidth !== 0 && tableWidth !== hiderWidth) {\n // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.\n this.adjustColumnWidths(columnsToRender);\n }\n\n if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {\n // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching\n this.wot.wtViewport.containerWidth = null;\n\n var firstRendered = this.wtTable.getFirstRenderedColumn();\n var lastRendered = this.wtTable.getLastRenderedColumn();\n var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (var i = 0; i < this.rowHeaderCount; i++) {\n var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = width + 'px';\n }\n }\n\n for (var _i = firstRendered; _i < lastRendered; _i++) {\n var _width = this.wtTable.getStretchedColumnWidth(_i);\n var renderedIndex = this.columnFilter.sourceToRendered(_i);\n\n this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = _width + 'px';\n }\n }\n\n this.wot.getSetting('onDraw', true);\n } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n this.wot.cloneSource.wtOverlays.adjustElementsSize();\n }\n }\n\n /**\n * @param {Number} renderedRowsCount\n */\n\n }, {\n key: 'removeRedundantRows',\n value: function removeRedundantRows(renderedRowsCount) {\n while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n\n /**\n * @param {Number} totalRows\n * @param {Number} rowsToRender\n * @param {Number} columnsToRender\n */\n\n }, {\n key: 'renderRows',\n value: function renderRows(totalRows, rowsToRender, columnsToRender) {\n var lastTD = void 0,\n TR = void 0;\n var visibleRowIndex = 0;\n var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n var isWorkingOnClone = this.wtTable.isWorkingOnClone();\n\n while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {\n if (!performanceWarningAppeared && visibleRowIndex > 1000) {\n performanceWarningAppeared = true;\n console.warn('Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting the number ' + 'of rendered rows by specifying the table height and/or turning off the \"renderAllRows\" option.');\n }\n if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {\n // We have as much rows as needed for this clone\n break;\n }\n TR = this.getOrCreateTrForRow(visibleRowIndex, TR);\n\n // Render row headers\n this.renderRowHeaders(sourceRowIndex, TR);\n // Add and/or remove TDs to TR to match the desired number\n this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);\n\n lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);\n\n if (!isWorkingOnClone ||\n // Necessary to refresh oversized row heights after editing cell in overlays\n this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {\n // Reset the oversized row cache for this row\n this.resetOversizedRow(sourceRowIndex);\n }\n\n if (TR.firstChild) {\n // if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is\n // the way to make sure that the overlay will has same row height\n var height = this.wot.wtTable.getRowHeight(sourceRowIndex);\n\n if (height) {\n // Decrease height. 1 pixel will be \"replaced\" by 1px border top\n height--;\n TR.firstChild.style.height = height + 'px';\n } else {\n TR.firstChild.style.height = '';\n }\n }\n visibleRowIndex++;\n sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n }\n }\n\n /**\n * Reset the oversized row cache for the provided index\n *\n * @param {Number} sourceRow Row index\n */\n\n }, {\n key: 'resetOversizedRow',\n value: function resetOversizedRow(sourceRow) {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {\n this.wot.wtViewport.oversizedRows[sourceRow] = void 0;\n }\n }\n\n /**\n * Check if any of the rendered rows is higher than expected, and if so, cache them\n */\n\n }, {\n key: 'markOversizedRows',\n value: function markOversizedRows() {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n var rowCount = this.instance.wtTable.TBODY.childNodes.length;\n var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;\n var actualTableHeight = (0, _element.innerHeight)(this.instance.wtTable.TBODY) - 1;\n var previousRowHeight = void 0;\n var rowInnerHeight = void 0;\n var sourceRowIndex = void 0;\n var currentTr = void 0;\n var rowHeader = void 0;\n var totalRows = this.instance.getSetting('totalRows');\n\n if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {\n // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them\n return;\n }\n\n while (rowCount) {\n rowCount--;\n sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);\n previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);\n currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);\n rowHeader = currentTr.querySelector('th');\n\n if (rowHeader) {\n rowInnerHeight = (0, _element.innerHeight)(rowHeader);\n } else {\n rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;\n }\n\n if (!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight) {\n this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;\n }\n }\n }\n\n /**\n * Check if any of the rendered columns is higher than expected, and if so, cache them.\n */\n\n }, {\n key: 'markOversizedColumnHeaders',\n value: function markOversizedColumnHeaders() {\n var overlayName = this.wot.getOverlayName();\n\n if (!this.columnHeaderCount || this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] || this.wtTable.isWorkingOnClone()) {\n return;\n }\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (var i = 0; i < this.columnHeaderCount; i++) {\n for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n this.markIfOversizedColumnHeader(renderedColumnIndex);\n }\n }\n this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;\n }\n\n /**\n *\n */\n\n }, {\n key: 'adjustColumnHeaderHeights',\n value: function adjustColumnHeaderHeights() {\n var columnHeaders = this.wot.getSetting('columnHeaders');\n var children = this.wot.wtTable.THEAD.childNodes;\n var oversizedColumnHeaders = this.wot.wtViewport.oversizedColumnHeaders;\n\n for (var i = 0, len = columnHeaders.length; i < len; i++) {\n if (oversizedColumnHeaders[i]) {\n if (!children[i] || children[i].childNodes.length === 0) {\n return;\n }\n children[i].childNodes[0].style.height = oversizedColumnHeaders[i] + 'px';\n }\n }\n }\n\n /**\n * Check if column header for the specified column is higher than expected, and if so, cache it\n *\n * @param {Number} col Index of column\n */\n\n }, {\n key: 'markIfOversizedColumnHeader',\n value: function markIfOversizedColumnHeader(col) {\n var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);\n var level = this.columnHeaderCount;\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n var previousColHeaderHeight = void 0;\n var currentHeader = void 0;\n var currentHeaderHeight = void 0;\n var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];\n\n while (level) {\n level--;\n\n previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);\n currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);\n\n if (!currentHeader) {\n /* eslint-disable no-continue */\n continue;\n }\n currentHeaderHeight = (0, _element.innerHeight)(currentHeader);\n\n if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;\n }\n\n if (Array.isArray(columnHeaderHeightSetting)) {\n if (columnHeaderHeightSetting[level] != null) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];\n }\n } else if (!isNaN(columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;\n }\n\n if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting;\n }\n }\n }\n\n /**\n * @param {Number} sourceRowIndex\n * @param {HTMLTableRowElement} TR\n * @param {Number} columnsToRender\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'renderCells',\n value: function renderCells(sourceRowIndex, TR, columnsToRender) {\n var TD = void 0;\n var sourceColIndex = void 0;\n\n for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {\n sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);\n\n if (visibleColIndex === 0) {\n TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];\n } else {\n TD = TD.nextSibling; // http://jsperf.com/nextsibling-vs-indexed-childnodes\n }\n // If the number of headers has been reduced, we need to replace excess TH with TD\n if (TD.nodeName == 'TH') {\n TD = replaceThWithTd(TD, TR);\n }\n if (!(0, _element.hasClass)(TD, 'hide')) {\n TD.className = '';\n }\n TD.removeAttribute('style');\n this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);\n }\n\n return TD;\n }\n\n /**\n * @param {Number} columnsToRender Number of columns to render.\n */\n\n }, {\n key: 'adjustColumnWidths',\n value: function adjustColumnWidths(columnsToRender) {\n var scrollbarCompensation = 0;\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n if (mainHolder.offsetHeight < mainHolder.scrollHeight) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (var i = 0; i < this.rowHeaderCount; i++) {\n var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = width + 'px';\n }\n }\n\n for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {\n var _width2 = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));\n\n this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = _width2 + 'px';\n }\n }\n\n /**\n * @param {HTMLTableCellElement} TR\n */\n\n }, {\n key: 'appendToTbody',\n value: function appendToTbody(TR) {\n this.TBODY.appendChild(TR);\n this.wtTable.tbodyChildrenLength++;\n }\n\n /**\n * @param {Number} rowIndex\n * @param {HTMLTableRowElement} currentTr\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'getOrCreateTrForRow',\n value: function getOrCreateTrForRow(rowIndex, currentTr) {\n var TR = void 0;\n\n if (rowIndex >= this.wtTable.tbodyChildrenLength) {\n TR = this.createRow();\n this.appendToTbody(TR);\n } else if (rowIndex === 0) {\n TR = this.TBODY.firstChild;\n } else {\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TR = currentTr.nextSibling;\n }\n if (TR.className) {\n TR.removeAttribute('class');\n }\n\n return TR;\n }\n\n /**\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'createRow',\n value: function createRow() {\n var TR = document.createElement('TR');\n\n for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n TR.appendChild(document.createElement('TH'));\n }\n\n return TR;\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n */\n\n }, {\n key: 'renderRowHeader',\n value: function renderRowHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n this.rowHeaders[col](row, TH, col);\n }\n\n /**\n * @param {Number} row\n * @param {HTMLTableCellElement} TR\n */\n\n }, {\n key: 'renderRowHeaders',\n value: function renderRowHeaders(row, TR) {\n for (var TH = TR.firstChild, visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n // If the number of row headers increased we need to create TH or replace an existing TD node with TH\n if (!TH) {\n TH = document.createElement('TH');\n TR.appendChild(TH);\n } else if (TH.nodeName == 'TD') {\n TH = replaceTdWithTh(TH, TR);\n }\n this.renderRowHeader(row, visibleColIndex, TH);\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TH = TH.nextSibling;\n }\n }\n\n /**\n * Adjust the number of COL and TH elements to match the number of columns and headers that need to be rendered\n */\n\n }, {\n key: 'adjustAvailableNodes',\n value: function adjustAvailableNodes() {\n this.adjustColGroups();\n this.adjustThead();\n }\n\n /**\n * Renders the column headers\n */\n\n }, {\n key: 'renderColumnHeaders',\n value: function renderColumnHeaders() {\n if (!this.columnHeaderCount) {\n return;\n }\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (var i = 0; i < this.columnHeaderCount; i++) {\n var TR = this.getTrForColumnHeaders(i);\n\n for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);\n\n this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);\n }\n }\n }\n\n /**\n * Adjusts the number of COL elements to match the number of columns that need to be rendered\n */\n\n }, {\n key: 'adjustColGroups',\n value: function adjustColGroups() {\n var columnCount = this.wtTable.getRenderedColumnsCount();\n\n while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {\n this.COLGROUP.appendChild(document.createElement('COL'));\n this.wtTable.colgroupChildrenLength++;\n }\n while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {\n this.COLGROUP.removeChild(this.COLGROUP.lastChild);\n this.wtTable.colgroupChildrenLength--;\n }\n if (this.rowHeaderCount) {\n (0, _element.addClass)(this.COLGROUP.childNodes[0], 'rowHeader');\n }\n }\n\n /**\n * Adjusts the number of TH elements in THEAD to match the number of headers and columns that need to be rendered\n */\n\n }, {\n key: 'adjustThead',\n value: function adjustThead() {\n var columnCount = this.wtTable.getRenderedColumnsCount();\n var TR = this.THEAD.firstChild;\n\n if (this.columnHeaders.length) {\n for (var i = 0, len = this.columnHeaders.length; i < len; i++) {\n TR = this.THEAD.childNodes[i];\n\n if (!TR) {\n TR = document.createElement('TR');\n this.THEAD.appendChild(TR);\n }\n this.theadChildrenLength = TR.childNodes.length;\n\n while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {\n TR.appendChild(document.createElement('TH'));\n this.theadChildrenLength++;\n }\n while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {\n TR.removeChild(TR.lastChild);\n this.theadChildrenLength--;\n }\n }\n var theadChildrenLength = this.THEAD.childNodes.length;\n\n if (theadChildrenLength > this.columnHeaders.length) {\n for (var _i2 = this.columnHeaders.length; _i2 < theadChildrenLength; _i2++) {\n this.THEAD.removeChild(this.THEAD.lastChild);\n }\n }\n } else if (TR) {\n (0, _element.empty)(TR);\n }\n }\n\n /**\n * @param {Number} index\n * @returns {HTMLTableCellElement}\n */\n\n }, {\n key: 'getTrForColumnHeaders',\n value: function getTrForColumnHeaders(index) {\n return this.THEAD.childNodes[index];\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n * @returns {*}\n */\n\n }, {\n key: 'renderColumnHeader',\n value: function renderColumnHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n\n return this.columnHeaders[row](col, TH, row);\n }\n\n /**\n * Add and/or remove the TDs to match the desired number\n *\n * @param {HTMLTableCellElement} TR Table row in question\n * @param {Number} desiredCount The desired number of TDs in the TR\n */\n\n }, {\n key: 'adjustColumns',\n value: function adjustColumns(TR, desiredCount) {\n var count = TR.childNodes.length;\n\n while (count < desiredCount) {\n var TD = document.createElement('TD');\n\n TR.appendChild(TD);\n count++;\n }\n while (count > desiredCount) {\n TR.removeChild(TR.lastChild);\n count--;\n }\n }\n\n /**\n * @param {Number} columnsToRender\n */\n\n }, {\n key: 'removeRedundantColumns',\n value: function removeRedundantColumns(columnsToRender) {\n while (this.wtTable.tbodyChildrenLength > columnsToRender) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n }]);\n\n return TableRenderer;\n}();\n\nfunction replaceTdWithTh(TD, TR) {\n var TH = document.createElement('TH');\n\n TR.insertBefore(TH, TD);\n TR.removeChild(TD);\n\n return TH;\n}\n\nfunction replaceThWithTd(TH, TR) {\n var TD = document.createElement('TD');\n\n TR.insertBefore(TD, TH);\n TR.removeChild(TH);\n\n return TD;\n}\n\nexports.default = TableRenderer;\n\n/***/ }),\n/* 146 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _viewportColumns = __webpack_require__(135);\n\nvar _viewportColumns2 = _interopRequireDefault(_viewportColumns);\n\nvar _viewportRows = __webpack_require__(136);\n\nvar _viewportRows2 = _interopRequireDefault(_viewportRows);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Viewport\n */\nvar Viewport = function () {\n /**\n * @param wotInstance\n */\n function Viewport(wotInstance) {\n var _this = this;\n\n _classCallCheck(this, Viewport);\n\n this.wot = wotInstance;\n // legacy support\n this.instance = this.wot;\n\n this.oversizedRows = [];\n this.oversizedColumnHeaders = [];\n this.hasOversizedColumnHeadersMarked = {};\n this.clientHeight = 0;\n this.containerWidth = NaN;\n this.rowHeaderWidth = NaN;\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n this.eventManager = new _eventManager2.default(this.wot);\n this.eventManager.addEventListener(window, 'resize', function () {\n _this.clientHeight = _this.getWorkspaceHeight();\n });\n }\n\n /**\n * @returns {number}\n */\n\n\n _createClass(Viewport, [{\n key: 'getWorkspaceHeight',\n value: function getWorkspaceHeight() {\n var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;\n var elemHeight = void 0;\n var height = 0;\n\n if (trimmingContainer === window) {\n height = document.documentElement.clientHeight;\n } else {\n elemHeight = (0, _element.outerHeight)(trimmingContainer);\n // returns height without DIV scrollbar\n height = elemHeight > 0 && trimmingContainer.clientHeight > 0 ? trimmingContainer.clientHeight : Infinity;\n }\n\n return height;\n }\n }, {\n key: 'getWorkspaceWidth',\n value: function getWorkspaceWidth() {\n var width = void 0;\n var totalColumns = this.wot.getSetting('totalColumns');\n var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;\n var overflow = void 0;\n var stretchSetting = this.wot.getSetting('stretchH');\n var docOffsetWidth = document.documentElement.offsetWidth;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow) {\n return (0, _element.outerWidth)(this.instance.wtTable.wtRootElement);\n }\n\n if (this.wot.getSetting('freezeOverlays')) {\n width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n } else {\n width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n }\n\n if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {\n // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window\n // otherwise continue below, which will allow stretching\n // this is used in `scroll_window.html`\n // TODO test me\n return document.documentElement.clientWidth;\n }\n\n if (trimmingContainer !== window) {\n overflow = (0, _element.getStyle)(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');\n\n if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {\n // this is used in `scroll.html`\n // TODO test me\n return Math.max(width, trimmingContainer.clientWidth);\n }\n }\n\n if (stretchSetting === 'none' || !stretchSetting) {\n // if no stretching is used, return the maximum used workspace width\n return Math.max(width, (0, _element.outerWidth)(this.instance.wtTable.TABLE));\n }\n // if stretching is used, return the actual container width, so the columns can fit inside it\n return width;\n }\n\n /**\n * Checks if viewport has vertical scroll\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasVerticalScroll',\n value: function hasVerticalScroll() {\n return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();\n }\n\n /**\n * Checks if viewport has horizontal scroll\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'hasHorizontalScroll',\n value: function hasHorizontalScroll() {\n return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();\n }\n\n /**\n * @param from\n * @param length\n * @returns {Number}\n */\n\n }, {\n key: 'sumColumnWidths',\n value: function sumColumnWidths(from, length) {\n var sum = 0;\n\n while (from < length) {\n sum += this.wot.wtTable.getColumnWidth(from);\n from++;\n }\n\n return sum;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getContainerFillWidth',\n value: function getContainerFillWidth() {\n if (this.containerWidth) {\n return this.containerWidth;\n }\n var mainContainer = this.instance.wtTable.holder;\n var fillWidth = void 0;\n var dummyElement = void 0;\n\n dummyElement = document.createElement('div');\n dummyElement.style.width = '100%';\n dummyElement.style.height = '1px';\n mainContainer.appendChild(dummyElement);\n fillWidth = dummyElement.offsetWidth;\n\n this.containerWidth = fillWidth;\n mainContainer.removeChild(dummyElement);\n\n return fillWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceOffset',\n value: function getWorkspaceOffset() {\n return (0, _element.offset)(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceActualHeight',\n value: function getWorkspaceActualHeight() {\n return (0, _element.outerHeight)(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getWorkspaceActualWidth',\n value: function getWorkspaceActualWidth() {\n return (0, _element.outerWidth)(this.wot.wtTable.TABLE) || (0, _element.outerWidth)(this.wot.wtTable.TBODY) || (0, _element.outerWidth)(this.wot.wtTable.THEAD); // IE8 reports 0 as <table> offsetWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight() {\n if (isNaN(this.columnHeaderHeight)) {\n this.columnHeaderHeight = (0, _element.outerHeight)(this.wot.wtTable.THEAD);\n }\n\n return this.columnHeaderHeight;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getViewportHeight',\n value: function getViewportHeight() {\n var containerHeight = this.getWorkspaceHeight();\n var columnHeaderHeight = void 0;\n\n if (containerHeight === Infinity) {\n return containerHeight;\n }\n columnHeaderHeight = this.getColumnHeaderHeight();\n\n if (columnHeaderHeight > 0) {\n containerHeight -= columnHeaderHeight;\n }\n\n return containerHeight;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeaderWidth',\n value: function getRowHeaderWidth() {\n var rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');\n var rowHeaders = this.instance.getSetting('rowHeaders');\n\n if (rowHeadersHeightSetting) {\n this.rowHeaderWidth = 0;\n\n for (var i = 0, len = rowHeaders.length; i < len; i++) {\n this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;\n }\n }\n\n if (this.wot.cloneSource) {\n return this.wot.cloneSource.wtViewport.getRowHeaderWidth();\n }\n\n if (isNaN(this.rowHeaderWidth)) {\n\n if (rowHeaders.length) {\n var TH = this.instance.wtTable.TABLE.querySelector('TH');\n this.rowHeaderWidth = 0;\n\n for (var _i = 0, _len = rowHeaders.length; _i < _len; _i++) {\n if (TH) {\n this.rowHeaderWidth += (0, _element.outerWidth)(TH);\n TH = TH.nextSibling;\n } else {\n // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.\n // TODO: proper fix\n this.rowHeaderWidth += 50;\n }\n }\n } else {\n this.rowHeaderWidth = 0;\n }\n }\n\n this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;\n\n return this.rowHeaderWidth;\n }\n\n /**\n * @returns {Number}\n */\n\n }, {\n key: 'getViewportWidth',\n value: function getViewportWidth() {\n var containerWidth = this.getWorkspaceWidth();\n var rowHeaderWidth = void 0;\n\n if (containerWidth === Infinity) {\n return containerWidth;\n }\n rowHeaderWidth = this.getRowHeaderWidth();\n\n if (rowHeaderWidth > 0) {\n return containerWidth - rowHeaderWidth;\n }\n\n return containerWidth;\n }\n\n /**\n * Creates:\n * - rowsRenderCalculator (before draw, to qualify rows for rendering)\n * - rowsVisibleCalculator (after draw, to measure which rows are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: 'createRowsCalculator',\n value: function createRowsCalculator() {\n var _this2 = this;\n\n var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var height = void 0;\n var pos = void 0;\n var fixedRowsTop = void 0;\n var scrollbarHeight = void 0;\n var fixedRowsBottom = void 0;\n var fixedRowsHeight = void 0;\n var totalRows = void 0;\n\n this.rowHeaderWidth = NaN;\n\n if (this.wot.wtSettings.settings.renderAllRows) {\n height = Infinity;\n } else {\n height = this.getViewportHeight();\n }\n pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n totalRows = this.wot.getSetting('totalRows');\n\n if (fixedRowsTop) {\n fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);\n pos += fixedRowsHeight;\n height -= fixedRowsHeight;\n }\n\n if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {\n fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n\n height -= fixedRowsHeight;\n }\n\n if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {\n scrollbarHeight = 0;\n } else {\n scrollbarHeight = (0, _element.getScrollbarWidth)();\n }\n\n return new _viewportRows2.default(height, pos, this.wot.getSetting('totalRows'), function (sourceRow) {\n return _this2.wot.wtTable.getRowHeight(sourceRow);\n }, visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight);\n }\n\n /**\n * Creates:\n * - columnsRenderCalculator (before draw, to qualify columns for rendering)\n * - columnsVisibleCalculator (after draw, to measure which columns are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: 'createColumnsCalculator',\n value: function createColumnsCalculator() {\n var _this3 = this;\n\n var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var width = this.getViewportWidth();\n var pos = void 0;\n var fixedColumnsLeft = void 0;\n\n this.columnHeaderHeight = NaN;\n\n pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n\n if (fixedColumnsLeft) {\n var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);\n pos += fixedColumnsWidth;\n width -= fixedColumnsWidth;\n }\n if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {\n width -= (0, _element.getScrollbarWidth)();\n }\n\n return new _viewportColumns2.default(width, pos, this.wot.getSetting('totalColumns'), function (sourceCol) {\n return _this3.wot.wtTable.getColumnWidth(sourceCol);\n }, visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH'), function (stretchedWidth, column) {\n return _this3.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);\n });\n }\n\n /**\n * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and\n * cols should be rendered)\n *\n * @param fastDraw {Boolean} If `true`, will try to avoid full redraw and only update the border positions.\n * If `false` or `undefined`, will perform a full redraw\n * @returns fastDraw {Boolean} The fastDraw value, possibly modified\n */\n\n }, {\n key: 'createRenderCalculators',\n value: function createRenderCalculators() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (fastDraw) {\n var proposedRowsVisibleCalculator = this.createRowsCalculator(true);\n var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);\n\n if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {\n fastDraw = false;\n }\n }\n\n if (!fastDraw) {\n this.rowsRenderCalculator = this.createRowsCalculator();\n this.columnsRenderCalculator = this.createColumnsCalculator();\n }\n // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n return fastDraw;\n }\n\n /**\n * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are\n * the actually visible rows and columns)\n */\n\n }, {\n key: 'createVisibleCalculators',\n value: function createVisibleCalculators() {\n this.rowsVisibleCalculator = this.createRowsCalculator(true);\n this.columnsVisibleCalculator = this.createColumnsCalculator(true);\n }\n\n /**\n * Returns information whether proposedRowsVisibleCalculator viewport\n * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator)\n *\n * @param {Object} proposedRowsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed)\n */\n\n }, {\n key: 'areAllProposedVisibleRowsAlreadyRendered',\n value: function areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {\n if (this.rowsVisibleCalculator) {\n if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0) {\n return false;\n } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1) {\n return false;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Returns information whether proposedColumnsVisibleCalculator viewport\n * is contained inside column rendered in previous draw (cached in columnsRenderCalculator)\n *\n * @param {Object} proposedColumnsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed)\n */\n\n }, {\n key: 'areAllProposedVisibleColumnsAlreadyRendered',\n value: function areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {\n if (this.columnsVisibleCalculator) {\n if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0) {\n return false;\n } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1) {\n return false;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.\n */\n\n }, {\n key: 'resetHasOversizedColumnHeadersMarked',\n value: function resetHasOversizedColumnHeadersMarked() {\n (0, _object.objectEach)(this.hasOversizedColumnHeadersMarked, function (value, key, object) {\n object[key] = void 0;\n });\n }\n }]);\n\n return Viewport;\n}();\n\nexports.default = Viewport;\n\n/***/ }),\n/* 147 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _mixed = __webpack_require__(20);\n\nvar _string = __webpack_require__(27);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _handsontableEditor = __webpack_require__(148);\n\nvar _handsontableEditor2 = _interopRequireDefault(_handsontableEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AutocompleteEditor = _handsontableEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor AutocompleteEditor\n * @class AutocompleteEditor\n * @dependencies HandsontableEditor\n */\nAutocompleteEditor.prototype.init = function () {\n _handsontableEditor2.default.prototype.init.apply(this, arguments);\n this.query = null;\n this.strippedChoices = [];\n this.rawChoices = [];\n};\n\nAutocompleteEditor.prototype.getValue = function () {\n var _this2 = this;\n\n var selectedValue = this.rawChoices.find(function (value) {\n var strippedValue = _this2.stripValueIfNeeded(value);\n\n return strippedValue === _this2.TEXTAREA.value;\n });\n\n if ((0, _mixed.isDefined)(selectedValue)) {\n return selectedValue;\n }\n\n return this.TEXTAREA.value;\n};\n\nAutocompleteEditor.prototype.createElements = function () {\n _handsontableEditor2.default.prototype.createElements.apply(this, arguments);\n\n (0, _element.addClass)(this.htContainer, 'autocompleteEditor');\n (0, _element.addClass)(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');\n};\n\nvar skipOne = false;\nfunction onBeforeKeyDown(event) {\n skipOne = false;\n var editor = this.getActiveEditor();\n\n if ((0, _unicode.isPrintableChar)(event.keyCode) || event.keyCode === _unicode.KEY_CODES.BACKSPACE || event.keyCode === _unicode.KEY_CODES.DELETE || event.keyCode === _unicode.KEY_CODES.INSERT) {\n var timeOffset = 0;\n\n // on ctl+c / cmd+c don't update suggestion list\n if (event.keyCode === _unicode.KEY_CODES.C && (event.ctrlKey || event.metaKey)) {\n return;\n }\n if (!editor.isOpened()) {\n timeOffset += 10;\n }\n\n if (editor.htEditor) {\n editor.instance._registerTimeout(setTimeout(function () {\n editor.queryChoices(editor.TEXTAREA.value);\n skipOne = true;\n }, timeOffset));\n }\n }\n}\n\nAutocompleteEditor.prototype.prepare = function () {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n _handsontableEditor2.default.prototype.prepare.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.open = function () {\n // Ugly fix for handsontable which grab window object for autocomplete scroll listener instead table element.\n this.TEXTAREA_PARENT.style.overflow = 'auto';\n _handsontableEditor2.default.prototype.open.apply(this, arguments);\n this.TEXTAREA_PARENT.style.overflow = '';\n\n var choicesListHot = this.htEditor.getInstance();\n var _this = this;\n var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;\n\n this.TEXTAREA.style.visibility = 'visible';\n this.focus();\n\n choicesListHot.updateSettings({\n colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : void 0,\n width: trimDropdown ? (0, _element.outerWidth)(this.TEXTAREA) + (0, _element.getScrollbarWidth)() + 2 : void 0,\n afterRenderer: function afterRenderer(TD, row, col, prop, value, cellProperties) {\n var _this$cellProperties = _this.cellProperties,\n filteringCaseSensitive = _this$cellProperties.filteringCaseSensitive,\n allowHtml = _this$cellProperties.allowHtml;\n\n var indexOfMatch = void 0;\n var match = void 0;\n\n value = (0, _mixed.stringify)(value);\n\n if (value && !allowHtml) {\n indexOfMatch = filteringCaseSensitive === true ? value.indexOf(this.query) : value.toLowerCase().indexOf(_this.query.toLowerCase());\n\n if (indexOfMatch !== -1) {\n match = value.substr(indexOfMatch, _this.query.length);\n value = value.replace(match, '<strong>' + match + '</strong>');\n }\n }\n TD.innerHTML = value;\n },\n\n autoColumnSize: true,\n modifyColWidth: function modifyColWidth(width, col) {\n // workaround for <strong> text overlapping the dropdown, not really accurate\n var autoWidths = this.getPlugin('autoColumnSize').widths;\n\n if (autoWidths[col]) {\n width = autoWidths[col];\n }\n\n return trimDropdown ? width : width + 15;\n }\n });\n\n // Add additional space for autocomplete holder\n this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = (0, _element.getScrollbarWidth)() + 2 + 'px';\n\n if (skipOne) {\n skipOne = false;\n }\n\n _this.instance._registerTimeout(setTimeout(function () {\n _this.queryChoices(_this.TEXTAREA.value);\n }, 0));\n};\n\nAutocompleteEditor.prototype.close = function () {\n _handsontableEditor2.default.prototype.close.apply(this, arguments);\n};\nAutocompleteEditor.prototype.queryChoices = function (query) {\n var _this3 = this;\n\n this.query = query;\n var source = this.cellProperties.source;\n\n if (typeof source == 'function') {\n source.call(this.cellProperties, query, function (choices) {\n _this3.rawChoices = choices;\n _this3.updateChoicesList(_this3.stripValuesIfNeeded(choices));\n });\n } else if (Array.isArray(source)) {\n this.rawChoices = source;\n this.updateChoicesList(this.stripValuesIfNeeded(source));\n } else {\n this.updateChoicesList([]);\n }\n};\n\nAutocompleteEditor.prototype.updateChoicesList = function (choices) {\n var pos = (0, _element.getCaretPosition)(this.TEXTAREA);\n var endPos = (0, _element.getSelectionEndPosition)(this.TEXTAREA);\n var sortByRelevanceSetting = this.cellProperties.sortByRelevance;\n var filterSetting = this.cellProperties.filter;\n var orderByRelevance = null;\n var highlightIndex = null;\n\n if (sortByRelevanceSetting) {\n orderByRelevance = AutocompleteEditor.sortByRelevance(this.stripValueIfNeeded(this.getValue()), choices, this.cellProperties.filteringCaseSensitive);\n }\n var orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;\n\n if (filterSetting === false) {\n if (orderByRelevanceLength) {\n highlightIndex = orderByRelevance[0];\n }\n } else {\n var sorted = [];\n\n for (var i = 0, choicesCount = choices.length; i < choicesCount; i++) {\n if (sortByRelevanceSetting && orderByRelevanceLength <= i) {\n break;\n }\n if (orderByRelevanceLength) {\n sorted.push(choices[orderByRelevance[i]]);\n } else {\n sorted.push(choices[i]);\n }\n }\n\n highlightIndex = 0;\n choices = sorted;\n }\n\n this.strippedChoices = choices;\n this.htEditor.loadData((0, _array.pivot)([choices]));\n\n this.updateDropdownHeight();\n\n this.flipDropdownIfNeeded();\n\n if (this.cellProperties.strict === true) {\n this.highlightBestMatchingChoice(highlightIndex);\n }\n\n this.instance.listen();\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, pos, pos === endPos ? void 0 : endPos);\n};\n\nAutocompleteEditor.prototype.flipDropdownIfNeeded = function () {\n var textareaOffset = (0, _element.offset)(this.TEXTAREA);\n var textareaHeight = (0, _element.outerHeight)(this.TEXTAREA);\n var dropdownHeight = this.getDropdownHeight();\n var trimmingContainer = (0, _element.getTrimmingContainer)(this.instance.view.wt.wtTable.TABLE);\n var trimmingContainerScrollTop = trimmingContainer.scrollTop;\n var headersHeight = (0, _element.outerHeight)(this.instance.view.wt.wtTable.THEAD);\n var containerOffset = {\n row: 0,\n col: 0\n };\n\n if (trimmingContainer !== window) {\n containerOffset = (0, _element.offset)(trimmingContainer);\n }\n\n var spaceAbove = textareaOffset.top - containerOffset.top - headersHeight + trimmingContainerScrollTop;\n var spaceBelow = trimmingContainer.scrollHeight - spaceAbove - headersHeight - textareaHeight;\n var flipNeeded = dropdownHeight > spaceBelow && spaceAbove > spaceBelow;\n\n if (flipNeeded) {\n this.flipDropdown(dropdownHeight);\n } else {\n this.unflipDropdown();\n }\n\n this.limitDropdownIfNeeded(flipNeeded ? spaceAbove : spaceBelow, dropdownHeight);\n\n return flipNeeded;\n};\n\nAutocompleteEditor.prototype.limitDropdownIfNeeded = function (spaceAvailable, dropdownHeight) {\n if (dropdownHeight > spaceAvailable) {\n var tempHeight = 0;\n var i = 0;\n var lastRowHeight = 0;\n var height = null;\n\n do {\n lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view.wt.wtSettings.settings.defaultRowHeight;\n tempHeight += lastRowHeight;\n i++;\n } while (tempHeight < spaceAvailable);\n\n height = tempHeight - lastRowHeight;\n\n if (this.htEditor.flipped) {\n this.htEditor.rootElement.style.top = parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height + 'px';\n }\n\n this.setDropdownHeight(tempHeight - lastRowHeight);\n }\n};\n\nAutocompleteEditor.prototype.flipDropdown = function (dropdownHeight) {\n var dropdownStyle = this.htEditor.rootElement.style;\n\n dropdownStyle.position = 'absolute';\n dropdownStyle.top = -dropdownHeight + 'px';\n\n this.htEditor.flipped = true;\n};\n\nAutocompleteEditor.prototype.unflipDropdown = function () {\n var dropdownStyle = this.htEditor.rootElement.style;\n\n if (dropdownStyle.position === 'absolute') {\n dropdownStyle.position = '';\n dropdownStyle.top = '';\n }\n\n this.htEditor.flipped = void 0;\n};\n\nAutocompleteEditor.prototype.updateDropdownHeight = function () {\n var currentDropdownWidth = this.htEditor.getColWidth(0) + (0, _element.getScrollbarWidth)() + 2;\n var trimDropdown = this.cellProperties.trimDropdown;\n\n this.htEditor.updateSettings({\n height: this.getDropdownHeight(),\n width: trimDropdown ? void 0 : currentDropdownWidth\n });\n\n this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer();\n};\n\nAutocompleteEditor.prototype.setDropdownHeight = function (height) {\n this.htEditor.updateSettings({\n height: height\n });\n};\n\nAutocompleteEditor.prototype.finishEditing = function (restoreOriginalValue) {\n if (!restoreOriginalValue) {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n }\n _handsontableEditor2.default.prototype.finishEditing.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.highlightBestMatchingChoice = function (index) {\n if (typeof index === 'number') {\n this.htEditor.selectCell(index, 0);\n } else {\n this.htEditor.deselectCell();\n }\n};\n\n/**\n * Filters and sorts by relevance\n * @param value\n * @param choices\n * @param caseSensitive\n * @returns {Array} array of indexes in original choices array\n */\nAutocompleteEditor.sortByRelevance = function (value, choices, caseSensitive) {\n var choicesRelevance = [];\n var currentItem = void 0;\n var valueLength = value.length;\n var valueIndex = void 0;\n var charsLeft = void 0;\n var result = [];\n var i = void 0;\n var choicesCount = choices.length;\n\n if (valueLength === 0) {\n for (i = 0; i < choicesCount; i++) {\n result.push(i);\n }\n return result;\n }\n\n for (i = 0; i < choicesCount; i++) {\n currentItem = (0, _string.stripTags)((0, _mixed.stringify)(choices[i]));\n\n if (caseSensitive) {\n valueIndex = currentItem.indexOf(value);\n } else {\n valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());\n }\n\n if (valueIndex !== -1) {\n charsLeft = currentItem.length - valueIndex - valueLength;\n\n choicesRelevance.push({\n baseIndex: i,\n index: valueIndex,\n charsLeft: charsLeft,\n value: currentItem\n });\n }\n }\n\n choicesRelevance.sort(function (a, b) {\n\n if (b.index === -1) {\n return -1;\n }\n if (a.index === -1) {\n return 1;\n }\n\n if (a.index < b.index) {\n return -1;\n } else if (b.index < a.index) {\n return 1;\n } else if (a.index === b.index) {\n if (a.charsLeft < b.charsLeft) {\n return -1;\n } else if (a.charsLeft > b.charsLeft) {\n return 1;\n }\n }\n\n return 0;\n });\n\n for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {\n result.push(choicesRelevance[i].baseIndex);\n }\n\n return result;\n};\n\nAutocompleteEditor.prototype.getDropdownHeight = function () {\n var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23;\n var visibleRows = this.cellProperties.visibleRows;\n\n return this.strippedChoices.length >= visibleRows ? visibleRows * firstRowHeight : this.strippedChoices.length * firstRowHeight + 8;\n};\n\nAutocompleteEditor.prototype.stripValueIfNeeded = function (value) {\n return this.stripValuesIfNeeded([value])[0];\n};\n\nAutocompleteEditor.prototype.stripValuesIfNeeded = function (values) {\n var allowHtml = this.cellProperties.allowHtml;\n\n\n var stringifiedValues = (0, _array.arrayMap)(values, function (value) {\n return (0, _mixed.stringify)(value);\n });\n var strippedValues = (0, _array.arrayMap)(stringifiedValues, function (value) {\n return allowHtml ? value : (0, _string.stripTags)(value);\n });\n\n return strippedValues;\n};\n\nAutocompleteEditor.prototype.allowKeyEventPropagation = function (keyCode) {\n var selected = { row: this.htEditor.getSelectedRange() ? this.htEditor.getSelectedRange().from.row : -1 };\n var allowed = false;\n\n if (keyCode === _unicode.KEY_CODES.ARROW_DOWN && selected.row > 0 && selected.row < this.htEditor.countRows() - 1) {\n allowed = true;\n }\n if (keyCode === _unicode.KEY_CODES.ARROW_UP && selected.row > -1) {\n allowed = true;\n }\n\n return allowed;\n};\n\nAutocompleteEditor.prototype.discardEditor = function (result) {\n _handsontableEditor2.default.prototype.discardEditor.apply(this, arguments);\n\n this.instance.view.render();\n};\n\nexports.default = AutocompleteEditor;\n\n/***/ }),\n/* 148 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _object = __webpack_require__(2);\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HandsontableEditor = _textEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor HandsontableEditor\n * @class HandsontableEditor\n * @dependencies TextEditor\n */\nHandsontableEditor.prototype.createElements = function () {\n _textEditor2.default.prototype.createElements.apply(this, arguments);\n\n var DIV = document.createElement('DIV');\n DIV.className = 'handsontableEditor';\n this.TEXTAREA_PARENT.appendChild(DIV);\n\n this.htContainer = DIV;\n this.assignHooks();\n};\n\nHandsontableEditor.prototype.prepare = function (td, row, col, prop, value, cellProperties) {\n _textEditor2.default.prototype.prepare.apply(this, arguments);\n\n var parent = this;\n var options = {\n startRows: 0,\n startCols: 0,\n minRows: 0,\n minCols: 0,\n className: 'listbox',\n copyPaste: false,\n autoColumnSize: false,\n autoRowSize: false,\n readOnly: true,\n fillHandle: false,\n afterOnCellMouseDown: function afterOnCellMouseDown(_, coords) {\n var value = this.getSourceData(coords.row, coords.col);\n\n // if the value is undefined then it means we don't want to set the value\n if (value !== void 0) {\n parent.setValue(value);\n }\n parent.instance.destroyEditor();\n }\n };\n\n if (this.cellProperties.handsontable) {\n (0, _object.extend)(options, cellProperties.handsontable);\n }\n this.htOptions = options;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n var editor = this.getActiveEditor();\n\n var innerHOT = editor.htEditor.getInstance();\n\n var rowToSelect;\n var selectedRow;\n\n if (event.keyCode == _unicode.KEY_CODES.ARROW_DOWN) {\n if (!innerHOT.getSelected() && !innerHOT.flipped) {\n rowToSelect = 0;\n } else if (innerHOT.getSelected()) {\n if (innerHOT.flipped) {\n rowToSelect = innerHOT.getSelected()[0] + 1;\n } else if (!innerHOT.flipped) {\n selectedRow = innerHOT.getSelected()[0];\n var lastRow = innerHOT.countRows() - 1;\n rowToSelect = Math.min(lastRow, selectedRow + 1);\n }\n }\n } else if (event.keyCode == _unicode.KEY_CODES.ARROW_UP) {\n if (!innerHOT.getSelected() && innerHOT.flipped) {\n rowToSelect = innerHOT.countRows() - 1;\n } else if (innerHOT.getSelected()) {\n if (innerHOT.flipped) {\n selectedRow = innerHOT.getSelected()[0];\n rowToSelect = Math.max(0, selectedRow - 1);\n } else {\n selectedRow = innerHOT.getSelected()[0];\n rowToSelect = selectedRow - 1;\n }\n }\n }\n\n if (rowToSelect !== void 0) {\n if (rowToSelect < 0 || innerHOT.flipped && rowToSelect > innerHOT.countRows() - 1) {\n innerHOT.deselectCell();\n } else {\n innerHOT.selectCell(rowToSelect, 0);\n }\n if (innerHOT.getData().length) {\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n\n editor.instance.listen();\n editor.TEXTAREA.focus();\n }\n }\n};\n\nHandsontableEditor.prototype.open = function () {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n\n _textEditor2.default.prototype.open.apply(this, arguments);\n\n if (this.htEditor) {\n this.htEditor.destroy();\n }\n this.htEditor = new Handsontable(this.htContainer, this.htOptions);\n\n if (this.cellProperties.strict) {\n this.htEditor.selectCell(0, 0);\n this.TEXTAREA.style.visibility = 'hidden';\n } else {\n this.htEditor.deselectCell();\n this.TEXTAREA.style.visibility = 'visible';\n }\n\n (0, _element.setCaretPosition)(this.TEXTAREA, 0, this.TEXTAREA.value.length);\n};\n\nHandsontableEditor.prototype.close = function () {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n this.instance.listen();\n\n _textEditor2.default.prototype.close.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.focus = function () {\n this.instance.listen();\n _textEditor2.default.prototype.focus.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.beginEditing = function (initialValue) {\n var onBeginEditing = this.instance.getSettings().onBeginEditing;\n\n if (onBeginEditing && onBeginEditing() === false) {\n return;\n }\n _textEditor2.default.prototype.beginEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.finishEditing = function (isCancelled, ctrlDown) {\n if (this.htEditor && this.htEditor.isListening()) {\n // if focus is still in the HOT editor\n\n this.instance.listen(); // return the focus to the parent HOT instance\n }\n\n if (this.htEditor && this.htEditor.getSelected()) {\n var value = this.htEditor.getInstance().getValue();\n\n if (value !== void 0) {\n // if the value is undefined then it means we don't want to set the value\n this.setValue(value);\n }\n }\n\n return _textEditor2.default.prototype.finishEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.assignHooks = function () {\n var _this = this;\n\n this.instance.addHook('afterDestroy', function () {\n if (_this.htEditor) {\n _this.htEditor.destroy();\n }\n });\n};\n\nexports.default = HandsontableEditor;\n\n/***/ }),\n/* 149 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar MIXIN_NAME = 'arrayMapper';\n\n/**\n * @type {Object}\n */\nvar arrayMapper = {\n _arrayMap: [],\n\n /**\n * Get value by map index.\n *\n * @param {Number} index Array index.\n * @return {*} Returns value mapped to passed index.\n */\n getValueByIndex: function getValueByIndex(index) {\n var value = void 0;\n\n /* eslint-disable no-cond-assign */\n return (value = this._arrayMap[index]) === void 0 ? null : value;\n },\n\n\n /**\n * Get map index by its value.\n *\n * @param {*} value Value to search.\n * @returns {Number} Returns array index.\n */\n getIndexByValue: function getIndexByValue(value) {\n var index = void 0;\n\n /* eslint-disable no-cond-assign */\n return (index = this._arrayMap.indexOf(value)) === -1 ? null : index;\n },\n\n\n /**\n * Insert new items to array mapper starting at passed index. New entries will be a continuation of last value in the array.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns added items.\n */\n insertItems: function insertItems(index) {\n var _this = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var newIndex = (0, _array.arrayMax)(this._arrayMap) + 1;\n var addedItems = [];\n\n (0, _number.rangeEach)(amount - 1, function (count) {\n addedItems.push(_this._arrayMap.splice(index + count, 0, newIndex + count));\n });\n\n return addedItems;\n },\n\n\n /**\n * Remove items from array mapper.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns removed items.\n */\n removeItems: function removeItems(index) {\n var _this2 = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var removedItems = [];\n\n if (Array.isArray(index)) {\n var mapCopy = [].concat(this._arrayMap);\n\n // Sort descending\n index.sort(function (a, b) {\n return b - a;\n });\n\n removedItems = (0, _array.arrayReduce)(index, function (acc, item) {\n _this2._arrayMap.splice(item, 1);\n\n return acc.concat(mapCopy.slice(item, item + 1));\n }, []);\n } else {\n removedItems = this._arrayMap.splice(index, amount);\n }\n\n return removedItems;\n },\n\n\n /**\n * Unshift items (remove and shift chunk of array to the left).\n *\n * @param {Number|Array} index Array index or Array of indexes to unshift.\n * @param {Number} [amount=1] Defines how many items will be removed from an array (when index is passed as number).\n */\n unshiftItems: function unshiftItems(index) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var removedItems = this.removeItems(index, amount);\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return (0, _array.arrayReduce)(removedItems, function (count, removedLogicalRow) {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this._arrayMap = (0, _array.arrayMap)(this._arrayMap, function (logicalRow, physicalRow) {\n var rowShift = countRowShift(logicalRow);\n\n if (rowShift) {\n logicalRow -= rowShift;\n }\n\n return logicalRow;\n });\n },\n\n\n /**\n * Shift (right shifting) items starting at passed index.\n *\n * @param {Number} index Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n */\n shiftItems: function shiftItems(index) {\n var _this3 = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this._arrayMap = (0, _array.arrayMap)(this._arrayMap, function (row) {\n if (row >= index) {\n row += amount;\n }\n\n return row;\n });\n\n (0, _number.rangeEach)(amount - 1, function (count) {\n _this3._arrayMap.splice(index + count, 0, index + count);\n });\n },\n\n\n /**\n * Clear all stored index<->value information from an array.\n */\n clearMap: function clearMap() {\n this._arrayMap.length = 0;\n }\n};\n\n(0, _object.defineGetter)(arrayMapper, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\n\nexports.default = arrayMapper;\n\n/***/ }),\n/* 150 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar MIXIN_NAME = 'localHooks';\n\n/**\n * Mixin object to extend objects functionality for local hooks.\n *\n * @type {Object}\n */\nvar localHooks = {\n /**\n * Internal hooks storage.\n */\n _localHooks: Object.create(null),\n\n /**\n * Add hook to the collection.\n *\n * @param {String} key Hook name.\n * @param {Function} callback Hook callback\n */\n addLocalHook: function addLocalHook(key, callback) {\n if (!this._localHooks[key]) {\n this._localHooks[key] = [];\n }\n this._localHooks[key].push(callback);\n },\n\n\n /**\n * Run hooks.\n *\n * @param {String} key Hook name.\n * @param {*} params\n */\n runLocalHooks: function runLocalHooks(key) {\n var _this = this;\n\n for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n if (this._localHooks[key]) {\n (0, _array.arrayEach)(this._localHooks[key], function (callback) {\n return callback.apply(_this, params);\n });\n }\n },\n\n\n /**\n * Clear all added hooks.\n */\n clearLocalHooks: function clearLocalHooks() {\n this._localHooks = {};\n }\n};\n\n(0, _object.defineGetter)(localHooks, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\n\nexports.default = localHooks;\n\n/***/ }),\n/* 151 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar STATE_INITIALIZED = 0;\nvar STATE_BUILT = 1;\nvar STATE_APPENDED = 2;\nvar UNIT = 'px';\n\n/**\n * @class\n * @private\n */\n\nvar BaseUI = function () {\n function BaseUI(hotInstance) {\n _classCallCheck(this, BaseUI);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n\n\n _createClass(BaseUI, [{\n key: 'appendTo',\n value: function appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n\n }, {\n key: 'build',\n value: function build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAppended',\n value: function isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isBuilt',\n value: function isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(top, left) {\n if ((0, _number.isNumeric)(top)) {\n this._element.style.top = top + UNIT;\n }\n if ((0, _number.isNumeric)(left)) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n\n }, {\n key: 'getPosition',\n value: function getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if ((0, _number.isNumeric)(width)) {\n this._element.style.width = width + UNIT;\n }\n if ((0, _number.isNumeric)(height)) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n\n }, {\n key: 'getSize',\n value: function getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(top, left) {\n if ((0, _number.isNumeric)(top)) {\n this._element.style.marginTop = top + UNIT;\n }\n if ((0, _number.isNumeric)(left)) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n\n }, {\n key: 'getOffset',\n value: function getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n }]);\n\n return BaseUI;\n}();\n\nexports.default = BaseUI;\n\n/***/ }),\n/* 152 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar STATE_INITIALIZED = 0;\nvar STATE_BUILT = 1;\nvar STATE_APPENDED = 2;\nvar UNIT = 'px';\n\n/**\n * @class\n * @private\n */\n\nvar BaseUI = function () {\n function BaseUI(hotInstance) {\n _classCallCheck(this, BaseUI);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n\n\n _createClass(BaseUI, [{\n key: 'appendTo',\n value: function appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n\n }, {\n key: 'build',\n value: function build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAppended',\n value: function isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isBuilt',\n value: function isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(top, left) {\n if (top) {\n this._element.style.top = top + UNIT;\n }\n if (left) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n\n }, {\n key: 'getPosition',\n value: function getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if (width) {\n this._element.style.width = width + UNIT;\n }\n if (height) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n\n }, {\n key: 'getSize',\n value: function getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(top, left) {\n if (top) {\n this._element.style.marginTop = top + UNIT;\n }\n if (left) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n\n }, {\n key: 'getOffset',\n value: function getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n }]);\n\n return BaseUI;\n}();\n\nexports.default = BaseUI;\n\n/***/ }),\n/* 153 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.RecordTranslator = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports.registerIdentity = registerIdentity;\nexports.getTranslator = getTranslator;\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _object = __webpack_require__(2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RecordTranslator\n * @util\n */\nvar RecordTranslator = function () {\n function RecordTranslator(hot) {\n _classCallCheck(this, RecordTranslator);\n\n this.hot = hot;\n }\n\n /**\n * Translate physical row index into visual.\n *\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n\n\n _createClass(RecordTranslator, [{\n key: 'toVisualRow',\n value: function toVisualRow(row) {\n return this.hot.runHooks('unmodifyRow', row);\n }\n\n /**\n * Translate physical column index into visual.\n *\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n\n }, {\n key: 'toVisualColumn',\n value: function toVisualColumn(column) {\n return this.hot.runHooks('unmodifyCol', column);\n }\n\n /**\n * Translate physical coordinates into visual. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Physical coordinates or row index.\n * @param {Number} [column] Physical column index.\n * @returns {Object|Array} Returns an object with visual records or an array if coordinates passed as separate arguments.\n */\n\n }, {\n key: 'toVisual',\n value: function toVisual(row, column) {\n var result = void 0;\n\n if ((0, _object.isObject)(row)) {\n result = {\n row: this.toVisualRow(row.row),\n column: this.toVisualColumn(row.column)\n };\n } else {\n result = [this.toVisualRow(row), this.toVisualColumn(column)];\n }\n\n return result;\n }\n\n /**\n * Translate visual row index into physical.\n *\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n\n }, {\n key: 'toPhysicalRow',\n value: function toPhysicalRow(row) {\n return this.hot.runHooks('modifyRow', row);\n }\n\n /**\n * Translate visual column index into physical.\n *\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n\n }, {\n key: 'toPhysicalColumn',\n value: function toPhysicalColumn(column) {\n return this.hot.runHooks('modifyCol', column);\n }\n\n /**\n * Translate visual coordinates into physical. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Visual coordinates or row index.\n * @param {Number} [column] Visual column index.\n * @returns {Object|Array} Returns an object with physical records or an array if coordinates passed as separate arguments.\n */\n\n }, {\n key: 'toPhysical',\n value: function toPhysical(row, column) {\n var result = void 0;\n\n if ((0, _object.isObject)(row)) {\n result = {\n row: this.toPhysicalRow(row.row),\n column: this.toPhysicalColumn(row.column)\n };\n } else {\n result = [this.toPhysicalRow(row), this.toPhysicalColumn(column)];\n }\n\n return result;\n }\n }]);\n\n return RecordTranslator;\n}();\n\nexports.RecordTranslator = RecordTranslator;\n\n\nvar identities = new WeakMap();\nvar translatorSingletons = new WeakMap();\n\nfunction registerIdentity(identity, hot) {\n identities.set(identity, hot);\n}\n\nfunction getTranslator(identity) {\n var singleton = void 0;\n\n if (!(identity instanceof _core2.default)) {\n if (!identities.has(identity)) {\n throw Error('Record translator was not registered for this object identity');\n }\n identity = identities.get(identity);\n }\n if (translatorSingletons.has(identity)) {\n singleton = translatorSingletons.get(identity);\n } else {\n singleton = new RecordTranslator(identity);\n translatorSingletons.set(identity, singleton);\n }\n\n return singleton;\n}\n\n/***/ }),\n/* 154 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _mixed = __webpack_require__(20);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class SamplesGenerator\n * @util\n */\nvar SamplesGenerator = function () {\n _createClass(SamplesGenerator, null, [{\n key: 'SAMPLE_COUNT',\n\n /**\n * Number of samples to take of each value length.\n *\n * @type {Number}\n */\n get: function get() {\n return 3;\n }\n }]);\n\n function SamplesGenerator(dataFactory) {\n _classCallCheck(this, SamplesGenerator);\n\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Function which give the data to collect samples.\n *\n * @type {Function}\n */\n this.dataFactory = dataFactory;\n /**\n * Custom number of samples to take of each value length.\n *\n * @type {Number}\n * @default {null}\n */\n this.customSampleCount = null;\n /**\n * `true` if duplicate samples collection should be allowed, `false` otherwise.\n *\n * @type {Boolean}\n * @default {false}\n */\n this.allowDuplicates = false;\n }\n\n /**\n * Get the sample count for this instance.\n *\n * @returns {Number}\n */\n\n\n _createClass(SamplesGenerator, [{\n key: 'getSampleCount',\n value: function getSampleCount() {\n if (this.customSampleCount) {\n return this.customSampleCount;\n }\n return SamplesGenerator.SAMPLE_COUNT;\n }\n }, {\n key: 'setSampleCount',\n\n\n /**\n * Set the sample count.\n *\n * @param {Number} sampleCount Number of samples to be collected.\n */\n value: function setSampleCount(sampleCount) {\n this.customSampleCount = sampleCount;\n }\n\n /**\n * Set if the generator should accept duplicate values.\n *\n * @param {Boolean} allowDuplicates `true` to allow duplicate values.\n */\n\n }, {\n key: 'setAllowDuplicates',\n value: function setAllowDuplicates(allowDuplicates) {\n this.allowDuplicates = allowDuplicates;\n }\n\n /**\n * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.\n *\n * @param {Object|Number} rowRange\n * @param {Object} colRange\n * @returns {Object}\n */\n\n }, {\n key: 'generateRowSamples',\n value: function generateRowSamples(rowRange, colRange) {\n return this.generateSamples('row', colRange, rowRange);\n }\n\n /**\n * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object.\n *\n * @param {Object} colRange Column index.\n * @param {Object} rowRange Column index.\n * @returns {Object}\n */\n\n }, {\n key: 'generateColumnSamples',\n value: function generateColumnSamples(colRange, rowRange) {\n return this.generateSamples('col', rowRange, colRange);\n }\n\n /**\n * Generate collection of samples.\n *\n * @param {String} type Type to generate. Can be `col` or `row`.\n * @param {Object} range\n * @param {Object|Number} specifierRange\n * @returns {Map}\n */\n\n }, {\n key: 'generateSamples',\n value: function generateSamples(type, range, specifierRange) {\n var _this = this;\n\n var samples = new Map();\n\n if (typeof specifierRange === 'number') {\n specifierRange = { from: specifierRange, to: specifierRange };\n }\n (0, _number.rangeEach)(specifierRange.from, specifierRange.to, function (index) {\n var sample = _this.generateSample(type, range, index);\n\n samples.set(index, sample);\n });\n\n return samples;\n }\n\n /**\n * Generate sample for specified type (`row` or `col`).\n *\n * @param {String} type Samples type `row` or `col`.\n * @param {Object} range\n * @param {Number} specifierValue\n * @returns {Map}\n */\n\n }, {\n key: 'generateSample',\n value: function generateSample(type, range, specifierValue) {\n var _this2 = this;\n\n var samples = new Map();\n var sampledValues = [];\n var length = void 0;\n\n (0, _number.rangeEach)(range.from, range.to, function (index) {\n var value = void 0;\n\n if (type === 'row') {\n value = _this2.dataFactory(specifierValue, index);\n } else if (type === 'col') {\n value = _this2.dataFactory(index, specifierValue);\n } else {\n throw new Error('Unsupported sample type');\n }\n\n if ((0, _object.isObject)(value)) {\n length = Object.keys(value).length;\n } else if (Array.isArray(value)) {\n length = value.length;\n } else {\n length = (0, _mixed.stringify)(value).length;\n }\n\n if (!samples.has(length)) {\n samples.set(length, {\n needed: _this2.getSampleCount(),\n strings: []\n });\n }\n var sample = samples.get(length);\n\n if (sample.needed) {\n var duplicate = sampledValues.indexOf(value) > -1;\n\n if (!duplicate || _this2.allowDuplicates) {\n var computedKey = type === 'row' ? 'col' : 'row';\n\n sample.strings.push(_defineProperty({ value: value }, computedKey, index));\n sampledValues.push(value);\n sample.needed--;\n }\n }\n });\n\n return samples;\n }\n }]);\n\n return SamplesGenerator;\n}();\n\nexports.default = SamplesGenerator;\n\n/***/ }),\n/* 155 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(23)\n , toLength = __webpack_require__(24)\n , toIndex = __webpack_require__(60);\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n/***/ }),\n/* 156 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(38)\n , TAG = __webpack_require__(10)('toStringTag')\n // ES3 wrong here\n , ARG = cof(function(){ return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function(it, key){\n try {\n return it[key];\n } catch(e){ /* empty */ }\n};\n\nmodule.exports = function(it){\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n/***/ }),\n/* 157 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar dP = __webpack_require__(19).f\n , create = __webpack_require__(78)\n , redefineAll = __webpack_require__(59)\n , ctx = __webpack_require__(29)\n , anInstance = __webpack_require__(52)\n , defined = __webpack_require__(30)\n , forOf = __webpack_require__(56)\n , $iterDefine = __webpack_require__(166)\n , step = __webpack_require__(167)\n , setSpecies = __webpack_require__(172)\n , DESCRIPTORS = __webpack_require__(21)\n , fastKey = __webpack_require__(46).fastKey\n , SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function(that, key){\n // fast case\n var index = fastKey(key), entry;\n if(index !== 'F')return that._i[index];\n // frozen object case\n for(entry = that._f; entry; entry = entry.n){\n if(entry.k == key)return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n anInstance(that, C, NAME, '_i');\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear(){\n for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){\n entry.r = true;\n if(entry.p)entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function(key){\n var that = this\n , entry = getEntry(that, key);\n if(entry){\n var next = entry.n\n , prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if(prev)prev.n = next;\n if(next)next.p = prev;\n if(that._f == entry)that._f = next;\n if(that._l == entry)that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /*, that = undefined */){\n anInstance(this, C, 'forEach');\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)\n , entry;\n while(entry = entry ? entry.n : this._f){\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key){\n return !!getEntry(this, key);\n }\n });\n if(DESCRIPTORS)dP(C.prototype, 'size', {\n get: function(){\n return defined(this[SIZE]);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var entry = getEntry(that, key)\n , prev, index;\n // change existing entry\n if(entry){\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if(!that._f)that._f = entry;\n if(prev)prev.n = entry;\n that[SIZE]++;\n // add to index\n if(index !== 'F')that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function(C, NAME, IS_MAP){\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function(iterated, kind){\n this._t = iterated; // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function(){\n var that = this\n , kind = that._k\n , entry = that._l;\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n // get next entry\n if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if(kind == 'keys' )return step(0, entry.k);\n if(kind == 'values')return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n/***/ }),\n/* 158 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar redefineAll = __webpack_require__(59)\n , getWeak = __webpack_require__(46).getWeak\n , anObject = __webpack_require__(18)\n , isObject = __webpack_require__(15)\n , anInstance = __webpack_require__(52)\n , forOf = __webpack_require__(56)\n , createArrayMethod = __webpack_require__(53)\n , $has = __webpack_require__(22)\n , arrayFind = createArrayMethod(5)\n , arrayFindIndex = createArrayMethod(6)\n , id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function(that){\n return that._l || (that._l = new UncaughtFrozenStore);\n};\nvar UncaughtFrozenStore = function(){\n this.a = [];\n};\nvar findUncaughtFrozen = function(store, key){\n return arrayFind(store.a, function(it){\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function(key){\n var entry = findUncaughtFrozen(this, key);\n if(entry)return entry[1];\n },\n has: function(key){\n return !!findUncaughtFrozen(this, key);\n },\n set: function(key, value){\n var entry = findUncaughtFrozen(this, key);\n if(entry)entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function(key){\n var index = arrayFindIndex(this.a, function(it){\n return it[0] === key;\n });\n if(~index)this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n anInstance(that, C, NAME, '_i');\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function(key){\n if(!isObject(key))return false;\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this)['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key){\n if(!isObject(key))return false;\n var data = getWeak(key);\n if(data === true)return uncaughtFrozenStore(this).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var data = getWeak(anObject(key), true);\n if(data === true)uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n/***/ }),\n/* 159 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(13).document && document.documentElement;\n\n/***/ }),\n/* 160 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = !__webpack_require__(21) && !__webpack_require__(31)(function(){\n return Object.defineProperty(__webpack_require__(73)('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n/***/ }),\n/* 161 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// check on default Array iterator\nvar Iterators = __webpack_require__(45)\n , ITERATOR = __webpack_require__(10)('iterator')\n , ArrayProto = Array.prototype;\n\nmodule.exports = function(it){\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n/***/ }),\n/* 162 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(38);\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};\n\n/***/ }),\n/* 163 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(15)\n , floor = Math.floor;\nmodule.exports = function isInteger(it){\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n/***/ }),\n/* 164 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.2.8 IsRegExp(argument)\nvar isObject = __webpack_require__(15)\n , cof = __webpack_require__(38)\n , MATCH = __webpack_require__(10)('match');\nmodule.exports = function(it){\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n/***/ }),\n/* 165 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(18);\nmodule.exports = function(iterator, fn, value, entries){\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch(e){\n var ret = iterator['return'];\n if(ret !== undefined)anObject(ret.call(iterator));\n throw e;\n }\n};\n\n/***/ }),\n/* 166 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(57)\n , $export = __webpack_require__(3)\n , redefine = __webpack_require__(33)\n , hide = __webpack_require__(32)\n , has = __webpack_require__(22)\n , Iterators = __webpack_require__(45)\n , $iterCreate = __webpack_require__(283)\n , setToStringTag = __webpack_require__(48)\n , getPrototypeOf = __webpack_require__(288)\n , ITERATOR = __webpack_require__(10)('iterator')\n , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`\n , FF_ITERATOR = '@@iterator'\n , KEYS = 'keys'\n , VALUES = 'values';\n\nvar returnThis = function(){ return this; };\n\nmodule.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){\n $iterCreate(Constructor, NAME, next);\n var getMethod = function(kind){\n if(!BUGGY && kind in proto)return proto[kind];\n switch(kind){\n case KEYS: return function keys(){ return new Constructor(this, kind); };\n case VALUES: return function values(){ return new Constructor(this, kind); };\n } return function entries(){ return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator'\n , DEF_VALUES = DEFAULT == VALUES\n , VALUES_BUG = false\n , proto = Base.prototype\n , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]\n , $default = $native || getMethod(DEFAULT)\n , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined\n , $anyNative = NAME == 'Array' ? proto.entries || $native : $native\n , methods, key, IteratorPrototype;\n // Fix native\n if($anyNative){\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base));\n if(IteratorPrototype !== Object.prototype){\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if(DEF_VALUES && $native && $native.name !== VALUES){\n VALUES_BUG = true;\n $default = function values(){ return $native.call(this); };\n }\n // Define iterator\n if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if(DEFAULT){\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if(FORCED)for(key in methods){\n if(!(key in proto))redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n/***/ }),\n/* 167 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(done, value){\n return {value: value, done: !!done};\n};\n\n/***/ }),\n/* 168 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(39)\n , gOPS = __webpack_require__(58)\n , pIE = __webpack_require__(47)\n , toObject = __webpack_require__(41)\n , IObject = __webpack_require__(76)\n , $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(31)(function(){\n var A = {}\n , B = {}\n , S = Symbol()\n , K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function(k){ B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source){ // eslint-disable-line no-unused-vars\n var T = toObject(target)\n , aLen = arguments.length\n , index = 1\n , getSymbols = gOPS.f\n , isEnum = pIE.f;\n while(aLen > index){\n var S = IObject(arguments[index++])\n , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)\n , length = keys.length\n , j = 0\n , key;\n while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];\n } return T;\n} : $assign;\n\n/***/ }),\n/* 169 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar has = __webpack_require__(22)\n , toIObject = __webpack_require__(23)\n , arrayIndexOf = __webpack_require__(155)(false)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n/***/ }),\n/* 170 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar getKeys = __webpack_require__(39)\n , toIObject = __webpack_require__(23)\n , isEnum = __webpack_require__(47).f;\nmodule.exports = function(isEntries){\n return function(it){\n var O = toIObject(it)\n , keys = getKeys(O)\n , length = keys.length\n , i = 0\n , result = []\n , key;\n while(length > i)if(isEnum.call(O, key = keys[i++])){\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n\n/***/ }),\n/* 171 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(15)\n , anObject = __webpack_require__(18);\nvar check = function(O, proto){\n anObject(O);\n if(!isObject(proto) && proto !== null)throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function(test, buggy, set){\n try {\n set = __webpack_require__(29)(Function.call, __webpack_require__(79).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch(e){ buggy = true; }\n return function setPrototypeOf(O, proto){\n check(O, proto);\n if(buggy)O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n/***/ }),\n/* 172 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(13)\n , dP = __webpack_require__(19)\n , DESCRIPTORS = __webpack_require__(21)\n , SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function(KEY){\n var C = global[KEY];\n if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {\n configurable: true,\n get: function(){ return this; }\n });\n};\n\n/***/ }),\n/* 173 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = __webpack_require__(24)\n , repeat = __webpack_require__(174)\n , defined = __webpack_require__(30);\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n\n/***/ }),\n/* 174 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar toInteger = __webpack_require__(61)\n , defined = __webpack_require__(30);\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};\n\n/***/ }),\n/* 175 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports.f = __webpack_require__(10);\n\n/***/ }),\n/* 176 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar classof = __webpack_require__(156)\n , ITERATOR = __webpack_require__(10)('iterator')\n , Iterators = __webpack_require__(45);\nmodule.exports = __webpack_require__(44).getIteratorMethod = function(it){\n if(it != undefined)return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n/***/ }),\n/* 177 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = jQueryWrapper;\nfunction jQueryWrapper(Handsontable) {\n var jQuery = typeof window === 'undefined' ? false : window.jQuery;\n\n if (!jQuery) {\n return;\n }\n\n jQuery.fn.handsontable = function (action) {\n var $this = this.first(); // Use only first element from list\n var instance = $this.data('handsontable');\n\n // Init case\n if (typeof action !== 'string') {\n var userSettings = action || {};\n\n if (instance) {\n instance.updateSettings(userSettings);\n } else {\n instance = new Handsontable.Core($this[0], userSettings);\n $this.data('handsontable', instance);\n instance.init();\n }\n\n return $this;\n }\n\n // Action case\n var args = [];\n var output = void 0;\n\n if (arguments.length > 1) {\n for (var i = 1, ilen = arguments.length; i < ilen; i++) {\n args.push(arguments[i]);\n }\n }\n\n if (instance) {\n if (typeof instance[action] !== 'undefined') {\n output = instance[action].apply(instance, args);\n\n if (action === 'destroy') {\n $this.removeData();\n }\n } else {\n throw new Error('Handsontable do not provide action: ' + action);\n }\n }\n\n return output;\n };\n};\n\n/***/ }),\n/* 178 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.Base = exports.UndoRedo = exports.TouchScroll = exports.Search = exports.PersistentState = exports.ObserveChanges = exports.MultipleSelectionHandles = exports.MergeCells = exports.ManualRowResize = exports.ManualRowMove = exports.ManualColumnResize = exports.ManualColumnMove = exports.ManualColumnFreeze = exports.DragToScroll = exports.CustomBorders = exports.CopyPaste = exports.ContextMenuCopyPaste = exports.ContextMenu = exports.Comments = exports.ColumnSorting = exports.AutoRowSize = exports.AutoFill = exports.AutoColumnSize = undefined;\n\nvar _autoColumnSize = __webpack_require__(211);\n\nvar _autoColumnSize2 = _interopRequireDefault(_autoColumnSize);\n\nvar _autofill = __webpack_require__(213);\n\nvar _autofill2 = _interopRequireDefault(_autofill);\n\nvar _autoRowSize = __webpack_require__(212);\n\nvar _autoRowSize2 = _interopRequireDefault(_autoRowSize);\n\nvar _columnSorting = __webpack_require__(215);\n\nvar _columnSorting2 = _interopRequireDefault(_columnSorting);\n\nvar _comments = __webpack_require__(217);\n\nvar _comments2 = _interopRequireDefault(_comments);\n\nvar _contextMenu = __webpack_require__(219);\n\nvar _contextMenu2 = _interopRequireDefault(_contextMenu);\n\nvar _contextMenuCopyPaste = __webpack_require__(234);\n\nvar _contextMenuCopyPaste2 = _interopRequireDefault(_contextMenuCopyPaste);\n\nvar _copyPaste = __webpack_require__(235);\n\nvar _copyPaste2 = _interopRequireDefault(_copyPaste);\n\nvar _customBorders = __webpack_require__(236);\n\nvar _customBorders2 = _interopRequireDefault(_customBorders);\n\nvar _dragToScroll = __webpack_require__(237);\n\nvar _dragToScroll2 = _interopRequireDefault(_dragToScroll);\n\nvar _manualColumnFreeze = __webpack_require__(240);\n\nvar _manualColumnFreeze2 = _interopRequireDefault(_manualColumnFreeze);\n\nvar _manualColumnMove = __webpack_require__(242);\n\nvar _manualColumnMove2 = _interopRequireDefault(_manualColumnMove);\n\nvar _manualColumnResize = __webpack_require__(245);\n\nvar _manualColumnResize2 = _interopRequireDefault(_manualColumnResize);\n\nvar _manualRowMove = __webpack_require__(246);\n\nvar _manualRowMove2 = _interopRequireDefault(_manualRowMove);\n\nvar _manualRowResize = __webpack_require__(250);\n\nvar _manualRowResize2 = _interopRequireDefault(_manualRowResize);\n\nvar _mergeCells = __webpack_require__(251);\n\nvar _mergeCells2 = _interopRequireDefault(_mergeCells);\n\nvar _multipleSelectionHandles = __webpack_require__(252);\n\nvar _multipleSelectionHandles2 = _interopRequireDefault(_multipleSelectionHandles);\n\nvar _observeChanges = __webpack_require__(254);\n\nvar _observeChanges2 = _interopRequireDefault(_observeChanges);\n\nvar _persistentState = __webpack_require__(256);\n\nvar _persistentState2 = _interopRequireDefault(_persistentState);\n\nvar _search = __webpack_require__(257);\n\nvar _search2 = _interopRequireDefault(_search);\n\nvar _touchScroll = __webpack_require__(258);\n\nvar _touchScroll2 = _interopRequireDefault(_touchScroll);\n\nvar _undoRedo = __webpack_require__(259);\n\nvar _undoRedo2 = _interopRequireDefault(_undoRedo);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.AutoColumnSize = _autoColumnSize2.default;\nexports.AutoFill = _autofill2.default;\nexports.AutoRowSize = _autoRowSize2.default;\nexports.ColumnSorting = _columnSorting2.default;\nexports.Comments = _comments2.default;\nexports.ContextMenu = _contextMenu2.default;\nexports.ContextMenuCopyPaste = _contextMenuCopyPaste2.default;\nexports.CopyPaste = _copyPaste2.default;\nexports.CustomBorders = _customBorders2.default;\nexports.DragToScroll = _dragToScroll2.default;\nexports.ManualColumnFreeze = _manualColumnFreeze2.default;\nexports.ManualColumnMove = _manualColumnMove2.default;\nexports.ManualColumnResize = _manualColumnResize2.default;\nexports.ManualRowMove = _manualRowMove2.default;\nexports.ManualRowResize = _manualRowResize2.default;\nexports.MergeCells = _mergeCells2.default;\nexports.MultipleSelectionHandles = _multipleSelectionHandles2.default;\nexports.ObserveChanges = _observeChanges2.default;\nexports.PersistentState = _persistentState2.default;\nexports.Search = _search2.default;\nexports.TouchScroll = _touchScroll2.default;\nexports.UndoRedo = _undoRedo2.default;\nexports.Base = _base2.default;\n\n/***/ }),\n/* 179 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 180 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 181 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 182 */\n/***/ (function(module, exports) {\n\n\n\n/***/ }),\n/* 183 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * autoResize - resizes a DOM element to the width and height of another DOM element\n *\n * Copyright 2014, Marcin Warpechowski\n * Licensed under the MIT license\n */\n\nfunction autoResize() {\n var defaults = {\n minHeight: 200,\n maxHeight: 300,\n minWidth: 100,\n maxWidth: 300\n },\n el,\n body = document.body,\n text = document.createTextNode(''),\n span = document.createElement('SPAN'),\n observe = function observe(element, event, handler) {\n if (window.attachEvent) {\n element.attachEvent('on' + event, handler);\n } else {\n element.addEventListener(event, handler, false);\n }\n },\n _unObserve = function _unObserve(element, event, handler) {\n if (window.removeEventListener) {\n element.removeEventListener(event, handler, false);\n } else {\n element.detachEvent('on' + event, handler);\n }\n },\n resize = function resize(newChar) {\n var width, scrollHeight;\n\n if (!newChar) {\n newChar = \"\";\n } else if (!/^[a-zA-Z \\.,\\\\\\/\\|0-9]$/.test(newChar)) {\n newChar = \".\";\n }\n\n if (text.textContent !== void 0) {\n text.textContent = el.value + newChar;\n } else {\n text.data = el.value + newChar; //IE8\n }\n span.style.fontSize = getComputedStyle(el).fontSize;\n span.style.fontFamily = getComputedStyle(el).fontFamily;\n span.style.whiteSpace = \"pre\";\n\n body.appendChild(span);\n width = span.clientWidth + 2;\n body.removeChild(span);\n\n el.style.height = defaults.minHeight + 'px';\n\n if (defaults.minWidth > width) {\n el.style.width = defaults.minWidth + 'px';\n } else if (width > defaults.maxWidth) {\n el.style.width = defaults.maxWidth + 'px';\n } else {\n el.style.width = width + 'px';\n }\n scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0;\n\n if (defaults.minHeight > scrollHeight) {\n el.style.height = defaults.minHeight + 'px';\n } else if (defaults.maxHeight < scrollHeight) {\n el.style.height = defaults.maxHeight + 'px';\n el.style.overflowY = 'visible';\n } else {\n el.style.height = scrollHeight + 'px';\n }\n },\n delayedResize = function delayedResize() {\n window.setTimeout(resize, 0);\n },\n extendDefaults = function extendDefaults(config) {\n\n if (config && config.minHeight) {\n if (config.minHeight == 'inherit') {\n defaults.minHeight = el.clientHeight;\n } else {\n var minHeight = parseInt(config.minHeight);\n if (!isNaN(minHeight)) {\n defaults.minHeight = minHeight;\n }\n }\n }\n\n if (config && config.maxHeight) {\n if (config.maxHeight == 'inherit') {\n defaults.maxHeight = el.clientHeight;\n } else {\n var maxHeight = parseInt(config.maxHeight);\n if (!isNaN(maxHeight)) {\n defaults.maxHeight = maxHeight;\n }\n }\n }\n\n if (config && config.minWidth) {\n if (config.minWidth == 'inherit') {\n defaults.minWidth = el.clientWidth;\n } else {\n var minWidth = parseInt(config.minWidth);\n if (!isNaN(minWidth)) {\n defaults.minWidth = minWidth;\n }\n }\n }\n\n if (config && config.maxWidth) {\n if (config.maxWidth == 'inherit') {\n defaults.maxWidth = el.clientWidth;\n } else {\n var maxWidth = parseInt(config.maxWidth);\n if (!isNaN(maxWidth)) {\n defaults.maxWidth = maxWidth;\n }\n }\n }\n\n if (!span.firstChild) {\n span.className = \"autoResize\";\n span.style.display = 'inline-block';\n span.appendChild(text);\n }\n },\n _init = function _init(el_, config, doObserve) {\n el = el_;\n extendDefaults(config);\n\n if (el.nodeName == 'TEXTAREA') {\n\n el.style.resize = 'none';\n el.style.overflowY = '';\n el.style.height = defaults.minHeight + 'px';\n el.style.minWidth = defaults.minWidth + 'px';\n el.style.maxWidth = defaults.maxWidth + 'px';\n el.style.overflowY = 'hidden';\n }\n\n if (doObserve) {\n observe(el, 'change', resize);\n observe(el, 'cut', delayedResize);\n observe(el, 'paste', delayedResize);\n observe(el, 'drop', delayedResize);\n observe(el, 'keydown', delayedResize);\n observe(el, 'focus', resize);\n }\n\n resize();\n };\n\n function getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n }\n\n return {\n init: function init(el_, config, doObserve) {\n _init(el_, config, doObserve);\n },\n unObserve: function unObserve() {\n _unObserve(el, 'change', resize);\n _unObserve(el, 'cut', delayedResize);\n _unObserve(el, 'paste', delayedResize);\n _unObserve(el, 'drop', delayedResize);\n _unObserve(el, 'keydown', delayedResize);\n _unObserve(el, 'focus', resize);\n },\n resize: resize\n };\n}\n\nif (true) {\n module.exports = autoResize;\n}\n\n/***/ }),\n/* 184 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Creates a textarea that stays hidden on the page and gets focused when user presses CTRL while not having a form\n * input focused.\n * In future we may implement a better driver when better APIs are available.\n *\n * @constructor\n * @private\n */\n\nvar instance;\n\nfunction copyPaste() {\n if (!instance) {\n instance = new CopyPasteClass();\n } else if (instance.hasBeenDestroyed()) {\n instance.init();\n }\n instance.refCounter++;\n\n return instance;\n}\n\nif (true) {\n module.exports = copyPaste;\n}\n\nfunction CopyPasteClass() {\n this.refCounter = 0;\n this.init();\n}\n\nCopyPasteClass.prototype.init = function () {\n var style, parent;\n\n this.copyCallbacks = [];\n this.cutCallbacks = [];\n this.pasteCallbacks = [];\n\n // this.listenerElement = document.documentElement;\n parent = document.body;\n\n if (document.getElementById('CopyPasteDiv')) {\n this.elDiv = document.getElementById('CopyPasteDiv');\n this.elTextarea = this.elDiv.firstChild;\n } else {\n this.elDiv = document.createElement('div');\n this.elDiv.id = 'CopyPasteDiv';\n style = this.elDiv.style;\n style.position = 'fixed';\n style.top = '-10000px';\n style.left = '-10000px';\n parent.appendChild(this.elDiv);\n\n this.elTextarea = document.createElement('textarea');\n this.elTextarea.className = 'copyPaste';\n this.elTextarea.onpaste = function (event) {\n var clipboardContents, temp;\n\n if ('WebkitAppearance' in document.documentElement.style) {\n // chrome and safari\n clipboardContents = event.clipboardData.getData(\"Text\");\n\n // Safari adds an additional newline to copied text\n if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {\n temp = clipboardContents.split('\\n');\n\n if (temp[temp.length - 1] === '') {\n temp.pop();\n }\n clipboardContents = temp.join('\\n');\n }\n this.value = clipboardContents;\n\n event.preventDefault();\n }\n };\n style = this.elTextarea.style;\n style.width = '10000px';\n style.height = '10000px';\n style.overflow = 'hidden';\n this.elDiv.appendChild(this.elTextarea);\n\n if (typeof style.opacity !== 'undefined') {\n style.opacity = 0;\n }\n }\n this.onKeyDownRef = this.onKeyDown.bind(this);\n document.documentElement.addEventListener('keydown', this.onKeyDownRef, false);\n};\n\n/**\n * Call method on every key down event\n *\n * @param {Event} event\n */\nCopyPasteClass.prototype.onKeyDown = function (event) {\n var _this = this,\n isCtrlDown = false;\n\n function isActiveElementEditable() {\n var element = document.activeElement;\n\n if (element.shadowRoot && element.shadowRoot.activeElement) {\n element = element.shadowRoot.activeElement;\n }\n\n return ['INPUT', 'SELECT', 'TEXTAREA'].indexOf(element.nodeName) > -1 || element.contentEditable === 'true';\n }\n\n // mac\n if (event.metaKey) {\n isCtrlDown = true;\n }\n // pc\n else if (event.ctrlKey && navigator.userAgent.indexOf('Mac') === -1) {\n isCtrlDown = true;\n }\n if (isCtrlDown) {\n // this is needed by fragmentSelection in Handsontable. Ignore copypaste.js behavior if fragment of cell text is selected\n if (document.activeElement !== this.elTextarea && (this.getSelectionText() !== '' || isActiveElementEditable())) {\n return;\n }\n this.selectNodeText(this.elTextarea);\n setTimeout(function () {\n if (document.activeElement !== _this.elTextarea) {\n _this.selectNodeText(_this.elTextarea);\n }\n }, 0);\n }\n\n if (event.isImmediatePropagationEnabled !== false && isCtrlDown && (event.keyCode === 67 || event.keyCode === 86 || event.keyCode === 88)) {\n // works in all browsers, incl. Opera < 12.12\n if (event.keyCode === 88) {\n setTimeout(function () {\n _this.triggerCut(event);\n }, 0);\n } else if (event.keyCode === 86) {\n setTimeout(function () {\n _this.triggerPaste(event);\n }, 0);\n }\n }\n};\n\n//http://jsperf.com/textara-selection\n//http://stackoverflow.com/questions/1502385/how-can-i-make-this-code-work-in-ie\n/**\n * Select all text contains in passed node element\n *\n * @param {Element} element\n */\nCopyPasteClass.prototype.selectNodeText = function (element) {\n if (element) {\n element.select();\n }\n};\n\n//http://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text\n/**\n * Get selection text\n *\n * @returns {String}\n */\nCopyPasteClass.prototype.getSelectionText = function () {\n var text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type !== 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n};\n\n/**\n * Make string copyable\n *\n * @param {String} string\n */\nCopyPasteClass.prototype.copyable = function (string) {\n if (typeof string !== 'string' && string.toString === void 0) {\n throw new Error('copyable requires string parameter');\n }\n this.elTextarea.value = string;\n this.selectNodeText(this.elTextarea);\n};\n\n/*CopyPasteClass.prototype.onCopy = function (fn) {\n this.copyCallbacks.push(fn);\n};*/\n\n/**\n * Add function callback to onCut event\n *\n * @param {Function} callback\n */\nCopyPasteClass.prototype.onCut = function (callback) {\n this.cutCallbacks.push(callback);\n};\n\n/**\n * Add function callback to onPaste event\n *\n * @param {Function} callback\n */\nCopyPasteClass.prototype.onPaste = function (callback) {\n this.pasteCallbacks.push(callback);\n};\n\n/**\n * Remove callback from all events\n *\n * @param {Function} callback\n * @returns {Boolean}\n */\nCopyPasteClass.prototype.removeCallback = function (callback) {\n var i, len;\n\n for (i = 0, len = this.copyCallbacks.length; i < len; i++) {\n if (this.copyCallbacks[i] === callback) {\n this.copyCallbacks.splice(i, 1);\n\n return true;\n }\n }\n for (i = 0, len = this.cutCallbacks.length; i < len; i++) {\n if (this.cutCallbacks[i] === callback) {\n this.cutCallbacks.splice(i, 1);\n\n return true;\n }\n }\n for (i = 0, len = this.pasteCallbacks.length; i < len; i++) {\n if (this.pasteCallbacks[i] === callback) {\n this.pasteCallbacks.splice(i, 1);\n\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * Trigger cut event\n *\n * @param {DOMEvent} event\n */\nCopyPasteClass.prototype.triggerCut = function (event) {\n var _this = this;\n\n if (_this.cutCallbacks) {\n setTimeout(function () {\n for (var i = 0, len = _this.cutCallbacks.length; i < len; i++) {\n _this.cutCallbacks[i](event);\n }\n }, 50);\n }\n};\n\n/**\n * Trigger paste event\n *\n * @param {DOMEvent} event\n * @param {String} string\n */\nCopyPasteClass.prototype.triggerPaste = function (event, string) {\n var _this = this;\n\n if (_this.pasteCallbacks) {\n setTimeout(function () {\n var val = string || _this.elTextarea.value;\n\n for (var i = 0, len = _this.pasteCallbacks.length; i < len; i++) {\n _this.pasteCallbacks[i](val, event);\n }\n }, 50);\n }\n};\n\n/**\n * Destroy instance\n */\nCopyPasteClass.prototype.destroy = function () {\n if (!this.hasBeenDestroyed() && --this.refCounter === 0) {\n if (this.elDiv && this.elDiv.parentNode) {\n this.elDiv.parentNode.removeChild(this.elDiv);\n this.elDiv = null;\n this.elTextarea = null;\n }\n document.documentElement.removeEventListener('keydown', this.onKeyDownRef);\n this.onKeyDownRef = null;\n }\n};\n\n/**\n * Check if instance has been destroyed\n *\n * @returns {Boolean}\n */\nCopyPasteClass.prototype.hasBeenDestroyed = function () {\n return !this.refCounter;\n};\n\n/***/ }),\n/* 185 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays.\n * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly\n *\n * @class DebugOverlay\n */\nvar DebugOverlay = function (_Overlay) {\n _inherits(DebugOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function DebugOverlay(wotInstance) {\n _classCallCheck(this, DebugOverlay);\n\n var _this = _possibleConstructorReturn(this, (DebugOverlay.__proto__ || Object.getPrototypeOf(DebugOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_DEBUG);\n _this.clone.wtTable.holder.style.opacity = 0.4;\n _this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';\n\n (0, _element.addClass)(_this.clone.wtTable.holder.parentNode, 'wtDebugVisible');\n return _this;\n }\n\n return DebugOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_DEBUG, DebugOverlay);\n\nexports.default = DebugOverlay;\n\n/***/ }),\n/* 186 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class LeftOverlay\n */\nvar LeftOverlay = function (_Overlay) {\n _inherits(LeftOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function LeftOverlay(wotInstance) {\n _classCallCheck(this, LeftOverlay);\n\n var _this = _possibleConstructorReturn(this, (LeftOverlay.__proto__ || Object.getPrototypeOf(LeftOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_LEFT);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(LeftOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!(this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length);\n }\n\n /**\n * Updates the left overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var left = Math.ceil(box.left);\n var right = Math.ceil(box.right);\n var finalLeft = void 0;\n var finalTop = void 0;\n\n finalTop = this.wot.wtTable.hider.style.top;\n finalTop = finalTop === '' ? 0 : finalTop;\n\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n headerPosition = finalLeft;\n finalLeft += 'px';\n\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n (0, _element.resetCssTransform)(overlayRoot);\n }\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's horizontal scroll position\n *\n * @param {Number} pos\n */\n\n }, {\n key: 'setScrollPosition',\n value: function setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo(pos, (0, _element.getWindowScrollTop)());\n } else {\n this.mainTableScrollableElement.scrollLeft = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n\n }, {\n key: 'onScroll',\n value: function onScroll() {\n this.wot.getSetting('onScrollVertically');\n }\n\n /**\n * Calculates total sum cells width\n *\n * @param {Number} from Column index which calculates started from\n * @param {Number} to Column index where calculation is finished\n * @returns {Number} Width sum\n */\n\n }, {\n key: 'sumCellSizes',\n value: function sumCellSizes(from, to) {\n var sum = 0;\n var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;\n\n while (from < to) {\n sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: 'adjustRootElementSize',\n value: function adjustRootElementSize() {\n var masterHolder = this.wot.wtTable.holder;\n var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : (0, _element.getScrollbarWidth)();\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var tableWidth = void 0;\n\n if (this.trimmingContainer !== window || preventOverflow === 'vertical') {\n var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;\n\n height = Math.min(height, (0, _element.innerHeight)(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.height = height + 'px';\n } else {\n overlayRootStyle.height = '';\n }\n\n this.clone.wtTable.holder.style.height = overlayRootStyle.height;\n\n tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);\n overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';\n }\n\n /**\n * Adjust overlay root childs size\n */\n\n }, {\n key: 'adjustRootChildrenSize',\n value: function adjustRootChildrenSize() {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalColumns');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';\n } else if (total === 0) {\n this.spreader.style.left = '0';\n } else {\n throw new Error('Incorrect value of the columnsRenderCalculator');\n }\n this.spreader.style.right = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated top position to an element\n */\n\n }, {\n key: 'syncOverlayOffset',\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }\n\n /**\n * Scrolls horizontally to a column at the left edge of the viewport\n *\n * @param sourceCol {Number} Column index which you want to scroll to\n * @param [beyondRendered=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n\n }, {\n key: 'scrollTo',\n value: function scrollTo(sourceCol, beyondRendered) {\n var newX = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n if (beyondRendered) {\n newX += this.sumCellSizes(0, sourceCol + 1);\n newX -= this.wot.wtViewport.getViewportWidth();\n } else {\n newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);\n }\n newX += scrollbarCompensation;\n\n this.setScrollPosition(newX);\n }\n\n /**\n * Gets table parent left position\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getTableParentOffset',\n value: function getTableParentOffset() {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var offset = 0;\n\n if (!preventOverflow && this.trimmingContainer === window) {\n offset = this.wot.wtTable.holderOffset.left;\n }\n\n return offset;\n }\n\n /**\n * Gets the main overlay's horizontal scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n\n }, {\n key: 'getScrollPosition',\n value: function getScrollPosition() {\n return (0, _element.getScrollLeft)(this.mainTableScrollableElement);\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header X position if trimming container is window or scroll top if not\n */\n\n }, {\n key: 'adjustHeaderBordersPosition',\n value: function adjustHeaderBordersPosition(position) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var rowHeaders = this.wot.getSetting('rowHeaders');\n var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n var totalRows = this.wot.getSetting('totalRows');\n\n if (totalRows) {\n (0, _element.removeClass)(masterParent, 'emptyRows');\n } else {\n (0, _element.addClass)(masterParent, 'emptyRows');\n }\n\n if (fixedColumnsLeft && !rowHeaders.length) {\n (0, _element.addClass)(masterParent, 'innerBorderLeft');\n } else if (!fixedColumnsLeft && rowHeaders.length) {\n var previousState = (0, _element.hasClass)(masterParent, 'innerBorderLeft');\n\n if (position) {\n (0, _element.addClass)(masterParent, 'innerBorderLeft');\n } else {\n (0, _element.removeClass)(masterParent, 'innerBorderLeft');\n }\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n }\n }\n }\n }]);\n\n return LeftOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_LEFT, LeftOverlay);\n\nexports.default = LeftOverlay;\n\n/***/ }),\n/* 187 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class TopOverlay\n */\nvar TopOverlay = function (_Overlay) {\n _inherits(TopOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function TopOverlay(wotInstance) {\n _classCallCheck(this, TopOverlay);\n\n var _this = _possibleConstructorReturn(this, (TopOverlay.__proto__ || Object.getPrototypeOf(TopOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_TOP);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TopOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!(this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length);\n }\n\n /**\n * Updates the top overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(box.top);\n var bottom = Math.ceil(box.bottom);\n var finalLeft = void 0;\n var finalTop = void 0;\n\n finalLeft = this.wot.wtTable.hider.style.left;\n finalLeft = finalLeft === '' ? 0 : finalLeft;\n\n if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {\n finalTop = -top;\n } else {\n finalTop = 0;\n }\n headerPosition = finalTop;\n finalTop += 'px';\n\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n (0, _element.resetCssTransform)(overlayRoot);\n }\n\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's vertical scroll position\n *\n * @param {Number} pos\n */\n\n }, {\n key: 'setScrollPosition',\n value: function setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo((0, _element.getWindowScrollLeft)(), pos);\n } else {\n this.mainTableScrollableElement.scrollTop = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n\n }, {\n key: 'onScroll',\n value: function onScroll() {\n this.wot.getSetting('onScrollHorizontally');\n }\n\n /**\n * Calculates total sum cells height\n *\n * @param {Number} from Row index which calculates started from\n * @param {Number} to Row index where calculation is finished\n * @returns {Number} Height sum\n */\n\n }, {\n key: 'sumCellSizes',\n value: function sumCellSizes(from, to) {\n var sum = 0;\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n\n while (from < to) {\n var height = this.wot.wtTable.getRowHeight(from);\n\n sum += height === void 0 ? defaultRowHeight : height;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n\n }, {\n key: 'adjustElementsSize',\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: 'adjustRootElementSize',\n value: function adjustRootElementSize() {\n var masterHolder = this.wot.wtTable.holder;\n var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : (0, _element.getScrollbarWidth)();\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var tableHeight = void 0;\n\n if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {\n var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;\n\n width = Math.min(width, (0, _element.innerWidth)(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.width = width + 'px';\n } else {\n overlayRootStyle.width = '';\n }\n\n this.clone.wtTable.holder.style.width = overlayRootStyle.width;\n\n tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);\n overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';\n }\n\n /**\n * Adjust overlay root childs size\n */\n\n }, {\n key: 'adjustRootChildrenSize',\n value: function adjustRootChildrenSize() {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n this.clone.wtTable.hider.style.width = this.hider.style.width;\n this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px';\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n\n }, {\n key: 'applyToDOM',\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalRows');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';\n } else if (total === 0) {\n // can happen if there are 0 rows\n this.spreader.style.top = '0';\n } else {\n throw new Error('Incorrect value of the rowsRenderCalculator');\n }\n this.spreader.style.bottom = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated left position to an element\n */\n\n }, {\n key: 'syncOverlayOffset',\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';\n } else {\n this.clone.wtTable.spreader.style.left = '';\n }\n }\n\n /**\n * Scrolls vertically to a row\n *\n * @param sourceRow {Number} Row index which you want to scroll to\n * @param [bottomEdge=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n\n }, {\n key: 'scrollTo',\n value: function scrollTo(sourceRow, bottomEdge) {\n var newY = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {\n scrollbarCompensation = (0, _element.getScrollbarWidth)();\n }\n\n if (bottomEdge) {\n var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n var fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n var totalRows = this.wot.getSetting('totalRows');\n\n newY += this.sumCellSizes(0, sourceRow + 1);\n newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n // Fix 1 pixel offset when cell is selected\n newY += 1;\n } else {\n newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);\n }\n newY += scrollbarCompensation;\n\n this.setScrollPosition(newY);\n }\n\n /**\n * Gets table parent top position\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getTableParentOffset',\n value: function getTableParentOffset() {\n if (this.mainTableScrollableElement === window) {\n return this.wot.wtTable.holderOffset.top;\n }\n return 0;\n }\n\n /**\n * Gets the main overlay's vertical scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n\n }, {\n key: 'getScrollPosition',\n value: function getScrollPosition() {\n return (0, _element.getScrollTop)(this.mainTableScrollableElement);\n }\n\n /**\n * Redraw borders of selection\n *\n * @param {WalkontableSelection} selection Selection for redraw\n */\n\n }, {\n key: 'redrawSelectionBorders',\n value: function redrawSelectionBorders(selection) {\n if (selection && selection.cellRange) {\n var border = selection.getBorder(this.wot);\n\n if (border) {\n var corners = selection.getCorners();\n border.disappear();\n border.appear(corners);\n }\n }\n }\n\n /**\n * Redrawing borders of all selections\n */\n\n }, {\n key: 'redrawAllSelectionsBorders',\n value: function redrawAllSelectionsBorders() {\n var selections = this.wot.selections;\n\n this.redrawSelectionBorders(selections.current);\n this.redrawSelectionBorders(selections.area);\n this.redrawSelectionBorders(selections.fill);\n this.wot.wtTable.wot.wtOverlays.leftOverlay.refresh();\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header Y position if trimming container is window or scroll top if not\n */\n\n }, {\n key: 'adjustHeaderBordersPosition',\n value: function adjustHeaderBordersPosition(position) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (totalColumns) {\n (0, _element.removeClass)(masterParent, 'emptyColumns');\n } else {\n (0, _element.addClass)(masterParent, 'emptyColumns');\n }\n\n if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {\n var previousState = (0, _element.hasClass)(masterParent, 'innerBorderTop');\n\n if (position || this.wot.getSetting('totalRows') === 0) {\n (0, _element.addClass)(masterParent, 'innerBorderTop');\n } else {\n (0, _element.removeClass)(masterParent, 'innerBorderTop');\n }\n\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n\n // cell borders should be positioned once again,\n // because we added / removed 1px border from table header\n this.redrawAllSelectionsBorders();\n }\n }\n\n // nasty workaround for double border in the header, TODO: find a pure-css solution\n if (this.wot.getSetting('rowHeaders').length === 0) {\n var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');\n\n if (secondHeaderCell) {\n for (var i = 0; i < secondHeaderCell.length; i++) {\n secondHeaderCell[i].style['border-left-width'] = 0;\n }\n }\n }\n }\n }]);\n\n return TopOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_TOP, TopOverlay);\n\nexports.default = TopOverlay;\n\n/***/ }),\n/* 188 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _base = __webpack_require__(28);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class TopLeftCornerOverlay\n */\nvar TopLeftCornerOverlay = function (_Overlay) {\n _inherits(TopLeftCornerOverlay, _Overlay);\n\n /**\n * @param {Walkontable} wotInstance\n */\n function TopLeftCornerOverlay(wotInstance) {\n _classCallCheck(this, TopLeftCornerOverlay);\n\n var _this = _possibleConstructorReturn(this, (TopLeftCornerOverlay.__proto__ || Object.getPrototypeOf(TopLeftCornerOverlay)).call(this, wotInstance));\n\n _this.clone = _this.makeClone(_base2.default.CLONE_TOP_LEFT_CORNER);\n return _this;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TopLeftCornerOverlay, [{\n key: 'shouldBeRendered',\n value: function shouldBeRendered() {\n return !!((this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length));\n }\n\n /**\n * Updates the corner overlay position\n */\n\n }, {\n key: 'resetFixedPosition',\n value: function resetFixedPosition() {\n this.updateTrimmingContainer();\n\n if (!this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);\n var tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window) {\n var box = this.wot.wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(box.top);\n var left = Math.ceil(box.left);\n var bottom = Math.ceil(box.bottom);\n var right = Math.ceil(box.right);\n var finalLeft = '0';\n var finalTop = '0';\n\n if (!preventOverflow || preventOverflow === 'vertical') {\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = -left + 'px';\n }\n }\n\n if (!preventOverflow || preventOverflow === 'horizontal') {\n if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {\n finalTop = -top + 'px';\n }\n }\n (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);\n } else {\n (0, _element.resetCssTransform)(overlayRoot);\n }\n overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';\n overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';\n }\n }]);\n\n return TopLeftCornerOverlay;\n}(_base2.default);\n\n_base2.default.registerOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, TopLeftCornerOverlay);\n\nexports.default = TopLeftCornerOverlay;\n\n/***/ }),\n/* 189 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _border2 = __webpack_require__(134);\n\nvar _border3 = _interopRequireDefault(_border2);\n\nvar _coords = __webpack_require__(42);\n\nvar _coords2 = _interopRequireDefault(_coords);\n\nvar _range = __webpack_require__(69);\n\nvar _range2 = _interopRequireDefault(_range);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Selection\n */\nvar Selection = function () {\n /**\n * @param {Object} settings\n * @param {CellRange} cellRange\n */\n function Selection(settings, cellRange) {\n _classCallCheck(this, Selection);\n\n this.settings = settings;\n this.cellRange = cellRange || null;\n this.instanceBorders = {};\n }\n\n /**\n * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection\n * borders per instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Border}\n */\n\n\n _createClass(Selection, [{\n key: 'getBorder',\n value: function getBorder(wotInstance) {\n if (this.instanceBorders[wotInstance.guid]) {\n return this.instanceBorders[wotInstance.guid];\n }\n\n // where is this returned?\n this.instanceBorders[wotInstance.guid] = new _border3.default(wotInstance, this.settings);\n }\n\n /**\n * Checks if selection is empty\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return this.cellRange === null;\n }\n\n /**\n * Adds a cell coords to the selection\n *\n * @param {CellCoords} coords\n */\n\n }, {\n key: 'add',\n value: function add(coords) {\n if (this.isEmpty()) {\n this.cellRange = new _range2.default(coords, coords, coords);\n } else {\n this.cellRange.expand(coords);\n }\n }\n\n /**\n * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean\n * information about success\n *\n * @param {CellCoords} oldCoords\n * @param {CellCoords} newCoords\n * @returns {Boolean}\n */\n\n }, {\n key: 'replace',\n value: function replace(oldCoords, newCoords) {\n if (!this.isEmpty()) {\n if (this.cellRange.from.isEqual(oldCoords)) {\n this.cellRange.from = newCoords;\n\n return true;\n }\n if (this.cellRange.to.isEqual(oldCoords)) {\n this.cellRange.to = newCoords;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Clears selection\n */\n\n }, {\n key: 'clear',\n value: function clear() {\n this.cellRange = null;\n }\n\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`\n */\n\n }, {\n key: 'getCorners',\n value: function getCorners() {\n var topLeft = this.cellRange.getTopLeftCorner();\n var bottomRight = this.cellRange.getBottomRightCorner();\n\n return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];\n }\n\n /**\n * Adds class name to cell element at given coords\n *\n * @param {Walkontable} wotInstance Walkontable instance\n * @param {Number} sourceRow Cell row coord\n * @param {Number} sourceColumn Cell column coord\n * @param {String} className Class name\n */\n\n }, {\n key: 'addClassAtCoords',\n value: function addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {\n var TD = wotInstance.wtTable.getCell(new _coords2.default(sourceRow, sourceColumn));\n\n if ((typeof TD === 'undefined' ? 'undefined' : _typeof(TD)) === 'object') {\n (0, _element.addClass)(TD, className);\n }\n }\n\n /**\n * @param wotInstance\n */\n\n }, {\n key: 'draw',\n value: function draw(wotInstance) {\n if (this.isEmpty()) {\n if (this.settings.border) {\n var border = this.getBorder(wotInstance);\n\n if (border) {\n border.disappear();\n }\n }\n\n return;\n }\n var renderedRows = wotInstance.wtTable.getRenderedRowsCount();\n var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();\n var corners = this.getCorners();\n var sourceRow = void 0,\n sourceCol = void 0,\n TH = void 0;\n\n for (var column = 0; column < renderedColumns; column++) {\n sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);\n\n if (sourceCol >= corners[1] && sourceCol <= corners[3]) {\n TH = wotInstance.wtTable.getColumnHeader(sourceCol);\n\n if (TH) {\n var newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightColumnClassName) {\n newClasses.push(this.settings.highlightColumnClassName);\n }\n\n (0, _element.addClass)(TH, newClasses);\n }\n }\n }\n\n for (var row = 0; row < renderedRows; row++) {\n sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);\n\n if (sourceRow >= corners[0] && sourceRow <= corners[2]) {\n TH = wotInstance.wtTable.getRowHeader(sourceRow);\n\n if (TH) {\n var _newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n _newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightRowClassName) {\n _newClasses.push(this.settings.highlightRowClassName);\n }\n\n (0, _element.addClass)(TH, _newClasses);\n }\n }\n\n for (var _column = 0; _column < renderedColumns; _column++) {\n sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(_column);\n\n if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) {\n // selected cell\n if (this.settings.className) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className);\n }\n } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) {\n // selection is in this row\n if (this.settings.highlightRowClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);\n }\n } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) {\n // selection is in this column\n if (this.settings.highlightColumnClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);\n }\n }\n }\n }\n wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);\n\n if (this.settings.border) {\n var _border = this.getBorder(wotInstance);\n\n if (_border) {\n // warning! border.appear modifies corners!\n _border.appear(corners);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nexports.default = Selection;\n\n/***/ }),\n/* 190 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'autocomplete';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 191 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'checkbox';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE)\n};\n\n/***/ }),\n/* 192 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'date';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete'),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 193 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'dropdown';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete'),\n validator: (0, _validators.getValidator)('autocomplete')\n};\n\n/***/ }),\n/* 194 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'handsontable';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('autocomplete')\n};\n\n/***/ }),\n/* 195 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'numeric';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n validator: (0, _validators.getValidator)(CELL_TYPE),\n dataType: 'number'\n};\n\n/***/ }),\n/* 196 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'password';\n\nexports.default = {\n editor: (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE),\n copyable: false\n};\n\n/***/ }),\n/* 197 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _browser = __webpack_require__(25);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar CELL_TYPE = 'text';\n\nexports.default = {\n editor: (0, _browser.isMobileBrowser)() ? (0, _editors.getEditor)('mobile') : (0, _editors.getEditor)(CELL_TYPE),\n renderer: (0, _renderers.getRenderer)(CELL_TYPE)\n};\n\n/***/ }),\n/* 198 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar CELL_TYPE = 'time';\n\nexports.default = {\n editor: (0, _editors.getEditor)('text'),\n // displays small gray arrow on right side of the cell\n renderer: (0, _renderers.getRenderer)('text'),\n validator: (0, _validators.getValidator)(CELL_TYPE)\n};\n\n/***/ }),\n/* 199 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _SheetClip = __webpack_require__(132);\n\nvar _SheetClip2 = _interopRequireDefault(_SheetClip);\n\nvar _data = __webpack_require__(65);\n\nvar _setting = __webpack_require__(66);\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _interval = __webpack_require__(269);\n\nvar _interval2 = _interopRequireDefault(_interval);\n\nvar _number = __webpack_require__(6);\n\nvar _multiMap = __webpack_require__(210);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names\n * @todo refactor arguments of methods getRange, getText to be numbers (not objects)\n * @todo remove priv, GridSettings from object constructor\n *\n * @param {Object} instance Instance of Handsontable\n * @param {*} priv\n * @param {*} GridSettings Grid settings\n * @util\n * @class DataMap\n */\nfunction DataMap(instance, priv, GridSettings) {\n var _this = this;\n\n this.instance = instance;\n this.priv = priv;\n this.GridSettings = GridSettings;\n this.dataSource = this.instance.getSettings().data;\n this.cachedLength = null;\n this.skipCache = false;\n this.latestSourceRowsCount = 0;\n\n if (this.dataSource && this.dataSource[0]) {\n this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]);\n } else {\n this.duckSchema = {};\n }\n this.createMap();\n this.interval = _interval2.default.create(function () {\n return _this.clearLengthCache();\n }, '15fps');\n\n this.instance.addHook('skipLengthCache', function (delay) {\n return _this.onSkipLengthCache(delay);\n });\n this.onSkipLengthCache(500);\n}\n\nDataMap.prototype.DESTINATION_RENDERER = 1;\nDataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2;\n\n/**\n * @param {Object|Array} object\n * @returns {Object|Array}\n */\nDataMap.prototype.recursiveDuckSchema = function (object) {\n return (0, _object.duckSchema)(object);\n};\n\n/**\n * @param {Object} schema\n * @param {Number} lastCol\n * @param {Number} parent\n * @returns {Number}\n */\nDataMap.prototype.recursiveDuckColumns = function (schema, lastCol, parent) {\n var prop, i;\n if (typeof lastCol === 'undefined') {\n lastCol = 0;\n parent = '';\n }\n if ((typeof schema === 'undefined' ? 'undefined' : _typeof(schema)) === 'object' && !Array.isArray(schema)) {\n for (i in schema) {\n if ((0, _object.hasOwnProperty)(schema, i)) {\n if (schema[i] === null) {\n prop = parent + i;\n this.colToPropCache.push(prop);\n this.propToColCache.set(prop, lastCol);\n\n lastCol++;\n } else {\n lastCol = this.recursiveDuckColumns(schema[i], lastCol, i + '.');\n }\n }\n }\n }\n\n return lastCol;\n};\n\nDataMap.prototype.createMap = function () {\n var i = void 0;\n var schema = this.getSchema();\n\n if (typeof schema === 'undefined') {\n throw new Error('trying to create `columns` definition but you didn\\'t provide `schema` nor `data`');\n }\n\n this.colToPropCache = [];\n this.propToColCache = new _multiMap2.default();\n\n var columns = this.instance.getSettings().columns;\n\n if (columns) {\n var maxCols = this.instance.getSettings().maxCols;\n var columnsLen = Math.min(maxCols, columns.length);\n var filteredIndex = 0;\n var columnsAsFunc = false;\n var schemaLen = (0, _object.deepObjectSize)(schema);\n\n if (typeof columns === 'function') {\n columnsLen = schemaLen > 0 ? schemaLen : this.instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n for (i = 0; i < columnsLen; i++) {\n var column = columnsAsFunc ? columns(i) : columns[i];\n\n if ((0, _object.isObject)(column)) {\n if (typeof column.data !== 'undefined') {\n var index = columnsAsFunc ? filteredIndex : i;\n this.colToPropCache[index] = column.data;\n this.propToColCache.set(column.data, index);\n }\n\n filteredIndex++;\n }\n }\n } else {\n this.recursiveDuckColumns(schema);\n }\n};\n\n/**\n * Returns property name that corresponds with the given column index.\n *\n * @param {Number} col\n * @returns {Number}\n */\nDataMap.prototype.colToProp = function (col) {\n col = this.instance.runHooks('modifyCol', col);\n\n if (!isNaN(col) && this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') {\n return this.colToPropCache[col];\n }\n\n return col;\n};\n\n/**\n * @param {Object} prop\n * @fires Hooks#modifyCol\n * @returns {*}\n */\nDataMap.prototype.propToCol = function (prop) {\n var col;\n\n if (typeof this.propToColCache.get(prop) === 'undefined') {\n col = prop;\n } else {\n col = this.propToColCache.get(prop);\n }\n col = this.instance.runHooks('unmodifyCol', col);\n\n return col;\n};\n\n/**\n * @returns {Object}\n */\nDataMap.prototype.getSchema = function () {\n var schema = this.instance.getSettings().dataSchema;\n\n if (schema) {\n if (typeof schema === 'function') {\n return schema();\n }\n return schema;\n }\n\n return this.duckSchema;\n};\n\n/**\n * Creates row at the bottom of the data array.\n *\n * @param {Number} [index] Index of the row before which the new row will be inserted.\n * @param {Number} [amount] An amount of rows to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateRow\n * @returns {Number} Returns number of created rows.\n */\nDataMap.prototype.createRow = function (index, amount, source) {\n var row,\n colCount = this.instance.countCols(),\n numberOfCreatedRows = 0,\n currentIndex;\n\n if (!amount) {\n amount = 1;\n }\n\n if (typeof index !== 'number' || index >= this.instance.countSourceRows()) {\n index = this.instance.countSourceRows();\n }\n this.instance.runHooks('beforeCreateRow', index, amount, source);\n\n currentIndex = index;\n var maxRows = this.instance.getSettings().maxRows;\n\n while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) {\n if (this.instance.dataType === 'array') {\n if (this.instance.getSettings().dataSchema) {\n // Clone template array\n row = (0, _object.deepClone)(this.getSchema());\n } else {\n row = [];\n /* eslint-disable no-loop-func */\n (0, _number.rangeEach)(colCount - 1, function () {\n return row.push(null);\n });\n }\n } else if (this.instance.dataType === 'function') {\n row = this.instance.getSettings().dataSchema(index);\n } else {\n row = {};\n (0, _object.deepExtend)(row, this.getSchema());\n }\n\n if (index === this.instance.countSourceRows()) {\n this.dataSource.push(row);\n } else {\n this.spliceData(index, 0, row);\n }\n\n numberOfCreatedRows++;\n currentIndex++;\n }\n\n this.instance.runHooks('afterCreateRow', index, numberOfCreatedRows, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedRows;\n};\n\n/**\n * Creates col at the right of the data array.\n *\n * @param {Number} [index] Index of the column before which the new column will be inserted\n * @param {Number} [amount] An amount of columns to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateCol\n * @returns {Number} Returns number of created columns\n */\nDataMap.prototype.createCol = function (index, amount, source) {\n if (!this.instance.isColumnModificationAllowed()) {\n throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \\'columns\\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.');\n }\n var rlen = this.instance.countSourceRows(),\n data = this.dataSource,\n constructor,\n numberOfCreatedCols = 0,\n currentIndex;\n\n if (!amount) {\n amount = 1;\n }\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n index = this.instance.countCols();\n }\n this.instance.runHooks('beforeCreateCol', index, amount, source);\n\n currentIndex = index;\n\n var maxCols = this.instance.getSettings().maxCols;\n while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) {\n constructor = (0, _setting.columnFactory)(this.GridSettings, this.priv.columnsSettingConflicts);\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n if (rlen > 0) {\n for (var r = 0; r < rlen; r++) {\n if (typeof data[r] === 'undefined') {\n data[r] = [];\n }\n data[r].push(null);\n }\n } else {\n data.push([null]);\n }\n // Add new column constructor\n this.priv.columnSettings.push(constructor);\n } else {\n for (var _r = 0; _r < rlen; _r++) {\n data[_r].splice(currentIndex, 0, null);\n }\n // Add new column constructor at given index\n this.priv.columnSettings.splice(currentIndex, 0, constructor);\n }\n\n numberOfCreatedCols++;\n currentIndex++;\n }\n\n this.instance.runHooks('afterCreateCol', index, numberOfCreatedCols, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedCols;\n};\n\n/**\n * Removes row from the data array.\n *\n * @param {Number} [index] Index of the row to be removed. If not provided, the last row will be removed\n * @param {Number} [amount] Amount of the rows to be removed. If not provided, one row will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveRow\n * @fires Hooks#afterRemoveRow\n */\nDataMap.prototype.removeRow = function (index, amount, source) {\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n amount = this.instance.runHooks('modifyRemovedAmount', amount, index);\n\n index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows();\n\n var logicRows = this.physicalRowsToLogical(index, amount);\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveRow', index, amount, logicRows, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n var data = this.dataSource;\n var newData = void 0;\n\n newData = this.filterData(index, amount);\n\n if (newData) {\n data.length = 0;\n Array.prototype.push.apply(data, newData);\n }\n\n this.instance.runHooks('afterRemoveRow', index, amount, logicRows, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Removes column from the data array.\n *\n * @param {Number} [index] Index of the column to be removed. If not provided, the last column will be removed\n * @param {Number} [amount] Amount of the columns to be removed. If not provided, one column will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveCol\n * @fires Hooks#afterRemoveCol\n */\nDataMap.prototype.removeCol = function (index, amount, source) {\n if (this.instance.dataType === 'object' || this.instance.getSettings().columns) {\n throw new Error('cannot remove column with object data source or columns option specified');\n }\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n index = (this.instance.countCols() + index) % this.instance.countCols();\n\n var logicColumns = this.physicalColumnsToLogical(index, amount);\n var descendingLogicColumns = logicColumns.slice(0).sort(function (a, b) {\n return b - a;\n });\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', index, amount, logicColumns, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n var isTableUniform = true;\n var removedColumnsCount = descendingLogicColumns.length;\n var data = this.dataSource;\n\n for (var c = 0; c < removedColumnsCount; c++) {\n if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) {\n isTableUniform = false;\n }\n }\n\n if (isTableUniform) {\n for (var r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {\n data[r].splice(logicColumns[0], amount);\n }\n } else {\n for (var _r2 = 0, _rlen = this.instance.countSourceRows(); _r2 < _rlen; _r2++) {\n for (var _c = 0; _c < removedColumnsCount; _c++) {\n data[_r2].splice(descendingLogicColumns[_c], 1);\n }\n }\n\n for (var _c2 = 0; _c2 < removedColumnsCount; _c2++) {\n this.priv.columnSettings.splice(logicColumns[_c2], 1);\n }\n }\n\n this.instance.runHooks('afterRemoveCol', index, amount, logicColumns, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Add/Removes data from the column.\n *\n * @param {Number} col Index of column in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed\n * @returns {Array} Returns removed portion of columns\n */\nDataMap.prototype.spliceCol = function (col, index, amount /* , elements...*/) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var colData = this.instance.getDataAtCol(col);\n var removed = colData.slice(index, index + amount);\n var after = colData.slice(index + amount);\n\n (0, _array.extendArray)(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n (0, _array.to2dArray)(elements);\n this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');\n\n return removed;\n};\n\n/**\n * Add/Removes data from the row.\n *\n * @param {Number} row Index of row in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed\n * @returns {Array} Returns removed portion of rows\n */\nDataMap.prototype.spliceRow = function (row, index, amount /* , elements...*/) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var rowData = this.instance.getSourceDataAtRow(row);\n var removed = rowData.slice(index, index + amount);\n var after = rowData.slice(index + amount);\n\n (0, _array.extendArray)(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');\n\n return removed;\n};\n\n/**\n * Add/remove row(s) to/from the data source.\n *\n * @param {Number} index Index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @param {Object} element Row to add.\n */\nDataMap.prototype.spliceData = function (index, amount, element) {\n var continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, element);\n\n if (continueSplicing !== false) {\n this.dataSource.splice(index, amount, element);\n }\n};\n\n/**\n * Filter unwanted data elements from the data source.\n *\n * @param {Number} index Index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @returns {Array}\n */\nDataMap.prototype.filterData = function (index, amount) {\n var logicRows = this.physicalRowsToLogical(index, amount);\n var continueSplicing = this.instance.runHooks('beforeDataFilter', index, amount, logicRows);\n\n if (continueSplicing !== false) {\n var newData = this.dataSource.filter(function (row, index) {\n return logicRows.indexOf(index) == -1;\n });\n\n return newData;\n }\n};\n\n/**\n * Returns single value from the data array.\n *\n * @param {Number} row\n * @param {Number} prop\n */\nDataMap.prototype.get = function (row, prop) {\n row = this.instance.runHooks('modifyRow', row);\n\n var dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n var modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n var value = null;\n\n // try to get value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && (0, _object.hasOwnProperty)(dataRow, prop)) {\n value = dataRow[prop];\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n\n if (!out) {\n return null;\n }\n for (var i = 0, ilen = sliced.length; i < ilen; i++) {\n out = out[sliced[i]];\n\n if (typeof out === 'undefined') {\n return null;\n }\n }\n value = out;\n } else if (typeof prop === 'function') {\n /**\n * allows for interacting with complex structures, for example\n * d3/jQuery getter/setter properties:\n *\n * {columns: [{\n * data: function(row, value){\n * if(arguments.length === 1){\n * return row.property();\n * }\n * row.property(value);\n * }\n * }]}\n */\n value = prop(this.dataSource.slice(row, row + 1)[0]);\n }\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = (0, _object.createObjectPropListener)(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'get');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n return value;\n};\n\nvar copyableLookup = (0, _data.cellMethodLookupFactory)('copyable', false);\n\n/**\n * Returns single value from the data array (intended for clipboard copy to an external application).\n *\n * @param {Number} row\n * @param {Number} prop\n * @returns {String}\n */\nDataMap.prototype.getCopyable = function (row, prop) {\n if (copyableLookup.call(this.instance, row, this.propToCol(prop))) {\n return this.get(row, prop);\n }\n return '';\n};\n\n/**\n * Saves single value to the data array.\n *\n * @param {Number} row\n * @param {Number} prop\n * @param {String} value\n * @param {String} [source] Source of hook runner.\n */\nDataMap.prototype.set = function (row, prop, value, source) {\n row = this.instance.runHooks('modifyRow', row, source || 'datamapGet');\n\n var dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n var modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = (0, _object.createObjectPropListener)(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'set');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n // try to set value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && (0, _object.hasOwnProperty)(dataRow, prop)) {\n dataRow[prop] = value;\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n var i = 0;\n var ilen = void 0;\n\n for (i = 0, ilen = sliced.length - 1; i < ilen; i++) {\n if (typeof out[sliced[i]] === 'undefined') {\n out[sliced[i]] = {};\n }\n out = out[sliced[i]];\n }\n out[sliced[i]] = value;\n } else if (typeof prop === 'function') {\n /* see the `function` handler in `get` */\n prop(this.dataSource.slice(row, row + 1)[0], value);\n } else {\n dataRow[prop] = value;\n }\n};\n\n/**\n * This ridiculous piece of code maps rows Id that are present in table data to those displayed for user.\n * The trick is, the physical row id (stored in settings.data) is not necessary the same\n * as the logical (displayed) row id (e.g. when sorting is applied).\n *\n * @param {Number} index\n * @param {Number} amount\n * @fires Hooks#modifyRow\n * @returns {Number}\n */\nDataMap.prototype.physicalRowsToLogical = function (index, amount) {\n var totalRows = this.instance.countSourceRows();\n var physicRow = (totalRows + index) % totalRows;\n var logicRows = [];\n var rowsToRemove = amount;\n var row;\n\n while (physicRow < totalRows && rowsToRemove) {\n row = this.instance.runHooks('modifyRow', physicRow);\n logicRows.push(row);\n\n rowsToRemove--;\n physicRow++;\n }\n\n return logicRows;\n};\n\n/**\n *\n * @param index\n * @param amount\n * @returns {Array}\n */\nDataMap.prototype.physicalColumnsToLogical = function (index, amount) {\n var totalCols = this.instance.countCols();\n var physicalCol = (totalCols + index) % totalCols;\n var logicalCols = [];\n var colsToRemove = amount;\n\n while (physicalCol < totalCols && colsToRemove) {\n var col = this.instance.runHooks('modifyCol', physicalCol);\n\n logicalCols.push(col);\n\n colsToRemove--;\n physicalCol++;\n }\n\n return logicalCols;\n};\n\n/**\n * Clears the data array.\n */\nDataMap.prototype.clear = function () {\n for (var r = 0; r < this.instance.countSourceRows(); r++) {\n for (var c = 0; c < this.instance.countCols(); c++) {\n this.set(r, this.colToProp(c), '');\n }\n }\n};\n\n/**\n * Clear cached data length.\n */\nDataMap.prototype.clearLengthCache = function () {\n this.cachedLength = null;\n};\n\n/**\n * Get data length.\n *\n * @returns {Number}\n */\nDataMap.prototype.getLength = function () {\n var _this2 = this;\n\n var maxRows = void 0,\n maxRowsFromSettings = this.instance.getSettings().maxRows;\n\n if (maxRowsFromSettings < 0 || maxRowsFromSettings === 0) {\n maxRows = 0;\n } else {\n maxRows = maxRowsFromSettings || Infinity;\n }\n\n var length = this.instance.countSourceRows();\n\n if (this.instance.hasHook('modifyRow')) {\n var reValidate = this.skipCache;\n\n this.interval.start();\n if (length !== this.latestSourceRowsCount) {\n reValidate = true;\n }\n\n this.latestSourceRowsCount = length;\n if (this.cachedLength === null || reValidate) {\n (0, _number.rangeEach)(length - 1, function (row) {\n row = _this2.instance.runHooks('modifyRow', row);\n\n if (row === null) {\n --length;\n }\n });\n this.cachedLength = length;\n } else {\n length = this.cachedLength;\n }\n } else {\n this.interval.stop();\n }\n\n return Math.min(length, maxRows);\n};\n\n/**\n * Returns the data array.\n *\n * @returns {Array}\n */\nDataMap.prototype.getAll = function () {\n var start = {\n row: 0,\n col: 0\n };\n\n var end = {\n row: Math.max(this.instance.countSourceRows() - 1, 0),\n col: Math.max(this.instance.countCols() - 1, 0)\n };\n\n if (start.row - end.row === 0 && !this.instance.countSourceRows()) {\n return [];\n }\n\n return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER);\n};\n\n/**\n * Returns data range as array.\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @param {Number} destination Destination of datamap.get\n * @returns {Array}\n */\nDataMap.prototype.getRange = function (start, end, destination) {\n var r,\n rlen,\n c,\n clen,\n output = [],\n row;\n\n var maxRows = this.instance.getSettings().maxRows;\n var maxCols = this.instance.getSettings().maxCols;\n\n if (maxRows === 0 || maxCols === 0) {\n return [];\n }\n\n var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get;\n\n rlen = Math.min(Math.max(maxRows - 1, 0), Math.max(start.row, end.row));\n clen = Math.min(Math.max(maxCols - 1, 0), Math.max(start.col, end.col));\n\n for (r = Math.min(start.row, end.row); r <= rlen; r++) {\n row = [];\n var physicalRow = this.instance.runHooks('modifyRow', r);\n\n for (c = Math.min(start.col, end.col); c <= clen; c++) {\n\n if (physicalRow === null) {\n break;\n }\n row.push(getFn.call(this, r, this.colToProp(c)));\n }\n if (physicalRow !== null) {\n output.push(row);\n }\n }\n\n return output;\n};\n\n/**\n * Return data as text (tab separated columns).\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @returns {String}\n */\nDataMap.prototype.getText = function (start, end) {\n return _SheetClip2.default.stringify(this.getRange(start, end, this.DESTINATION_RENDERER));\n};\n\n/**\n * Return data as copyable text (tab separated columns intended for clipboard copy to an external application).\n *\n * @param {Object} [start] Start selection position\n * @param {Object} [end] End selection position\n * @returns {String}\n */\nDataMap.prototype.getCopyableText = function (start, end) {\n return _SheetClip2.default.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR));\n};\n\n/**\n * `skipLengthCache` callback.\n * @private\n * @param {Number} delay Time of the delay in milliseconds.\n */\nDataMap.prototype.onSkipLengthCache = function (delay) {\n var _this3 = this;\n\n this.skipCache = true;\n setTimeout(function () {\n _this3.skipCache = false;\n }, delay);\n};\n\n/**\n * Destroy instance.\n */\nDataMap.prototype.destroy = function () {\n this.interval.stop();\n\n this.interval = null;\n this.instance = null;\n this.priv = null;\n this.GridSettings = null;\n this.dataSource = null;\n this.cachedLength = null;\n this.duckSchema = null;\n};\n\nexports.default = DataMap;\n\n/***/ }),\n/* 200 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class DataSource\n * @private\n */\nvar DataSource = function () {\n function DataSource(hotInstance) {\n var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n _classCallCheck(this, DataSource);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Handsontable}\n */\n this.hot = hotInstance;\n /**\n * Data source\n *\n * @type {Array}\n */\n this.data = dataSource;\n /**\n * Type of data source.\n *\n * @type {String}\n * @default 'array'\n */\n this.dataType = 'array';\n\n this.colToProp = function () {};\n this.propToCol = function () {};\n }\n\n /**\n * Get all data.\n *\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n\n _createClass(DataSource, [{\n key: 'getData',\n value: function getData() {\n var toArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var result = this.data;\n\n if (toArray) {\n result = this.getByRange({ row: 0, col: 0 }, { row: Math.max(this.countRows() - 1, 0), col: Math.max(this.countColumns() - 1, 0) }, true);\n }\n\n return result;\n }\n\n /**\n * Set new data source.\n *\n * @param data {Array}\n */\n\n }, {\n key: 'setData',\n value: function setData(data) {\n this.data = data;\n }\n\n /**\n * Returns array of column values from the data source. `column` is the index of the row in the data source.\n *\n * @param {Number} column\n * @returns {Array}\n */\n\n }, {\n key: 'getAtColumn',\n value: function getAtColumn(column) {\n var _this = this;\n\n var result = [];\n\n (0, _array.arrayEach)(this.data, function (row) {\n var property = _this.colToProp(column);\n\n if (typeof property === 'string') {\n row = (0, _object.getProperty)(row, property);\n } else {\n row = row[property];\n }\n result.push(row);\n });\n\n return result;\n }\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @param {Number} row\n * @returns {Array|Object}\n */\n\n }, {\n key: 'getAtRow',\n value: function getAtRow(row) {\n return this.data[row];\n }\n\n /**\n * Returns a single value from the data.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {*}\n */\n\n }, {\n key: 'getAtCell',\n value: function getAtCell(row, column) {\n var result = null;\n\n var modifyRowData = this.hot.runHooks('modifyRowData', row);\n\n var dataRow = isNaN(modifyRowData) ? modifyRowData : this.data[row];\n\n if (dataRow) {\n var prop = this.colToProp(column);\n\n if (typeof prop === 'string') {\n result = (0, _object.getProperty)(dataRow, prop);\n } else if (typeof prop === 'function') {\n result = prop(this.data.slice(row, row + 1)[0]);\n } else {\n result = dataRow[prop];\n }\n }\n\n return result;\n }\n\n /**\n * Returns source data by passed range.\n *\n * @param {Object} start Object with `row` and `col` keys.\n * @param {Object} end Object with `row` and `col` keys.\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n }, {\n key: 'getByRange',\n value: function getByRange(start, end) {\n var _this2 = this;\n\n var toArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var startRow = Math.min(start.row, end.row);\n var startCol = Math.min(start.col, end.col);\n var endRow = Math.max(start.row, end.row);\n var endCol = Math.max(start.col, end.col);\n var result = [];\n\n (0, _number.rangeEach)(startRow, endRow, function (currentRow) {\n var row = _this2.getAtRow(currentRow);\n var newRow = void 0;\n\n if (_this2.dataType === 'array') {\n newRow = row.slice(startCol, endCol + 1);\n } else if (_this2.dataType === 'object') {\n newRow = toArray ? [] : {};\n\n (0, _number.rangeEach)(startCol, endCol, function (column) {\n var prop = _this2.colToProp(column);\n\n if (toArray) {\n newRow.push(row[prop]);\n } else {\n newRow[prop] = row[prop];\n }\n });\n }\n\n result.push(newRow);\n });\n\n return result;\n }\n\n /**\n * Count number of rows.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'countRows',\n value: function countRows() {\n return Array.isArray(this.data) ? this.data.length : 0;\n }\n\n /**\n * Count number of columns.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'countColumns',\n value: function countColumns() {\n var result = 0;\n\n if (Array.isArray(this.data)) {\n if (this.dataType === 'array') {\n result = this.data[0].length;\n } else if (this.dataType === 'object') {\n result = Object.keys(this.data[0]).length;\n }\n }\n\n return result;\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.data = null;\n this.hot = null;\n }\n }]);\n\n return DataSource;\n}();\n\nexports.default = DataSource;\n\n/***/ }),\n/* 201 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _src = __webpack_require__(11);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _editors = __webpack_require__(14);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _baseEditor = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction EditorManager(instance, priv, selection) {\n var _this = this,\n destroyed = false,\n eventManager,\n activeEditor;\n\n eventManager = new _eventManager2.default(instance);\n\n function moveSelectionAfterEnter(shiftKey) {\n selection.setSelectedHeaders(false, false, false);\n var enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves;\n\n if (shiftKey) {\n // move selection up\n selection.transformStart(-enterMoves.row, -enterMoves.col);\n } else {\n // move selection down (add a new row if needed)\n selection.transformStart(enterMoves.row, enterMoves.col, true);\n }\n }\n\n function moveSelectionUp(shiftKey) {\n if (shiftKey) {\n if (selection.selectedHeader.cols) {\n selection.setSelectedHeaders(selection.selectedHeader.rows, false, false);\n }\n selection.transformEnd(-1, 0);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(-1, 0);\n }\n }\n\n function moveSelectionDown(shiftKey) {\n if (shiftKey) {\n // expanding selection down with shift\n selection.transformEnd(1, 0);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(1, 0);\n }\n }\n\n function moveSelectionRight(shiftKey) {\n if (shiftKey) {\n selection.transformEnd(0, 1);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(0, 1);\n }\n }\n\n function moveSelectionLeft(shiftKey) {\n if (shiftKey) {\n if (selection.selectedHeader.rows) {\n selection.setSelectedHeaders(false, selection.selectedHeader.cols, false);\n }\n selection.transformEnd(0, -1);\n } else {\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(0, -1);\n }\n }\n\n function onKeyDown(event) {\n var ctrlDown, rangeModifier;\n\n if (!instance.isListening()) {\n return;\n }\n instance.runHooks('beforeKeyDown', event);\n\n if (destroyed) {\n return;\n }\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n priv.lastKeyCode = event.keyCode;\n\n if (!selection.isSelected()) {\n return;\n }\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (activeEditor && !activeEditor.isWaiting()) {\n if (!(0, _unicode.isMetaKey)(event.keyCode) && !(0, _unicode.isCtrlKey)(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) {\n _this.openEditor('', event);\n\n return;\n }\n }\n rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart;\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.A:\n if (!_this.isEditorOpened() && ctrlDown) {\n selection.selectAll();\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n }\n break;\n\n case _unicode.KEY_CODES.ARROW_UP:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionUp(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionDown(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionRight(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionLeft(event.shiftKey);\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.TAB:\n selection.setSelectedHeaders(false, false, false);\n var tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves;\n\n if (event.shiftKey) {\n // move selection left\n selection.transformStart(-tabMoves.row, -tabMoves.col);\n } else {\n // move selection right (add a new column if needed)\n selection.transformStart(tabMoves.row, tabMoves.col, true);\n }\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.BACKSPACE:\n case _unicode.KEY_CODES.DELETE:\n selection.empty(event);\n _this.prepareEditor();\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.F2:\n /* F2 */\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n event.preventDefault(); // prevent Opera from opening 'Go to Page dialog'\n break;\n\n case _unicode.KEY_CODES.ENTER:\n /* return/enter */\n if (_this.isEditorOpened()) {\n\n if (activeEditor && activeEditor.state !== _baseEditor.EditorState.WAITING) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionAfterEnter(event.shiftKey);\n } else if (instance.getSettings().enterBeginsEditing) {\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n } else {\n moveSelectionAfterEnter(event.shiftKey);\n }\n event.preventDefault(); // don't add newline to field\n (0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor\n break;\n\n case _unicode.KEY_CODES.ESCAPE:\n if (_this.isEditorOpened()) {\n _this.closeEditorAndRestoreOriginalValue(ctrlDown);\n }\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.HOME:\n selection.setSelectedHeaders(false, false, false);\n if (event.ctrlKey || event.metaKey) {\n rangeModifier(new _src.CellCoords(0, priv.selRange.from.col));\n } else {\n rangeModifier(new _src.CellCoords(priv.selRange.from.row, 0));\n }\n event.preventDefault(); // don't scroll the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.END:\n selection.setSelectedHeaders(false, false, false);\n if (event.ctrlKey || event.metaKey) {\n rangeModifier(new _src.CellCoords(instance.countRows() - 1, priv.selRange.from.col));\n } else {\n rangeModifier(new _src.CellCoords(priv.selRange.from.row, instance.countCols() - 1));\n }\n event.preventDefault(); // don't scroll the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.PAGE_UP:\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(-instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page up the window\n (0, _event.stopPropagation)(event);\n break;\n\n case _unicode.KEY_CODES.PAGE_DOWN:\n selection.setSelectedHeaders(false, false, false);\n selection.transformStart(instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page down the window\n (0, _event.stopPropagation)(event);\n break;\n default:\n break;\n }\n }\n\n function init() {\n instance.addHook('afterDocumentKeyDown', onKeyDown);\n\n eventManager.addEventListener(document.documentElement, 'keydown', function (event) {\n if (!destroyed) {\n instance.runHooks('afterDocumentKeyDown', event);\n }\n });\n\n function onDblClick(event, coords, elem) {\n // may be TD or TH\n if (elem.nodeName == 'TD') {\n _this.openEditor();\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n }\n }\n instance.view.wt.update('onCellDblClick', onDblClick);\n\n instance.addHook('afterDestroy', function () {\n destroyed = true;\n });\n }\n\n /**\n * Destroy current editor, if exists.\n *\n * @function destroyEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} revertOriginal\n */\n this.destroyEditor = function (revertOriginal) {\n this.closeEditor(revertOriginal);\n };\n\n /**\n * Get active editor.\n *\n * @function getActiveEditor\n * @memberof! Handsontable.EditorManager#\n * @returns {*}\n */\n this.getActiveEditor = function () {\n return activeEditor;\n };\n\n /**\n * Prepare text input to be displayed at given grid cell.\n *\n * @function prepareEditor\n * @memberof! Handsontable.EditorManager#\n */\n this.prepareEditor = function () {\n var row, col, prop, td, originalValue, cellProperties, editorClass;\n\n if (activeEditor && activeEditor.isWaiting()) {\n this.closeEditor(false, false, function (dataSaved) {\n if (dataSaved) {\n _this.prepareEditor();\n }\n });\n\n return;\n }\n row = priv.selRange.highlight.row;\n col = priv.selRange.highlight.col;\n prop = instance.colToProp(col);\n td = instance.getCell(row, col);\n\n originalValue = instance.getSourceDataAtCell(instance.runHooks('modifyRow', row), col);\n cellProperties = instance.getCellMeta(row, col);\n editorClass = instance.getCellEditor(cellProperties);\n\n if (editorClass) {\n activeEditor = (0, _editors.getEditorInstance)(editorClass, instance);\n activeEditor.prepare(row, col, prop, td, originalValue, cellProperties);\n } else {\n activeEditor = void 0;\n }\n };\n\n /**\n * Check is editor is opened/showed.\n *\n * @function isEditorOpened\n * @memberof! Handsontable.EditorManager#\n * @returns {Boolean}\n */\n this.isEditorOpened = function () {\n return activeEditor && activeEditor.isOpened();\n };\n\n /**\n * Open editor with initial value.\n *\n * @function openEditor\n * @memberof! Handsontable.EditorManager#\n * @param {String} initialValue\n * @param {DOMEvent} event\n */\n this.openEditor = function (initialValue, event) {\n if (activeEditor && !activeEditor.cellProperties.readOnly) {\n activeEditor.beginEditing(initialValue, event);\n } else if (activeEditor && activeEditor.cellProperties.readOnly) {\n\n // move the selection after opening the editor with ENTER key\n if (event && event.keyCode === _unicode.KEY_CODES.ENTER) {\n moveSelectionAfterEnter();\n }\n }\n };\n\n /**\n * Close editor, finish editing cell.\n *\n * @function closeEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} restoreOriginalValue\n * @param {Boolean} [ctrlDown]\n * @param {Function} [callback]\n */\n this.closeEditor = function (restoreOriginalValue, ctrlDown, callback) {\n if (activeEditor) {\n activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback);\n } else if (callback) {\n callback(false);\n }\n };\n\n /**\n * Close editor and save changes.\n *\n * @function closeEditorAndSaveChanges\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndSaveChanges = function (ctrlDown) {\n return this.closeEditor(false, ctrlDown);\n };\n\n /**\n * Close editor and restore original value.\n *\n * @function closeEditorAndRestoreOriginalValue\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndRestoreOriginalValue = function (ctrlDown) {\n return this.closeEditor(true, ctrlDown);\n };\n\n init();\n}\n\nexports.default = EditorManager;\n\n/***/ }),\n/* 202 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor CheckboxEditor\n * @class CheckboxEditor\n */\nvar CheckboxEditor = function (_BaseEditor) {\n _inherits(CheckboxEditor, _BaseEditor);\n\n function CheckboxEditor() {\n _classCallCheck(this, CheckboxEditor);\n\n return _possibleConstructorReturn(this, (CheckboxEditor.__proto__ || Object.getPrototypeOf(CheckboxEditor)).apply(this, arguments));\n }\n\n _createClass(CheckboxEditor, [{\n key: 'beginEditing',\n value: function beginEditing(initialValue, event) {\n // editorManager return double click event as undefined\n if (event === void 0) {\n var checkbox = this.TD.querySelector('input[type=\"checkbox\"]');\n\n if (!(0, _element.hasClass)(checkbox, 'htBadValue')) {\n checkbox.click();\n }\n }\n }\n }, {\n key: 'finishEditing',\n value: function finishEditing() {}\n }, {\n key: 'init',\n value: function init() {}\n }, {\n key: 'open',\n value: function open() {}\n }, {\n key: 'close',\n value: function close() {}\n }, {\n key: 'getValue',\n value: function getValue() {}\n }, {\n key: 'setValue',\n value: function setValue() {}\n }, {\n key: 'focus',\n value: function focus() {}\n }]);\n\n return CheckboxEditor;\n}(_baseEditor2.default);\n\nexports.default = CheckboxEditor;\n\n/***/ }),\n/* 203 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _pikaday = __webpack_require__(299);\n\nvar _pikaday2 = _interopRequireDefault(_pikaday);\n\n__webpack_require__(182);\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor DateEditor\n * @class DateEditor\n * @dependencies TextEditor moment pikaday\n */\nvar DateEditor = function (_TextEditor) {\n _inherits(DateEditor, _TextEditor);\n\n /**\n * @param {Core} hotInstance Handsontable instance\n * @private\n */\n function DateEditor(hotInstance) {\n _classCallCheck(this, DateEditor);\n\n // TODO: Move this option to general settings\n var _this = _possibleConstructorReturn(this, (DateEditor.__proto__ || Object.getPrototypeOf(DateEditor)).call(this, hotInstance));\n\n _this.defaultDateFormat = 'DD/MM/YYYY';\n _this.isCellEdited = false;\n _this.parentDestroyed = false;\n return _this;\n }\n\n _createClass(DateEditor, [{\n key: 'init',\n value: function init() {\n var _this2 = this;\n\n if (typeof _moment2.default !== 'function') {\n throw new Error('You need to include moment.js to your project.');\n }\n\n if (typeof _pikaday2.default !== 'function') {\n throw new Error('You need to include Pikaday to your project.');\n }\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'init', this).call(this);\n this.instance.addHook('afterDestroy', function () {\n _this2.parentDestroyed = true;\n _this2.destroyElements();\n });\n }\n\n /**\n * Create data picker instance\n */\n\n }, {\n key: 'createElements',\n value: function createElements() {\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'createElements', this).call(this);\n\n this.datePicker = document.createElement('DIV');\n this.datePickerStyle = this.datePicker.style;\n this.datePickerStyle.position = 'absolute';\n this.datePickerStyle.top = 0;\n this.datePickerStyle.left = 0;\n this.datePickerStyle.zIndex = 9999;\n\n (0, _element.addClass)(this.datePicker, 'htDatepickerHolder');\n document.body.appendChild(this.datePicker);\n\n this.$datePicker = new _pikaday2.default(this.getDatePickerConfig());\n var eventManager = new _eventManager2.default(this);\n\n /**\n * Prevent recognizing clicking on datepicker as clicking outside of table\n */\n eventManager.addEventListener(this.datePicker, 'mousedown', function (event) {\n return (0, _event.stopPropagation)(event);\n });\n this.hideDatepicker();\n }\n\n /**\n * Destroy data picker instance\n */\n\n }, {\n key: 'destroyElements',\n value: function destroyElements() {\n this.$datePicker.destroy();\n }\n\n /**\n * Prepare editor to appear\n *\n * @param {Number} row Row index\n * @param {Number} col Column index\n * @param {String} prop Property name (passed when datasource is an array of objects)\n * @param {HTMLTableCellElement} td Table cell element\n * @param {*} originalValue Original value\n * @param {Object} cellProperties Object with cell properties ({@see Core#getCellMeta})\n */\n\n }, {\n key: 'prepare',\n value: function prepare(row, col, prop, td, originalValue, cellProperties) {\n this._opened = false;\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'prepare', this).call(this, row, col, prop, td, originalValue, cellProperties);\n }\n\n /**\n * Open editor\n *\n * @param {Event} [event=null]\n */\n\n }, {\n key: 'open',\n value: function open() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'open', this).call(this);\n this.showDatepicker(event);\n }\n\n /**\n * Close editor\n */\n\n }, {\n key: 'close',\n value: function close() {\n var _this3 = this;\n\n this._opened = false;\n this.instance._registerTimeout(setTimeout(function () {\n _this3.instance.selection.refreshBorders();\n }, 0));\n\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'close', this).call(this);\n }\n\n /**\n * @param {Boolean} [isCancelled=false]\n * @param {Boolean} [ctrlDown=false]\n */\n\n }, {\n key: 'finishEditing',\n value: function finishEditing() {\n var isCancelled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (isCancelled) {\n // pressed ESC, restore original value\n // var value = this.instance.getDataAtCell(this.row, this.col);\n var value = this.originalValue;\n\n if (value !== void 0) {\n this.setValue(value);\n }\n }\n this.hideDatepicker();\n _get(DateEditor.prototype.__proto__ || Object.getPrototypeOf(DateEditor.prototype), 'finishEditing', this).call(this, isCancelled, ctrlDown);\n }\n\n /**\n * Show data picker\n *\n * @param {Event} event\n */\n\n }, {\n key: 'showDatepicker',\n value: function showDatepicker(event) {\n this.$datePicker.config(this.getDatePickerConfig());\n\n var offset = this.TD.getBoundingClientRect();\n var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;\n var datePickerConfig = this.$datePicker.config();\n var dateStr = void 0;\n var isMouseDown = this.instance.view.isMouseDown();\n var isMeta = event ? (0, _unicode.isMetaKey)(event.keyCode) : false;\n\n this.datePickerStyle.top = window.pageYOffset + offset.top + (0, _element.outerHeight)(this.TD) + 'px';\n this.datePickerStyle.left = window.pageXOffset + offset.left + 'px';\n\n this.$datePicker._onInputFocus = function () {};\n datePickerConfig.format = dateFormat;\n\n if (this.originalValue) {\n dateStr = this.originalValue;\n\n if ((0, _moment2.default)(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment((0, _moment2.default)(dateStr, dateFormat), true);\n }\n\n // workaround for date/time cells - pikaday resets the cell value to 12:00 AM by default, this will overwrite the value.\n if (this.getValue() !== this.originalValue) {\n this.setValue(this.originalValue);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else if (this.cellProperties.defaultDate) {\n dateStr = this.cellProperties.defaultDate;\n\n datePickerConfig.defaultDate = dateStr;\n\n if ((0, _moment2.default)(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment((0, _moment2.default)(dateStr, dateFormat), true);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else {\n // if a default date is not defined, set a soft-default-date: display the current day and month in the\n // datepicker, but don't fill the editor input\n this.$datePicker.gotoToday();\n }\n\n this.datePickerStyle.display = 'block';\n this.$datePicker.show();\n }\n\n /**\n * Hide data picker\n */\n\n }, {\n key: 'hideDatepicker',\n value: function hideDatepicker() {\n this.datePickerStyle.display = 'none';\n this.$datePicker.hide();\n }\n\n /**\n * Get date picker options.\n *\n * @returns {Object}\n */\n\n }, {\n key: 'getDatePickerConfig',\n value: function getDatePickerConfig() {\n var _this4 = this;\n\n var htInput = this.TEXTAREA;\n var options = {};\n\n if (this.cellProperties && this.cellProperties.datePickerConfig) {\n (0, _object.deepExtend)(options, this.cellProperties.datePickerConfig);\n }\n var origOnSelect = options.onSelect;\n var origOnClose = options.onClose;\n\n options.field = htInput;\n options.trigger = htInput;\n options.container = this.datePicker;\n options.bound = false;\n options.format = options.format || this.defaultDateFormat;\n options.reposition = options.reposition || false;\n options.onSelect = function (dateStr) {\n if (!isNaN(dateStr.getTime())) {\n dateStr = (0, _moment2.default)(dateStr).format(_this4.cellProperties.dateFormat || _this4.defaultDateFormat);\n }\n _this4.setValue(dateStr);\n _this4.hideDatepicker();\n\n if (origOnSelect) {\n origOnSelect();\n }\n };\n options.onClose = function () {\n if (!_this4.parentDestroyed) {\n _this4.finishEditing(false);\n }\n if (origOnClose) {\n origOnClose();\n }\n };\n\n return options;\n }\n }]);\n\n return DateEditor;\n}(_textEditor2.default);\n\nexports.default = DateEditor;\n\n/***/ }),\n/* 204 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _autocompleteEditor = __webpack_require__(147);\n\nvar _autocompleteEditor2 = _interopRequireDefault(_autocompleteEditor);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor DropdownEditor\n * @class DropdownEditor\n * @dependencies AutocompleteEditor\n */\nvar DropdownEditor = function (_AutocompleteEditor) {\n _inherits(DropdownEditor, _AutocompleteEditor);\n\n function DropdownEditor() {\n _classCallCheck(this, DropdownEditor);\n\n return _possibleConstructorReturn(this, (DropdownEditor.__proto__ || Object.getPrototypeOf(DropdownEditor)).apply(this, arguments));\n }\n\n _createClass(DropdownEditor, [{\n key: 'prepare',\n value: function prepare(row, col, prop, td, originalValue, cellProperties) {\n _get(DropdownEditor.prototype.__proto__ || Object.getPrototypeOf(DropdownEditor.prototype), 'prepare', this).call(this, row, col, prop, td, originalValue, cellProperties);\n this.cellProperties.filter = false;\n this.cellProperties.strict = true;\n }\n }]);\n\n return DropdownEditor;\n}(_autocompleteEditor2.default);\n\n_pluginHooks2.default.getSingleton().add('beforeValidate', function (value, row, col, source) {\n var cellMeta = this.getCellMeta(row, this.propToCol(col));\n\n if (cellMeta.editor === DropdownEditor) {\n if (cellMeta.strict === void 0) {\n cellMeta.filter = false;\n cellMeta.strict = true;\n }\n }\n});\n\nexports.default = DropdownEditor;\n\n/***/ }),\n/* 205 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _unicode = __webpack_require__(16);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MobileTextEditor = _baseEditor2.default.prototype.extend();\nvar domDimensionsCache = {};\n\n/**\n * @private\n * @editor MobileTextEditor\n * @class MobileTextEditor\n */\nvar createControls = function createControls() {\n this.controls = {};\n\n this.controls.leftButton = document.createElement('DIV');\n this.controls.leftButton.className = 'leftButton';\n this.controls.rightButton = document.createElement('DIV');\n this.controls.rightButton.className = 'rightButton';\n this.controls.upButton = document.createElement('DIV');\n this.controls.upButton.className = 'upButton';\n this.controls.downButton = document.createElement('DIV');\n this.controls.downButton.className = 'downButton';\n\n for (var button in this.controls) {\n if (Object.prototype.hasOwnProperty.call(this.controls, button)) {\n this.positionControls.appendChild(this.controls[button]);\n }\n }\n};\n\nMobileTextEditor.prototype.valueChanged = function () {\n return this.initValue != this.getValue();\n};\n\nMobileTextEditor.prototype.init = function () {\n var that = this;\n this.eventManager = new _eventManager2.default(this.instance);\n\n this.createElements();\n this.bindEvents();\n\n this.instance.addHook('afterDestroy', function () {\n that.destroy();\n });\n};\n\nMobileTextEditor.prototype.getValue = function () {\n return this.TEXTAREA.value;\n};\n\nMobileTextEditor.prototype.setValue = function (newValue) {\n this.initValue = newValue;\n\n this.TEXTAREA.value = newValue;\n};\n\nMobileTextEditor.prototype.createElements = function () {\n this.editorContainer = document.createElement('DIV');\n this.editorContainer.className = 'htMobileEditorContainer';\n\n this.cellPointer = document.createElement('DIV');\n this.cellPointer.className = 'cellPointer';\n\n this.moveHandle = document.createElement('DIV');\n this.moveHandle.className = 'moveHandle';\n\n this.inputPane = document.createElement('DIV');\n this.inputPane.className = 'inputs';\n\n this.positionControls = document.createElement('DIV');\n this.positionControls.className = 'positionControls';\n\n this.TEXTAREA = document.createElement('TEXTAREA');\n (0, _element.addClass)(this.TEXTAREA, 'handsontableInput');\n\n this.inputPane.appendChild(this.TEXTAREA);\n\n this.editorContainer.appendChild(this.cellPointer);\n this.editorContainer.appendChild(this.moveHandle);\n this.editorContainer.appendChild(this.inputPane);\n this.editorContainer.appendChild(this.positionControls);\n\n createControls.call(this);\n\n document.body.appendChild(this.editorContainer);\n};\n\nMobileTextEditor.prototype.onBeforeKeyDown = function (event) {\n var instance = this;\n var that = instance.getActiveEditor();\n\n if (event.target !== that.TEXTAREA || (0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ENTER:\n that.close();\n event.preventDefault(); // don't add newline to field\n break;\n case _unicode.KEY_CODES.BACKSPACE:\n (0, _event.stopImmediatePropagation)(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n break;\n default:\n break;\n }\n};\n\nMobileTextEditor.prototype.open = function () {\n this.instance.addHook('beforeKeyDown', this.onBeforeKeyDown);\n\n (0, _element.addClass)(this.editorContainer, 'active');\n (0, _element.removeClass)(this.cellPointer, 'hidden');\n\n this.updateEditorPosition();\n};\n\nMobileTextEditor.prototype.focus = function () {\n this.TEXTAREA.focus();\n (0, _element.setCaretPosition)(this.TEXTAREA, this.TEXTAREA.value.length);\n};\n\nMobileTextEditor.prototype.close = function () {\n this.TEXTAREA.blur();\n this.instance.removeHook('beforeKeyDown', this.onBeforeKeyDown);\n\n (0, _element.removeClass)(this.editorContainer, 'active');\n};\n\nMobileTextEditor.prototype.scrollToView = function () {\n var coords = this.instance.getSelectedRange().highlight;\n this.instance.view.scrollViewport(coords);\n};\n\nMobileTextEditor.prototype.hideCellPointer = function () {\n if (!(0, _element.hasClass)(this.cellPointer, 'hidden')) {\n (0, _element.addClass)(this.cellPointer, 'hidden');\n }\n};\n\nMobileTextEditor.prototype.updateEditorPosition = function (x, y) {\n if (x && y) {\n x = parseInt(x, 10);\n y = parseInt(y, 10);\n\n this.editorContainer.style.top = y + 'px';\n this.editorContainer.style.left = x + 'px';\n } else {\n var selection = this.instance.getSelected(),\n selectedCell = this.instance.getCell(selection[0], selection[1]);\n\n // cache sizes\n if (!domDimensionsCache.cellPointer) {\n domDimensionsCache.cellPointer = {\n height: (0, _element.outerHeight)(this.cellPointer),\n width: (0, _element.outerWidth)(this.cellPointer)\n };\n }\n if (!domDimensionsCache.editorContainer) {\n domDimensionsCache.editorContainer = {\n width: (0, _element.outerWidth)(this.editorContainer)\n };\n }\n\n if (selectedCell !== undefined) {\n var scrollLeft = this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer == window ? 0 : (0, _element.getScrollLeft)(this.instance.view.wt.wtOverlays.leftOverlay.holder);\n var scrollTop = this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer == window ? 0 : (0, _element.getScrollTop)(this.instance.view.wt.wtOverlays.topOverlay.holder);\n\n var selectedCellOffset = (0, _element.offset)(selectedCell),\n selectedCellWidth = (0, _element.outerWidth)(selectedCell),\n currentScrollPosition = {\n x: scrollLeft,\n y: scrollTop\n };\n\n this.editorContainer.style.top = parseInt(selectedCellOffset.top + (0, _element.outerHeight)(selectedCell) - currentScrollPosition.y + domDimensionsCache.cellPointer.height, 10) + 'px';\n this.editorContainer.style.left = parseInt(window.innerWidth / 2 - domDimensionsCache.editorContainer.width / 2, 10) + 'px';\n\n if (selectedCellOffset.left + selectedCellWidth / 2 > parseInt(this.editorContainer.style.left, 10) + domDimensionsCache.editorContainer.width) {\n this.editorContainer.style.left = window.innerWidth - domDimensionsCache.editorContainer.width + 'px';\n } else if (selectedCellOffset.left + selectedCellWidth / 2 < parseInt(this.editorContainer.style.left, 10) + 20) {\n this.editorContainer.style.left = 0 + 'px';\n }\n\n this.cellPointer.style.left = parseInt(selectedCellOffset.left - domDimensionsCache.cellPointer.width / 2 - (0, _element.offset)(this.editorContainer).left + selectedCellWidth / 2 - currentScrollPosition.x, 10) + 'px';\n }\n }\n};\n\nMobileTextEditor.prototype.updateEditorData = function () {\n var selected = this.instance.getSelected(),\n selectedValue = this.instance.getDataAtCell(selected[0], selected[1]);\n\n this.row = selected[0];\n this.col = selected[1];\n this.setValue(selectedValue);\n this.updateEditorPosition();\n};\n\nMobileTextEditor.prototype.prepareAndSave = function () {\n var val;\n\n if (!this.valueChanged()) {\n return;\n }\n\n if (this.instance.getSettings().trimWhitespace) {\n val = [[String.prototype.trim.call(this.getValue())]];\n } else {\n val = [[this.getValue()]];\n }\n\n this.saveValue(val);\n};\n\nMobileTextEditor.prototype.bindEvents = function () {\n var that = this;\n\n this.eventManager.addEventListener(this.controls.leftButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(0, -1, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.rightButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(0, 1, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.upButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(-1, 0, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n this.eventManager.addEventListener(this.controls.downButton, 'touchend', function (event) {\n that.prepareAndSave();\n that.instance.selection.transformStart(1, 0, null, true);\n that.updateEditorData();\n event.preventDefault();\n });\n\n this.eventManager.addEventListener(this.moveHandle, 'touchstart', function (event) {\n if (event.touches.length == 1) {\n var touch = event.touches[0];\n var onTouchPosition = {\n x: that.editorContainer.offsetLeft,\n y: that.editorContainer.offsetTop\n };\n var onTouchOffset = {\n x: touch.pageX - onTouchPosition.x,\n y: touch.pageY - onTouchPosition.y\n };\n\n that.eventManager.addEventListener(this, 'touchmove', function (event) {\n var touch = event.touches[0];\n that.updateEditorPosition(touch.pageX - onTouchOffset.x, touch.pageY - onTouchOffset.y);\n that.hideCellPointer();\n event.preventDefault();\n });\n }\n });\n\n this.eventManager.addEventListener(document.body, 'touchend', function (event) {\n if (!(0, _element.isChildOf)(event.target, that.editorContainer) && !(0, _element.isChildOf)(event.target, that.instance.rootElement)) {\n that.close();\n }\n });\n\n this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.leftOverlay.holder, 'scroll', function (event) {\n if (that.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer != window) {\n that.hideCellPointer();\n }\n });\n\n this.eventManager.addEventListener(this.instance.view.wt.wtOverlays.topOverlay.holder, 'scroll', function (event) {\n if (that.instance.view.wt.wtOverlays.topOverlay.trimmingContainer != window) {\n that.hideCellPointer();\n }\n });\n};\n\nMobileTextEditor.prototype.destroy = function () {\n this.eventManager.clear();\n\n this.editorContainer.parentNode.removeChild(this.editorContainer);\n};\n\nexports.default = MobileTextEditor;\n\n/***/ }),\n/* 206 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor NumericEditor\n * @class NumericEditor\n * @dependencies TextEditor numbro\n */\nvar NumericEditor = function (_TextEditor) {\n _inherits(NumericEditor, _TextEditor);\n\n function NumericEditor() {\n _classCallCheck(this, NumericEditor);\n\n return _possibleConstructorReturn(this, (NumericEditor.__proto__ || Object.getPrototypeOf(NumericEditor)).apply(this, arguments));\n }\n\n _createClass(NumericEditor, [{\n key: 'beginEditing',\n\n /**\n * @param {*} initialValue\n */\n value: function beginEditing(initialValue) {\n if (typeof initialValue === 'undefined' && this.originalValue) {\n if (typeof this.cellProperties.language !== 'undefined') {\n _numbro2.default.culture(this.cellProperties.language);\n }\n var decimalDelimiter = _numbro2.default.cultureData().delimiters.decimal;\n initialValue = ('' + this.originalValue).replace('.', decimalDelimiter);\n }\n _get(NumericEditor.prototype.__proto__ || Object.getPrototypeOf(NumericEditor.prototype), 'beginEditing', this).call(this, initialValue);\n }\n }]);\n\n return NumericEditor;\n}(_textEditor2.default);\n\nexports.default = NumericEditor;\n\n/***/ }),\n/* 207 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _textEditor = __webpack_require__(43);\n\nvar _textEditor2 = _interopRequireDefault(_textEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @editor PasswordEditor\n * @class PasswordEditor\n * @dependencies TextEditor\n */\nvar PasswordEditor = function (_TextEditor) {\n _inherits(PasswordEditor, _TextEditor);\n\n function PasswordEditor() {\n _classCallCheck(this, PasswordEditor);\n\n return _possibleConstructorReturn(this, (PasswordEditor.__proto__ || Object.getPrototypeOf(PasswordEditor)).apply(this, arguments));\n }\n\n _createClass(PasswordEditor, [{\n key: 'createElements',\n value: function createElements() {\n _get(PasswordEditor.prototype.__proto__ || Object.getPrototypeOf(PasswordEditor.prototype), 'createElements', this).call(this);\n\n this.TEXTAREA = document.createElement('input');\n this.TEXTAREA.setAttribute('type', 'password');\n this.TEXTAREA.className = 'handsontableInput';\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n (0, _element.empty)(this.TEXTAREA_PARENT);\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n }\n }]);\n\n return PasswordEditor;\n}(_textEditor2.default);\n\nexports.default = PasswordEditor;\n\n/***/ }),\n/* 208 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nvar _unicode = __webpack_require__(16);\n\nvar _baseEditor = __webpack_require__(36);\n\nvar _baseEditor2 = _interopRequireDefault(_baseEditor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SelectEditor = _baseEditor2.default.prototype.extend();\n\n/**\n * @private\n * @editor SelectEditor\n * @class SelectEditor\n */\nSelectEditor.prototype.init = function () {\n this.select = document.createElement('SELECT');\n (0, _element.addClass)(this.select, 'htSelectEditor');\n this.select.style.display = 'none';\n this.instance.rootElement.appendChild(this.select);\n this.registerHooks();\n};\n\nSelectEditor.prototype.registerHooks = function () {\n var _this = this;\n\n this.instance.addHook('afterScrollHorizontally', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterScrollVertically', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterColumnResize', function () {\n return _this.refreshDimensions();\n });\n this.instance.addHook('afterRowResize', function () {\n return _this.refreshDimensions();\n });\n};\n\nSelectEditor.prototype.prepare = function () {\n _baseEditor2.default.prototype.prepare.apply(this, arguments);\n\n var selectOptions = this.cellProperties.selectOptions;\n var options;\n\n if (typeof selectOptions == 'function') {\n options = this.prepareOptions(selectOptions(this.row, this.col, this.prop));\n } else {\n options = this.prepareOptions(selectOptions);\n }\n\n (0, _element.empty)(this.select);\n\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option)) {\n var optionElement = document.createElement('OPTION');\n optionElement.value = option;\n (0, _element.fastInnerHTML)(optionElement, options[option]);\n this.select.appendChild(optionElement);\n }\n }\n};\n\nSelectEditor.prototype.prepareOptions = function (optionsToPrepare) {\n var preparedOptions = {};\n\n if (Array.isArray(optionsToPrepare)) {\n for (var i = 0, len = optionsToPrepare.length; i < len; i++) {\n preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i];\n }\n } else if ((typeof optionsToPrepare === 'undefined' ? 'undefined' : _typeof(optionsToPrepare)) == 'object') {\n preparedOptions = optionsToPrepare;\n }\n\n return preparedOptions;\n};\n\nSelectEditor.prototype.getValue = function () {\n return this.select.value;\n};\n\nSelectEditor.prototype.setValue = function (value) {\n this.select.value = value;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n var instance = this;\n var editor = instance.getActiveEditor();\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ARROW_UP:\n var previousOptionIndex = editor.select.selectedIndex - 1;\n if (previousOptionIndex >= 0) {\n editor.select[previousOptionIndex].selected = true;\n }\n\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n var nextOptionIndex = editor.select.selectedIndex + 1;\n if (nextOptionIndex <= editor.select.length - 1) {\n editor.select[nextOptionIndex].selected = true;\n }\n\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n break;\n default:\n break;\n }\n};\n\nSelectEditor.prototype.open = function () {\n this._opened = true;\n this.refreshDimensions();\n this.select.style.display = '';\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.close = function () {\n this._opened = false;\n this.select.style.display = 'none';\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.focus = function () {\n this.select.focus();\n};\n\nSelectEditor.prototype.refreshValue = function () {\n var sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nSelectEditor.prototype.refreshDimensions = function () {\n if (this.state !== _baseEditor.EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close();\n\n return;\n }\n var width = (0, _element.outerWidth)(this.TD) + 1,\n height = (0, _element.outerHeight)(this.TD) + 1,\n currentOffset = (0, _element.offset)(this.TD),\n containerOffset = (0, _element.offset)(this.instance.rootElement),\n scrollableContainer = (0, _element.getScrollableElement)(this.TD),\n editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0),\n editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),\n editorSection = this.checkEditorSection(),\n cssTransformOffset;\n\n var settings = this.instance.getSettings();\n var rowHeadersCount = settings.rowHeaders ? 1 : 0;\n var colHeadersCount = settings.colHeaders ? 1 : 0;\n\n switch (editorSection) {\n case 'top':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = (0, _element.getCssTransform)(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n if (this.instance.getSelected()[0] === 0) {\n editTop += 1;\n }\n\n if (this.instance.getSelected()[1] === 0) {\n editLeft += 1;\n }\n\n var selectStyle = this.select.style;\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n selectStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n (0, _element.resetCssTransform)(this.select);\n }\n var cellComputedStyle = (0, _element.getComputedStyle)(this.TD);\n\n if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) {\n height -= 1;\n }\n if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) {\n width -= 1;\n }\n\n selectStyle.height = height + 'px';\n selectStyle.minWidth = width + 'px';\n selectStyle.top = editTop + 'px';\n selectStyle.left = editLeft + 'px';\n selectStyle.margin = '0px';\n};\n\nSelectEditor.prototype.getEditedCell = function () {\n var editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 101;\n break;\n case 'corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.select.style.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nexports.default = SelectEditor;\n\n/***/ }),\n/* 209 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n__webpack_require__(96);\n\n__webpack_require__(113);\n\n__webpack_require__(122);\n\n__webpack_require__(123);\n\n__webpack_require__(107);\n\n__webpack_require__(121);\n\n__webpack_require__(104);\n\n__webpack_require__(105);\n\n__webpack_require__(106);\n\n__webpack_require__(95);\n\n__webpack_require__(118);\n\n__webpack_require__(116);\n\n__webpack_require__(114);\n\n__webpack_require__(119);\n\n__webpack_require__(120);\n\n__webpack_require__(115);\n\n__webpack_require__(117);\n\n__webpack_require__(108);\n\n__webpack_require__(109);\n\n__webpack_require__(110);\n\n__webpack_require__(112);\n\n__webpack_require__(111);\n\n__webpack_require__(93);\n\n__webpack_require__(94);\n\n__webpack_require__(89);\n\n__webpack_require__(92);\n\n__webpack_require__(91);\n\n__webpack_require__(90);\n\n__webpack_require__(68);\n\n__webpack_require__(98);\n\n__webpack_require__(99);\n\n__webpack_require__(101);\n\n__webpack_require__(100);\n\n__webpack_require__(97);\n\n__webpack_require__(103);\n\n__webpack_require__(102);\n\n__webpack_require__(124);\n\n__webpack_require__(127);\n\n__webpack_require__(125);\n\n__webpack_require__(126);\n\n__webpack_require__(129);\n\n__webpack_require__(128);\n\n__webpack_require__(131);\n\n__webpack_require__(130);\n\n__webpack_require__(179);\n\n__webpack_require__(180);\n\n__webpack_require__(181);\n\nvar _editors = __webpack_require__(14);\n\nvar _renderers = __webpack_require__(9);\n\nvar _validators = __webpack_require__(26);\n\nvar _cellTypes = __webpack_require__(63);\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _jquery = __webpack_require__(177);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _array = __webpack_require__(1);\n\nvar arrayHelpers = _interopRequireWildcard(_array);\n\nvar _browser = __webpack_require__(25);\n\nvar browserHelpers = _interopRequireWildcard(_browser);\n\nvar _data = __webpack_require__(65);\n\nvar dataHelpers = _interopRequireWildcard(_data);\n\nvar _date = __webpack_require__(88);\n\nvar dateHelpers = _interopRequireWildcard(_date);\n\nvar _feature = __webpack_require__(34);\n\nvar featureHelpers = _interopRequireWildcard(_feature);\n\nvar _function = __webpack_require__(35);\n\nvar functionHelpers = _interopRequireWildcard(_function);\n\nvar _mixed = __webpack_require__(20);\n\nvar mixedHelpers = _interopRequireWildcard(_mixed);\n\nvar _number = __webpack_require__(6);\n\nvar numberHelpers = _interopRequireWildcard(_number);\n\nvar _object = __webpack_require__(2);\n\nvar objectHelpers = _interopRequireWildcard(_object);\n\nvar _setting = __webpack_require__(66);\n\nvar settingHelpers = _interopRequireWildcard(_setting);\n\nvar _string = __webpack_require__(27);\n\nvar stringHelpers = _interopRequireWildcard(_string);\n\nvar _unicode = __webpack_require__(16);\n\nvar unicodeHelpers = _interopRequireWildcard(_unicode);\n\nvar _element = __webpack_require__(0);\n\nvar domHelpers = _interopRequireWildcard(_element);\n\nvar _event = __webpack_require__(7);\n\nvar domEventHelpers = _interopRequireWildcard(_event);\n\nvar _index = __webpack_require__(178);\n\nvar plugins = _interopRequireWildcard(_index);\n\nvar _plugins = __webpack_require__(5);\n\nvar _defaultSettings = __webpack_require__(87);\n\nvar _defaultSettings2 = _interopRequireDefault(_defaultSettings);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Handsontable(rootElement, userSettings) {\n var instance = new _core2.default(rootElement, userSettings || {});\n\n instance.init();\n\n return instance;\n}\n\n(0, _jquery2.default)(Handsontable);\n\nHandsontable.Core = _core2.default;\nHandsontable.DefaultSettings = _defaultSettings2.default;\nHandsontable.EventManager = _eventManager2.default;\nHandsontable._getListenersCounter = _eventManager.getListenersCounter; // For MemoryLeak tests\n\nHandsontable.buildDate = \"2017-05-30T10:18:32.902Z\";\nHandsontable.packageName = \"handsontable\";\nHandsontable.version = \"0.32.0\";\n\nvar baseVersion = undefined;\n\nif (baseVersion) {\n Handsontable.baseVersion = baseVersion;\n}\n\n// Export Hooks singleton\nHandsontable.hooks = _pluginHooks2.default.getSingleton();\n\n// TODO: Remove this exports after rewrite tests about this module\nHandsontable.__GhostTable = _ghostTable2.default;\n//\n\n// Export all helpers to the Handsontable object\nvar HELPERS = [arrayHelpers, browserHelpers, dataHelpers, dateHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers];\nvar DOM = [domHelpers, domEventHelpers];\n\nHandsontable.helper = {};\nHandsontable.dom = {};\n\n// Fill general helpers.\narrayHelpers.arrayEach(HELPERS, function (helper) {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) {\n if (key.charAt(0) !== '_') {\n Handsontable.helper[key] = helper[key];\n }\n });\n});\n\n// Fill DOM helpers.\narrayHelpers.arrayEach(DOM, function (helper) {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), function (key) {\n if (key.charAt(0) !== '_') {\n Handsontable.dom[key] = helper[key];\n }\n });\n});\n\n// Export cell types.\nHandsontable.cellTypes = {};\n\narrayHelpers.arrayEach((0, _cellTypes.getRegisteredCellTypeNames)(), function (cellTypeName) {\n Handsontable.cellTypes[cellTypeName] = (0, _cellTypes.getCellType)(cellTypeName);\n});\n\nHandsontable.cellTypes.registerCellType = _cellTypes.registerCellType;\nHandsontable.cellTypes.getCellType = _cellTypes.getCellType;\n\n// Export all registered editors from the Handsontable.\nHandsontable.editors = {};\n\narrayHelpers.arrayEach((0, _editors.getRegisteredEditorNames)(), function (editorName) {\n Handsontable.editors[stringHelpers.toUpperCaseFirst(editorName) + 'Editor'] = (0, _editors.getEditor)(editorName);\n});\n\nHandsontable.editors.registerEditor = _editors.registerEditor;\nHandsontable.editors.getEditor = _editors.getEditor;\n\n// Export all registered renderers from the Handsontable.\nHandsontable.renderers = {};\n\narrayHelpers.arrayEach((0, _renderers.getRegisteredRendererNames)(), function (rendererName) {\n var renderer = (0, _renderers.getRenderer)(rendererName);\n\n if (rendererName === 'base') {\n Handsontable.renderers.cellDecorator = renderer;\n }\n Handsontable.renderers[stringHelpers.toUpperCaseFirst(rendererName) + 'Renderer'] = renderer;\n});\n\nHandsontable.renderers.registerRenderer = _renderers.registerRenderer;\nHandsontable.renderers.getRenderer = _renderers.getRenderer;\n\n// Export all registered validators from the Handsontable.\nHandsontable.validators = {};\n\narrayHelpers.arrayEach((0, _validators.getRegisteredValidatorNames)(), function (validatorName) {\n Handsontable.validators[stringHelpers.toUpperCaseFirst(validatorName) + 'Validator'] = (0, _validators.getValidator)(validatorName);\n});\n\nHandsontable.validators.registerValidator = _validators.registerValidator;\nHandsontable.validators.getValidator = _validators.getValidator;\n\n// Export all registered plugins from the Handsontable.\nHandsontable.plugins = {};\n\narrayHelpers.arrayEach(Object.getOwnPropertyNames(plugins), function (pluginName) {\n var plugin = plugins[pluginName];\n\n if (pluginName === 'Base') {\n Handsontable.plugins[pluginName + 'Plugin'] = plugin;\n } else {\n Handsontable.plugins[pluginName] = plugin;\n }\n});\n\nHandsontable.plugins.registerPlugin = _plugins.registerPlugin;\n\n// Export Handsontable\nmodule.exports = Handsontable;\n\n/***/ }),\n/* 210 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction MultiMap() {\n var map = {\n arrayMap: [],\n weakMap: new WeakMap()\n };\n\n return {\n get: function get(key) {\n if (canBeAnArrayMapKey(key)) {\n return map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n return map.weakMap.get(key);\n }\n },\n set: function set(key, value) {\n if (canBeAnArrayMapKey(key)) {\n map.arrayMap[key] = value;\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.set(key, value);\n } else {\n throw new Error('Invalid key type');\n }\n },\n delete: function _delete(key) {\n if (canBeAnArrayMapKey(key)) {\n delete map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.delete(key);\n }\n }\n };\n\n function canBeAnArrayMapKey(obj) {\n return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number');\n }\n\n function canBeAWeakMapKey(obj) {\n return obj !== null && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == 'object' || typeof obj == 'function');\n }\n\n function isNaNSymbol(obj) {\n /* eslint-disable no-self-compare */\n return obj !== obj; // NaN === NaN is always false\n }\n}\n\nexports.default = MultiMap;\n\n/***/ }),\n/* 211 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _array = __webpack_require__(1);\n\nvar _feature = __webpack_require__(34);\n\nvar _element = __webpack_require__(0);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nvar _samplesGenerator = __webpack_require__(154);\n\nvar _samplesGenerator2 = _interopRequireDefault(_samplesGenerator);\n\nvar _string = __webpack_require__(27);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\n\n/**\n * @plugin AutoColumnSize\n *\n * @description\n * This plugin allows to set column widths based on their widest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it enabled (same as if it was declared as `true`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the widths of all cells to\n * resize the columns accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the column widths manually.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#autoColumnSize}.\n *\n * @example\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoColumnSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoColumnSize');\n *\n * plugin.getColumnWidth(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\n\nvar AutoColumnSize = function (_BasePlugin) {\n _inherits(AutoColumnSize, _BasePlugin);\n\n _createClass(AutoColumnSize, null, [{\n key: 'CALCULATION_STEP',\n get: function get() {\n return 50;\n }\n }, {\n key: 'SYNC_CALCULATION_LIMIT',\n get: function get() {\n return 50;\n }\n }]);\n\n function AutoColumnSize(hotInstance) {\n _classCallCheck(this, AutoColumnSize);\n\n var _this = _possibleConstructorReturn(this, (AutoColumnSize.__proto__ || Object.getPrototypeOf(AutoColumnSize)).call(this, hotInstance));\n\n privatePool.set(_this, {\n /**\n * Cached column header names. It is used to diff current column headers with previous state and detect which\n * columns width should be updated.\n *\n * @private\n * @type {Array}\n */\n cachedColumnHeaders: []\n });\n /**\n * Cached columns widths.\n *\n * @type {Array}\n */\n _this.widths = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n _this.ghostTable = new _ghostTable2.default(_this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for columns width calculations.\n *\n * @type {SamplesGenerator}\n */\n _this.samplesGenerator = new _samplesGenerator2.default(function (row, col) {\n return _this.hot.getDataAtCell(row, col);\n });\n /**\n * `true` only if the first calculation was performed\n *\n * @type {Boolean}\n */\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n _this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the columns when the plugin is disabled\n _this.addHook('beforeColumnResize', function (col, size, isDblClick) {\n return _this.onBeforeColumnResize(col, size, isDblClick);\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(AutoColumnSize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n var setting = this.hot.getSettings().autoColumnSize;\n\n if (setting && setting.useHeaders != null) {\n this.ghostTable.setSetting('useHeaders', setting.useHeaders);\n }\n\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('modifyColWidth', function (width, col) {\n return _this2.getColumnWidth(col, width);\n });\n this.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Update plugin state.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var changedColumns = this.findColumnsWhereHeaderWasChanged();\n\n if (changedColumns.length) {\n this.clearCache(changedColumns);\n }\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Calculate a columns width.\n *\n * @param {Number|Object} colRange Column range object.\n * @param {Number|Object} rowRange Row range object.\n * @param {Boolean} [force=false] If `true` force calculate width even when value was cached earlier.\n */\n\n }, {\n key: 'calculateColumnsWidth',\n value: function calculateColumnsWidth() {\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countCols() - 1 };\n\n var _this3 = this;\n\n var rowRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { from: 0, to: this.hot.countRows() - 1 };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof colRange === 'number') {\n colRange = { from: colRange, to: colRange };\n }\n if (typeof rowRange === 'number') {\n rowRange = { from: rowRange, to: rowRange };\n }\n\n (0, _number.rangeEach)(colRange.from, colRange.to, function (col) {\n if (force || _this3.widths[col] === void 0 && !_this3.hot._getColWidthFromSettings(col)) {\n var samples = _this3.samplesGenerator.generateColumnSamples(col, rowRange);\n\n samples.forEach(function (sample, col) {\n return _this3.ghostTable.addColumn(col, sample);\n });\n }\n });\n\n if (this.ghostTable.columns.length) {\n this.ghostTable.getWidths(function (col, width) {\n _this3.widths[col] = width;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate all columns width.\n *\n * @param {Object|Number} rowRange Row range object.\n */\n\n }, {\n key: 'calculateAllColumnsWidth',\n value: function calculateAllColumnsWidth() {\n var _this4 = this;\n\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countRows() - 1 };\n\n var current = 0;\n var length = this.hot.countCols() - 1;\n var timer = null;\n\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this4.hot) {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n return;\n }\n\n _this4.calculateColumnsWidth({\n from: current,\n to: Math.min(current + AutoColumnSize.CALCULATION_STEP, length)\n }, rowRange);\n\n current = current + AutoColumnSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = (0, _feature.requestAnimationFrame)(loop);\n } else {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (_this4.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n _this4.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateColumnsWidth({ from: 0, to: this.getSyncCalculationLimit() }, rowRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n\n }, {\n key: 'setSamplingOptions',\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings().autoColumnSize;\n var samplingRatio = setting && (0, _object.hasOwnProperty)(setting, 'samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0;\n var allowSampleDuplicates = setting && (0, _object.hasOwnProperty)(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoColumnSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all columns width (overwrite cache values).\n */\n\n }, {\n key: 'recalculateAllColumnsWidth',\n value: function recalculateAllColumnsWidth() {\n if (this.hot.view && (0, _element.isVisible)(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * Get value which tells how many columns should be calculated synchronously. Rest of the columns will be calculated asynchronously.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getSyncCalculationLimit',\n value: function getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n var limit = AutoColumnSize.SYNC_CALCULATION_LIMIT;\n var colsLimit = this.hot.countCols() - 1;\n\n if ((0, _object.isObject)(this.hot.getSettings().autoColumnSize)) {\n limit = this.hot.getSettings().autoColumnSize.syncLimit;\n\n if ((0, _string.isPercentValue)(limit)) {\n limit = (0, _number.valueAccordingPercent)(colsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, colsLimit);\n }\n\n /**\n * Get the calculated column width.\n *\n * @param {Number} col Column index.\n * @param {Number} [defaultWidth] Default column width. It will be picked up if no calculated width found.\n * @param {Boolean} [keepMinimum=true] If `true` then returned value won't be smaller then 50 (default column width).\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnWidth',\n value: function getColumnWidth(col) {\n var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n var keepMinimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var width = defaultWidth;\n\n if (width === void 0) {\n width = this.widths[col];\n\n if (keepMinimum && typeof width === 'number') {\n width = Math.max(width, _src.ViewportColumnsCalculator.DEFAULT_WIDTH);\n }\n }\n\n return width;\n }\n\n /**\n * Get the first visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getFirstVisibleColumn',\n value: function getFirstVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getFirstRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getLastVisibleColumn',\n value: function getLastVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getLastVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getLastRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Collects all columns which titles has been changed in comparison to the previous state.\n *\n * @returns {Array} It returns an array of physical column indexes.\n */\n\n }, {\n key: 'findColumnsWhereHeaderWasChanged',\n value: function findColumnsWhereHeaderWasChanged() {\n var columnHeaders = this.hot.getColHeader();\n\n var _privatePool$get = privatePool.get(this),\n cachedColumnHeaders = _privatePool$get.cachedColumnHeaders;\n\n var changedColumns = (0, _array.arrayReduce)(columnHeaders, function (acc, columnTitle, physicalColumn) {\n var cachedColumnsLength = cachedColumnHeaders.length;\n\n if (cachedColumnsLength - 1 < physicalColumn || cachedColumnHeaders[physicalColumn] !== columnTitle) {\n acc.push(physicalColumn);\n }\n if (cachedColumnsLength - 1 < physicalColumn) {\n cachedColumnHeaders.push(columnTitle);\n } else {\n cachedColumnHeaders[physicalColumn] = columnTitle;\n }\n\n return acc;\n }, []);\n\n return changedColumns;\n }\n\n /**\n * Clear cache of calculated column widths. If you want to clear only selected columns pass an array with their indexes.\n * Otherwise whole cache will be cleared.\n *\n * @param {Array} [columns=[]] List of column indexes (physical indexes) to clear.\n */\n\n }, {\n key: 'clearCache',\n value: function clearCache() {\n var _this5 = this;\n\n var columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (columns.length) {\n (0, _array.arrayEach)(columns, function (physicalIndex) {\n _this5.widths[physicalIndex] = void 0;\n });\n } else {\n this.widths.length = 0;\n }\n }\n\n /**\n * Check if all widths were calculated. If not then return `true` (need recalculate).\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNeedRecalculate',\n value: function isNeedRecalculate() {\n return !!(0, _array.arrayFilter)(this.widths, function (item) {\n return item === void 0;\n }).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeRender',\n value: function onBeforeRender() {\n var force = this.hot.renderCall;\n var rowsCount = this.hot.countRows();\n\n // Keep last column widths unchanged for situation when all rows was deleted or trimmed (pro #6)\n if (!rowsCount) {\n return;\n }\n\n this.calculateColumnsWidth({ from: this.getFirstVisibleColumn(), to: this.getLastVisibleColumn() }, void 0, force);\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData() {\n var _this6 = this;\n\n if (this.hot.view) {\n this.recalculateAllColumnsWidth();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this6.hot) {\n _this6.recalculateAllColumnsWidth();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n\n }, {\n key: 'onBeforeChange',\n value: function onBeforeChange(changes) {\n var _this7 = this;\n\n var changedColumns = (0, _array.arrayMap)(changes, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n row = _ref2[0],\n column = _ref2[1];\n\n return _this7.hot.propToCol(column);\n });\n\n this.clearCache(changedColumns);\n }\n\n /**\n * On before column resize listener.\n *\n * @private\n * @param {Number} col\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeColumnResize',\n value: function onBeforeColumnResize(col, size, isDblClick) {\n if (isDblClick) {\n this.calculateColumnsWidth(col, void 0, true);\n size = this.getColumnWidth(col, void 0, false);\n }\n\n return size;\n }\n\n /**\n * On after Handsontable init fill plugin with all necessary values.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n privatePool.get(this).cachedColumnHeaders = this.hot.getColHeader();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.ghostTable.clean();\n _get(AutoColumnSize.prototype.__proto__ || Object.getPrototypeOf(AutoColumnSize.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return AutoColumnSize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autoColumnSize', AutoColumnSize);\n\nexports.default = AutoColumnSize;\n\n/***/ }),\n/* 212 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _array = __webpack_require__(1);\n\nvar _feature = __webpack_require__(34);\n\nvar _element = __webpack_require__(0);\n\nvar _ghostTable = __webpack_require__(67);\n\nvar _ghostTable2 = _interopRequireDefault(_ghostTable);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nvar _samplesGenerator = __webpack_require__(154);\n\nvar _samplesGenerator2 = _interopRequireDefault(_samplesGenerator);\n\nvar _string = __webpack_require__(27);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @plugin AutoRowSize\n *\n * @description\n * This plugin allows to set row heights based on their highest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled (same as if it was declared as `false`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the heights of all cells to\n * resize the rows accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the row heights manually.\n *\n * Row height calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * You can also use the `allowSampleDuplicates` option to allow sampling duplicate values when calculating the row height. Note, that this might have\n * a negative impact on performance.\n *\n * To configure this plugin see {@link Options#autoRowSize}.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoRowSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoRowSize');\n *\n * plugin.getRowHeight(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\nvar AutoRowSize = function (_BasePlugin) {\n _inherits(AutoRowSize, _BasePlugin);\n\n _createClass(AutoRowSize, null, [{\n key: 'CALCULATION_STEP',\n get: function get() {\n return 50;\n }\n }, {\n key: 'SYNC_CALCULATION_LIMIT',\n get: function get() {\n return 500;\n }\n }]);\n\n function AutoRowSize(hotInstance) {\n _classCallCheck(this, AutoRowSize);\n\n /**\n * Cached rows heights.\n *\n * @type {Array}\n */\n var _this = _possibleConstructorReturn(this, (AutoRowSize.__proto__ || Object.getPrototypeOf(AutoRowSize)).call(this, hotInstance));\n\n _this.heights = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n _this.ghostTable = new _ghostTable2.default(_this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for rows height calculations.\n *\n * @type {SamplesGenerator}\n */\n _this.samplesGenerator = new _samplesGenerator2.default(function (row, col) {\n if (row >= 0) {\n return _this.hot.getDataAtCell(row, col);\n } else if (row === -1) {\n return _this.hot.getColHeader(col);\n }\n return null;\n });\n /**\n * `true` if only the first calculation was performed.\n *\n * @type {Boolean}\n */\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n _this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the rows when the plugin is disabled\n _this.addHook('beforeRowResize', function (row, size, isDblClick) {\n return _this.onBeforeRowResize(row, size, isDblClick);\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(AutoRowSize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().autoRowSize === true || (0, _object.isObject)(this.hot.getSettings().autoRowSize);\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.setSamplingOptions();\n\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n this.addHook('beforeColumnMove', function () {\n return _this2.recalculateAllRowsHeight();\n });\n this.addHook('beforeColumnResize', function () {\n return _this2.recalculateAllRowsHeight();\n });\n this.addHook('beforeColumnSort', function () {\n return _this2.clearCache();\n });\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('beforeRowMove', function (rowStart, rowEnd) {\n return _this2.onBeforeRowMove(rowStart, rowEnd);\n });\n this.addHook('modifyRowHeight', function (height, row) {\n return _this2.getRowHeight(row, height);\n });\n this.addHook('modifyColumnHeaderHeight', function () {\n return _this2.getColumnHeaderHeight();\n });\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Calculate a given rows height.\n *\n * @param {Number|Object} rowRange Row range object.\n * @param {Number|Object} colRange Column range object.\n * @param {Boolean} [force=false] If `true` force calculate height even when value was cached earlier.\n */\n\n }, {\n key: 'calculateRowsHeight',\n value: function calculateRowsHeight() {\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countRows() - 1 };\n\n var _this3 = this;\n\n var colRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { from: 0, to: this.hot.countCols() - 1 };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof rowRange === 'number') {\n rowRange = { from: rowRange, to: rowRange };\n }\n if (typeof colRange === 'number') {\n colRange = { from: colRange, to: colRange };\n }\n\n if (this.hot.getColHeader(0) !== null) {\n var samples = this.samplesGenerator.generateRowSamples(-1, colRange);\n\n this.ghostTable.addColumnHeadersRow(samples.get(-1));\n }\n\n (0, _number.rangeEach)(rowRange.from, rowRange.to, function (row) {\n // For rows we must calculate row height even when user had set height value manually.\n // We can shrink column but cannot shrink rows!\n if (force || _this3.heights[row] === void 0) {\n var _samples = _this3.samplesGenerator.generateRowSamples(row, colRange);\n\n _samples.forEach(function (sample, row) {\n _this3.ghostTable.addRow(row, sample);\n });\n }\n });\n if (this.ghostTable.rows.length) {\n this.ghostTable.getHeights(function (row, height) {\n _this3.heights[row] = height;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate the height of all the rows.\n *\n * @param {Object|Number} colRange Column range object.\n */\n\n }, {\n key: 'calculateAllRowsHeight',\n value: function calculateAllRowsHeight() {\n var _this4 = this;\n\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { from: 0, to: this.hot.countCols() - 1 };\n\n var current = 0;\n var length = this.hot.countRows() - 1;\n var timer = null;\n\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this4.hot) {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n return;\n }\n _this4.calculateRowsHeight({ from: current, to: Math.min(current + AutoRowSize.CALCULATION_STEP, length) }, colRange);\n current = current + AutoRowSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = (0, _feature.requestAnimationFrame)(loop);\n } else {\n (0, _feature.cancelAnimationFrame)(timer);\n _this4.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (_this4.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n _this4.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateRowsHeight({ from: 0, to: this.getSyncCalculationLimit() }, colRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n this.hot.view.wt.wtOverlays.adjustElementsSize(false);\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n\n }, {\n key: 'setSamplingOptions',\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings().autoRowSize;\n var samplingRatio = setting && (0, _object.hasOwnProperty)(setting, 'samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0;\n var allowSampleDuplicates = setting && (0, _object.hasOwnProperty)(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoRowSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all rows height (overwrite cache values).\n */\n\n }, {\n key: 'recalculateAllRowsHeight',\n value: function recalculateAllRowsHeight() {\n if ((0, _element.isVisible)(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * Get value which tells how much rows will be calculated synchronously. Rest rows will be calculated asynchronously.\n *\n * @returns {Number}\n */\n\n }, {\n key: 'getSyncCalculationLimit',\n value: function getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n var limit = AutoRowSize.SYNC_CALCULATION_LIMIT;\n var rowsLimit = this.hot.countRows() - 1;\n\n if ((0, _object.isObject)(this.hot.getSettings().autoRowSize)) {\n limit = this.hot.getSettings().autoRowSize.syncLimit;\n\n if ((0, _string.isPercentValue)(limit)) {\n limit = (0, _number.valueAccordingPercent)(rowsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, rowsLimit);\n }\n\n /**\n * Get the calculated row height.\n *\n * @param {Number} row Row index.\n * @param {Number} [defaultHeight] Default row height. It will be pick up if no calculated height found.\n * @returns {Number}\n */\n\n }, {\n key: 'getRowHeight',\n value: function getRowHeight(row) {\n var defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n\n var height = defaultHeight;\n\n if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) {\n height = this.heights[row];\n }\n\n return height;\n }\n\n /**\n * Get the calculated column header height.\n *\n * @returns {Number|undefined}\n */\n\n }, {\n key: 'getColumnHeaderHeight',\n value: function getColumnHeaderHeight() {\n return this.heights[-1];\n }\n\n /**\n * Get the first visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getFirstVisibleRow',\n value: function getFirstVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getFirstRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n\n }, {\n key: 'getLastVisibleRow',\n value: function getLastVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getLastVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getLastRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Clear cached heights.\n */\n\n }, {\n key: 'clearCache',\n value: function clearCache() {\n this.heights.length = 0;\n this.heights[-1] = void 0;\n }\n\n /**\n * Clear cache by range.\n *\n * @param {Object|Number} range Row range object.\n */\n\n }, {\n key: 'clearCacheByRange',\n value: function clearCacheByRange(range) {\n var _this5 = this;\n\n if (typeof range === 'number') {\n range = { from: range, to: range };\n }\n (0, _number.rangeEach)(Math.min(range.from, range.to), Math.max(range.from, range.to), function (row) {\n _this5.heights[row] = void 0;\n });\n }\n\n /**\n * @returns {Boolean}\n */\n\n }, {\n key: 'isNeedRecalculate',\n value: function isNeedRecalculate() {\n return !!(0, _array.arrayFilter)(this.heights, function (item) {\n return item === void 0;\n }).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeRender',\n value: function onBeforeRender() {\n var force = this.hot.renderCall;\n this.calculateRowsHeight({ from: this.getFirstVisibleRow(), to: this.getLastVisibleRow() }, void 0, force);\n\n var fixedRowsBottom = this.hot.getSettings().fixedRowsBottom;\n\n // Calculate rows height synchronously for bottom overlay\n if (fixedRowsBottom) {\n var totalRows = this.hot.countRows() - 1;\n this.calculateRowsHeight({ from: totalRows - fixedRowsBottom, to: totalRows });\n }\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * On before row move listener.\n *\n * @private\n * @param {Number} from Row index where was grabbed.\n * @param {Number} to Destination row index.\n */\n\n }, {\n key: 'onBeforeRowMove',\n value: function onBeforeRowMove(from, to) {\n this.clearCacheByRange({ from: from, to: to });\n this.calculateAllRowsHeight();\n }\n\n /**\n * On before row resize listener.\n *\n * @private\n * @param {Number} row\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeRowResize',\n value: function onBeforeRowResize(row, size, isDblClick) {\n if (isDblClick) {\n this.calculateRowsHeight(row, void 0, true);\n size = this.getRowHeight(row);\n }\n\n return size;\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData() {\n var _this6 = this;\n\n if (this.hot.view) {\n this.recalculateAllRowsHeight();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this6.hot) {\n _this6.recalculateAllRowsHeight();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n\n }, {\n key: 'onBeforeChange',\n value: function onBeforeChange(changes) {\n var range = null;\n\n if (changes.length === 1) {\n range = changes[0][0];\n } else if (changes.length > 1) {\n range = {\n from: changes[0][0],\n to: changes[changes.length - 1][0]\n };\n }\n if (range !== null) {\n this.clearCacheByRange(range);\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.ghostTable.clean();\n _get(AutoRowSize.prototype.__proto__ || Object.getPrototypeOf(AutoRowSize.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return AutoRowSize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autoRowSize', AutoRowSize);\n\nexports.default = AutoRowSize;\n\n/***/ }),\n/* 213 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _src = __webpack_require__(11);\n\nvar _utils = __webpack_require__(214);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('modifyAutofillRange');\n_pluginHooks2.default.getSingleton().register('beforeAutofill');\n\nvar INSERT_ROW_ALTER_ACTION_NAME = 'insert_row';\nvar INTERVAL_FOR_ADDING_ROW = 200;\n\n/**\n * This plugin provides \"drag-down\" and \"copy-down\" functionalities, both operated\n * using the small square in the right bottom of the cell selection.\n *\n * \"Drag-down\" expands the value of the selected cells to the neighbouring\n * cells when you drag the small square in the corner.\n *\n * \"Copy-down\" copies the value of the selection to all empty cells\n * below when you double click the small square.\n *\n * @class Autofill\n * @plugin Autofill\n */\n\nvar Autofill = function (_BasePlugin) {\n _inherits(Autofill, _BasePlugin);\n\n function Autofill(hotInstance) {\n _classCallCheck(this, Autofill);\n\n /**\n * Event manager\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (Autofill.__proto__ || Object.getPrototypeOf(Autofill)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Specifies if adding new row started.\n *\n * @type {Boolean}\n */\n _this.addingStarted = false;\n /**\n * Specifies if there was mouse down on the cell corner.\n *\n * @type {Boolean}\n */\n _this.mouseDownOnCellCorner = false;\n /**\n * Specifies if mouse was dragged outside Handsontable.\n *\n * @type {Boolean}\n */\n _this.mouseDragOutside = false;\n /**\n * Specifies how many cell levels were dragged using the handle.\n *\n * @type {Boolean}\n */\n _this.handleDraggedCells = 0;\n /**\n * Specifies allowed directions of drag.\n *\n * @type {Array}\n */\n _this.directions = [];\n /**\n * Specifies if can insert new rows if needed.\n *\n * @type {Boolean}\n */\n _this.autoInsertRow = false;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(Autofill, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().fillHandle;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.mapSettings();\n this.registerEvents();\n\n this.addHook('afterOnCellCornerMouseDown', function (event) {\n return _this2.onAfterCellCornerMouseDown(event);\n });\n this.addHook('afterOnCellCornerDblClick', function (event) {\n return _this2.onCellCornerDblClick(event);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD) {\n return _this2.onBeforeCellMouseOver(coords);\n });\n\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Update plugin for this Handsontable instance.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.clearMappedSettings();\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Get selection data\n *\n * @private\n * @returns {Array} Array with the data.\n */\n\n }, {\n key: 'getSelectionData',\n value: function getSelectionData() {\n var selRange = {\n from: this.hot.getSelectedRange().from,\n to: this.hot.getSelectedRange().to\n };\n\n return this.hot.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col);\n }\n\n /**\n * Try to apply fill values to the area in fill border, omitting the selection border.\n *\n * @private\n * @returns {Boolean} reports if fill was applied.\n */\n\n }, {\n key: 'fillIn',\n value: function fillIn() {\n if (this.hot.view.wt.selections.fill.isEmpty()) {\n return false;\n }\n\n var cornersOfSelectionAndDragAreas = this.hot.view.wt.selections.fill.getCorners();\n\n this.resetSelectionOfDraggedArea();\n\n var cornersOfSelectedCells = this.getCornersOfSelectedCells();\n\n var _getDragDirectionAndR = (0, _utils.getDragDirectionAndRange)(cornersOfSelectedCells, cornersOfSelectionAndDragAreas),\n directionOfDrag = _getDragDirectionAndR.directionOfDrag,\n startOfDragCoords = _getDragDirectionAndR.startOfDragCoords,\n endOfDragCoords = _getDragDirectionAndR.endOfDragCoords;\n\n this.hot.runHooks('modifyAutofillRange', cornersOfSelectedCells, cornersOfSelectionAndDragAreas);\n\n if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {\n var selectionData = this.getSelectionData();\n var deltas = (0, _utils.getDeltas)(startOfDragCoords, endOfDragCoords, selectionData, directionOfDrag);\n\n this.hot.runHooks('beforeAutofill', startOfDragCoords, endOfDragCoords, selectionData);\n\n this.hot.populateFromArray(startOfDragCoords.row, startOfDragCoords.col, selectionData, endOfDragCoords.row, endOfDragCoords.col, this.pluginName + '.fill', null, directionOfDrag, deltas);\n\n this.setSelection(cornersOfSelectionAndDragAreas);\n } else {\n // reset to avoid some range bug\n this.hot.selection.refreshBorders();\n }\n\n return true;\n }\n\n /**\n * Reduce the selection area if the handle was dragged outside of the table or on headers.\n *\n * @private\n * @param {CellCoords} coords indexes of selection corners.\n * @returns {CellCoords}\n */\n\n }, {\n key: 'reduceSelectionAreaIfNeeded',\n value: function reduceSelectionAreaIfNeeded(coords) {\n if (coords.row < 0) {\n coords.row = 0;\n }\n\n if (coords.col < 0) {\n coords.col = 0;\n }\n return coords;\n }\n\n /**\n * Get the coordinates of the drag & drop borders.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n * @returns {Array}\n */\n\n }, {\n key: 'getCoordsOfDragAndDropBorders',\n value: function getCoordsOfDragAndDropBorders(coordsOfSelection) {\n var topLeftCorner = this.hot.getSelectedRange().getTopLeftCorner();\n var bottomRightCorner = this.hot.getSelectedRange().getBottomRightCorner();\n var coords = void 0;\n\n if (this.directions.includes(_utils.DIRECTIONS.vertical) && (bottomRightCorner.row < coordsOfSelection.row || topLeftCorner.row > coordsOfSelection.row)) {\n coords = new _src.CellCoords(coordsOfSelection.row, bottomRightCorner.col);\n } else if (this.directions.includes(_utils.DIRECTIONS.horizontal)) {\n coords = new _src.CellCoords(bottomRightCorner.row, coordsOfSelection.col);\n } else {\n // wrong direction\n return;\n }\n\n return this.reduceSelectionAreaIfNeeded(coords);\n }\n\n /**\n * Show the fill border.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n */\n\n }, {\n key: 'showBorder',\n value: function showBorder(coordsOfSelection) {\n var coordsOfDragAndDropBorders = this.getCoordsOfDragAndDropBorders(coordsOfSelection);\n\n if (coordsOfDragAndDropBorders) {\n this.redrawBorders(coordsOfDragAndDropBorders);\n }\n }\n\n /**\n * Add new row\n *\n * @private\n */\n\n }, {\n key: 'addRow',\n value: function addRow() {\n var _this3 = this;\n\n this.hot._registerTimeout(setTimeout(function () {\n _this3.hot.alter(INSERT_ROW_ALTER_ACTION_NAME, void 0, 1, _this3.pluginName + '.fill');\n\n _this3.addingStarted = false;\n }, INTERVAL_FOR_ADDING_ROW));\n }\n\n /**\n * Add new rows if they are needed to continue auto-filling values.\n *\n * @private\n */\n\n }, {\n key: 'addNewRowIfNeeded',\n value: function addNewRowIfNeeded() {\n if (this.hot.view.wt.selections.fill.cellRange && this.addingStarted === false && this.autoInsertRow) {\n var cornersOfSelectedCells = this.hot.getSelected();\n var cornersOfSelectedDragArea = this.hot.view.wt.selections.fill.getCorners();\n var nrOfTableRows = this.hot.countRows();\n\n if (cornersOfSelectedCells[2] < nrOfTableRows - 1 && cornersOfSelectedDragArea[2] === nrOfTableRows - 1) {\n this.addingStarted = true;\n\n this.addRow();\n }\n }\n }\n\n /**\n * Get corners of selected cells.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'getCornersOfSelectedCells',\n value: function getCornersOfSelectedCells() {\n if (this.hot.selection.isMultiple()) {\n return this.hot.view.wt.selections.area.getCorners();\n }\n return this.hot.view.wt.selections.current.getCorners();\n }\n\n /**\n * Get index of last adjacent filled in row\n *\n * @private\n * @param {Array} cornersOfSelectedCells indexes of selection corners.\n * @returns {Number} gives number greater than or equal to zero when selection adjacent can be applied.\n * or -1 when selection adjacent can't be applied\n */\n\n }, {\n key: 'getIndexOfLastAdjacentFilledInRow',\n value: function getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells) {\n var data = this.hot.getData();\n var nrOfTableRows = this.hot.countRows();\n var lastFilledInRowIndex = void 0;\n\n for (var rowIndex = cornersOfSelectedCells[2] + 1; rowIndex < nrOfTableRows; rowIndex++) {\n for (var columnIndex = cornersOfSelectedCells[1]; columnIndex <= cornersOfSelectedCells[3]; columnIndex++) {\n var dataInCell = data[rowIndex][columnIndex];\n\n if (dataInCell) {\n return -1;\n }\n }\n\n var dataInNextLeftCell = data[rowIndex][cornersOfSelectedCells[1] - 1];\n var dataInNextRightCell = data[rowIndex][cornersOfSelectedCells[3] + 1];\n\n if (!!dataInNextLeftCell || !!dataInNextRightCell) {\n lastFilledInRowIndex = rowIndex;\n }\n }\n return lastFilledInRowIndex;\n }\n\n /**\n * Add a selection from the start area to the specific row index.\n *\n * @private\n * @param {Array} selectStartArea selection area from which we start to create more comprehensive selection.\n * @param {Number} rowIndex\n */\n\n }, {\n key: 'addSelectionFromStartAreaToSpecificRowIndex',\n value: function addSelectionFromStartAreaToSpecificRowIndex(selectStartArea, rowIndex) {\n this.hot.view.wt.selections.fill.clear();\n this.hot.view.wt.selections.fill.add(new _src.CellCoords(selectStartArea[0], selectStartArea[1]));\n this.hot.view.wt.selections.fill.add(new _src.CellCoords(rowIndex, selectStartArea[3]));\n }\n\n /**\n * Set selection based on passed corners.\n *\n * @private\n * @param {Array} cornersOfArea\n */\n\n }, {\n key: 'setSelection',\n value: function setSelection(cornersOfArea) {\n this.hot.selection.setRangeStart(new _src.CellCoords(cornersOfArea[0], cornersOfArea[1]));\n this.hot.selection.setRangeEnd(new _src.CellCoords(cornersOfArea[2], cornersOfArea[3]));\n }\n\n /**\n * Try to select cells down to the last row in the left column and then returns if selection was applied.\n *\n * @private\n * @returns {Boolean}\n */\n\n }, {\n key: 'selectAdjacent',\n value: function selectAdjacent() {\n var cornersOfSelectedCells = this.getCornersOfSelectedCells();\n var lastFilledInRowIndex = this.getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells);\n\n if (lastFilledInRowIndex === -1) {\n return false;\n }\n this.addSelectionFromStartAreaToSpecificRowIndex(cornersOfSelectedCells, lastFilledInRowIndex);\n\n return true;\n }\n\n /**\n * Reset selection of dragged area.\n *\n * @private\n */\n\n }, {\n key: 'resetSelectionOfDraggedArea',\n value: function resetSelectionOfDraggedArea() {\n this.handleDraggedCells = 0;\n\n this.hot.view.wt.selections.fill.clear();\n }\n\n /**\n * Redraw borders.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: 'redrawBorders',\n value: function redrawBorders(coords) {\n this.hot.view.wt.selections.fill.clear();\n this.hot.view.wt.selections.fill.add(this.hot.getSelectedRange().from);\n this.hot.view.wt.selections.fill.add(this.hot.getSelectedRange().to);\n this.hot.view.wt.selections.fill.add(coords);\n this.hot.view.render();\n }\n\n /**\n * Get if mouse was dragged outside.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n * @returns {Boolean}\n */\n\n }, {\n key: 'getIfMouseWasDraggedOutside',\n value: function getIfMouseWasDraggedOutside(event) {\n var tableBottom = (0, _element.offset)(this.hot.table).top - (window.pageYOffset || document.documentElement.scrollTop) + (0, _element.outerHeight)(this.hot.table);\n var tableRight = (0, _element.offset)(this.hot.table).left - (window.pageXOffset || document.documentElement.scrollLeft) + (0, _element.outerWidth)(this.hot.table);\n\n return event.clientY > tableBottom && event.clientX <= tableRight;\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n }\n\n /**\n * On cell corner double click callback.\n *\n * @private\n */\n\n }, {\n key: 'onCellCornerDblClick',\n value: function onCellCornerDblClick() {\n var selectionApplied = this.selectAdjacent();\n\n if (selectionApplied) {\n this.fillIn();\n }\n }\n\n /**\n * On after cell corner mouse down listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterCellCornerMouseDown',\n value: function onAfterCellCornerMouseDown() {\n this.handleDraggedCells = 1;\n this.mouseDownOnCellCorner = true;\n }\n\n /**\n * On before cell mouse over listener.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: 'onBeforeCellMouseOver',\n value: function onBeforeCellMouseOver(coords) {\n if (this.mouseDownOnCellCorner && !this.hot.view.isMouseDown() && this.handleDraggedCells) {\n this.handleDraggedCells++;\n\n this.showBorder(coords);\n this.addNewRowIfNeeded();\n }\n }\n\n /**\n * On mouse up listener.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n if (this.handleDraggedCells) {\n if (this.handleDraggedCells > 1) {\n this.fillIn();\n }\n\n this.handleDraggedCells = 0;\n this.mouseDownOnCellCorner = false;\n }\n }\n\n /**\n * On mouse move listener.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var mouseWasDraggedOutside = this.getIfMouseWasDraggedOutside(event);\n\n if (this.addingStarted === false && this.handleDraggedCells > 0 && mouseWasDraggedOutside) {\n this.mouseDragOutside = true;\n this.addingStarted = true;\n } else {\n this.mouseDragOutside = false;\n }\n\n if (this.mouseDragOutside && this.autoInsertRow) {\n this.addRow();\n }\n }\n\n /**\n * Clear mapped settings.\n *\n * @private\n */\n\n }, {\n key: 'clearMappedSettings',\n value: function clearMappedSettings() {\n this.directions.length = 0;\n this.autoInsertRow = false;\n }\n\n /**\n * Map settings.\n *\n * @private\n */\n\n }, {\n key: 'mapSettings',\n value: function mapSettings() {\n var mappedSettings = (0, _utils.getMappedFillHandleSetting)(this.hot.getSettings().fillHandle);\n this.directions = mappedSettings.directions;\n this.autoInsertRow = mappedSettings.autoInsertRow;\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(Autofill.prototype.__proto__ || Object.getPrototypeOf(Autofill.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return Autofill;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('autofill', Autofill);\n\nexports.default = Autofill;\n\n/***/ }),\n/* 214 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.DIRECTIONS = undefined;\nexports.getDeltas = getDeltas;\nexports.getDragDirectionAndRange = getDragDirectionAndRange;\nexports.getMappedFillHandleSetting = getMappedFillHandleSetting;\n\nvar _object = __webpack_require__(2);\n\nvar _mixed = __webpack_require__(20);\n\nvar _src = __webpack_require__(11);\n\nvar DIRECTIONS = exports.DIRECTIONS = {\n horizontal: 'horizontal',\n vertical: 'vertical'\n};\n\n/**\n * Get deltas array.\n *\n * @param {CellCoords} start\n * @param {CellCoords} end\n * @param {Array} data\n * @param {String} direction\n * @returns {Array}\n */\nfunction getDeltas(start, end, data, direction) {\n var rowsLength = data.length;\n var columnsLength = data ? data[0].length : 0;\n var deltas = [];\n var diffRow = end.row - start.row;\n var diffCol = end.col - start.col;\n\n if (['down', 'up'].indexOf(direction) !== -1) {\n var arr = [];\n\n for (var col = 0; col <= diffCol; col++) {\n var startValue = parseInt(data[0][col], 10);\n var endValue = parseInt(data[rowsLength - 1][col], 10);\n var delta = (direction === 'down' ? endValue - startValue : startValue - endValue) / (rowsLength - 1) || 0;\n\n arr.push(delta);\n }\n\n deltas.push(arr);\n }\n\n if (['right', 'left'].indexOf(direction) !== -1) {\n for (var row = 0; row <= diffRow; row++) {\n var _startValue = parseInt(data[row][0], 10);\n var _endValue = parseInt(data[row][columnsLength - 1], 10);\n var _delta = (direction === 'right' ? _endValue - _startValue : _startValue - _endValue) / (columnsLength - 1) || 0;\n\n deltas.push([_delta]);\n }\n }\n\n return deltas;\n}\n\n/**\n * Get direction between positions and cords of selections difference (drag area)\n *\n * @param {Array} startSelection\n * @param {Array} endSelection\n * @returns {{direction: String, start: CellCoords, end: CellCoords}}\n */\nfunction getDragDirectionAndRange(startSelection, endSelection) {\n var startOfDragCoords = void 0,\n endOfDragCoords = void 0,\n directionOfDrag = void 0;\n\n if (endSelection[0] === startSelection[0] && endSelection[1] < startSelection[1]) {\n directionOfDrag = 'left';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new _src.CellCoords(endSelection[2], startSelection[1] - 1);\n } else if (endSelection[0] === startSelection[0] && endSelection[3] > startSelection[3]) {\n directionOfDrag = 'right';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], startSelection[3] + 1);\n endOfDragCoords = new _src.CellCoords(endSelection[2], endSelection[3]);\n } else if (endSelection[0] < startSelection[0] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'up';\n\n startOfDragCoords = new _src.CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new _src.CellCoords(startSelection[0] - 1, endSelection[3]);\n } else if (endSelection[2] > startSelection[2] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'down';\n\n startOfDragCoords = new _src.CellCoords(startSelection[2] + 1, endSelection[1]);\n endOfDragCoords = new _src.CellCoords(endSelection[2], endSelection[3]);\n }\n\n return {\n directionOfDrag: directionOfDrag,\n startOfDragCoords: startOfDragCoords,\n endOfDragCoords: endOfDragCoords\n };\n}\n\n/**\n * Get mapped FillHandle setting containing information about\n * allowed FillHandle directions and if allowed is automatic insertion of rows on drag\n *\n * @param {Boolean|Object} fillHandle property of Handsontable settings\n * @returns {{directions: Array, autoInsertRow: Boolean}} object allowing access to information\n * about FillHandle in more useful way\n */\nfunction getMappedFillHandleSetting(fillHandle) {\n var mappedSettings = {};\n\n if (fillHandle === true) {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n mappedSettings.autoInsertRow = true;\n } else if ((0, _object.isObject)(fillHandle)) {\n if ((0, _mixed.isDefined)(fillHandle.autoInsertRow)) {\n\n // autoInsertRow for horizontal direction will be always false\n\n if (fillHandle.direction === DIRECTIONS.horizontal) {\n mappedSettings.autoInsertRow = false;\n } else {\n mappedSettings.autoInsertRow = fillHandle.autoInsertRow;\n }\n } else {\n mappedSettings.autoInsertRow = false;\n }\n\n if ((0, _mixed.isDefined)(fillHandle.direction)) {\n mappedSettings.directions = [fillHandle.direction];\n } else {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n }\n } else if (typeof fillHandle === 'string') {\n mappedSettings.directions = [fillHandle];\n mappedSettings.autoInsertRow = true;\n } else {\n mappedSettings.directions = [];\n mappedSettings.autoInsertRow = false;\n }\n\n return mappedSettings;\n}\n\n/***/ }),\n/* 215 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _mixed = __webpack_require__(20);\n\nvar _object = __webpack_require__(2);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _mergeSort = __webpack_require__(270);\n\nvar _mergeSort2 = _interopRequireDefault(_mergeSort);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeColumnSort');\n_pluginHooks2.default.getSingleton().register('afterColumnSort');\n\n// TODO: Implement mixin arrayMapper to ColumnSorting plugin.\n\n/**\n * @plugin ColumnSorting\n *\n * @description\n * This plugin sorts the view by a column (but does not sort the data source!).\n * To enable the plugin, set the `columnSorting` property to either:\n * * a boolean value (`true`/`false`),\n * * an object defining the initial sorting order (see the example below).\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n * @dependencies ObserveChanges\n */\n\nvar ColumnSorting = function (_BasePlugin) {\n _inherits(ColumnSorting, _BasePlugin);\n\n function ColumnSorting(hotInstance) {\n _classCallCheck(this, ColumnSorting);\n\n var _this2 = _possibleConstructorReturn(this, (ColumnSorting.__proto__ || Object.getPrototypeOf(ColumnSorting)).call(this, hotInstance));\n\n _this2.sortIndicators = [];\n _this2.lastSortedColumn = null;\n _this2.sortEmptyCells = false;\n return _this2;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ColumnSorting, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().columnSorting;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this3 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.setPluginOptions();\n\n var _this = this;\n this.hot.sortIndex = [];\n\n this.hot.sort = function () {\n var args = Array.prototype.slice.call(arguments);\n\n return _this.sortByColumn.apply(_this, _toConsumableArray(args));\n };\n\n if (typeof this.hot.getSettings().observeChanges === 'undefined') {\n this.enableObserveChangesPlugin();\n }\n\n this.addHook('afterTrimRow', function (row) {\n return _this3.sort();\n });\n this.addHook('afterUntrimRow', function (row) {\n return _this3.sort();\n });\n this.addHook('modifyRow', function (row) {\n return _this3.translateRow(row);\n });\n this.addHook('unmodifyRow', function (row) {\n return _this3.untranslateRow(row);\n });\n this.addHook('afterUpdateSettings', function () {\n return _this3.onAfterUpdateSettings();\n });\n this.addHook('afterGetColHeader', function (col, TH) {\n return _this3.getColHeader(col, TH);\n });\n this.addHook('afterOnCellMouseDown', function (event, target) {\n return _this3.onAfterOnCellMouseDown(event, target);\n });\n this.addHook('afterCreateRow', function () {\n _this.afterCreateRow.apply(_this, arguments);\n });\n this.addHook('afterRemoveRow', function () {\n _this.afterRemoveRow.apply(_this, arguments);\n });\n this.addHook('afterInit', function () {\n return _this3.sortBySettings();\n });\n this.addHook('afterLoadData', function () {\n _this3.hot.sortIndex = [];\n\n if (_this3.hot.view) {\n _this3.sortBySettings();\n }\n });\n if (this.hot.view) {\n this.sortBySettings();\n }\n _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.hot.sort = void 0;\n _get(ColumnSorting.prototype.__proto__ || Object.getPrototypeOf(ColumnSorting.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * afterUpdateSettings callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterUpdateSettings',\n value: function onAfterUpdateSettings() {\n this.sortBySettings();\n }\n }, {\n key: 'sortBySettings',\n value: function sortBySettings() {\n var sortingSettings = this.hot.getSettings().columnSorting;\n var loadedSortingState = this.loadSortingState();\n var sortingColumn = void 0;\n var sortingOrder = void 0;\n\n if (typeof loadedSortingState === 'undefined') {\n sortingColumn = sortingSettings.column;\n sortingOrder = sortingSettings.sortOrder;\n } else {\n sortingColumn = loadedSortingState.sortColumn;\n sortingOrder = loadedSortingState.sortOrder;\n }\n if (typeof sortingColumn === 'number') {\n this.lastSortedColumn = sortingColumn;\n this.sortByColumn(sortingColumn, sortingOrder);\n }\n }\n\n /**\n * Set sorted column and order info\n *\n * @param {number} col Sorted column index.\n * @param {boolean|undefined} order Sorting order (`true` for ascending, `false` for descending).\n */\n\n }, {\n key: 'setSortingColumn',\n value: function setSortingColumn(col, order) {\n if (typeof col == 'undefined') {\n this.hot.sortColumn = void 0;\n this.hot.sortOrder = void 0;\n\n return;\n } else if (this.hot.sortColumn === col && typeof order == 'undefined') {\n if (this.hot.sortOrder === false) {\n this.hot.sortOrder = void 0;\n } else {\n this.hot.sortOrder = !this.hot.sortOrder;\n }\n } else {\n this.hot.sortOrder = typeof order === 'undefined' ? true : order;\n }\n\n this.hot.sortColumn = col;\n }\n }, {\n key: 'sortByColumn',\n value: function sortByColumn(col, order) {\n this.setSortingColumn(col, order);\n\n if (typeof this.hot.sortColumn == 'undefined') {\n return;\n }\n\n var allowSorting = this.hot.runHooks('beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n if (allowSorting !== false) {\n this.sort();\n }\n this.updateOrderClass();\n this.updateSortIndicator();\n\n this.hot.runHooks('afterColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n this.hot.render();\n this.saveSortingState();\n }\n\n /**\n * Save the sorting state\n */\n\n }, {\n key: 'saveSortingState',\n value: function saveSortingState() {\n var sortingState = {};\n\n if (typeof this.hot.sortColumn != 'undefined') {\n sortingState.sortColumn = this.hot.sortColumn;\n }\n\n if (typeof this.hot.sortOrder != 'undefined') {\n sortingState.sortOrder = this.hot.sortOrder;\n }\n\n if ((0, _object.hasOwnProperty)(sortingState, 'sortColumn') || (0, _object.hasOwnProperty)(sortingState, 'sortOrder')) {\n this.hot.runHooks('persistentStateSave', 'columnSorting', sortingState);\n }\n }\n\n /**\n * Load the sorting state.\n *\n * @returns {*} Previously saved sorting state.\n */\n\n }, {\n key: 'loadSortingState',\n value: function loadSortingState() {\n var storedState = {};\n this.hot.runHooks('persistentStateLoad', 'columnSorting', storedState);\n\n return storedState.value;\n }\n\n /**\n * Update sorting class name state.\n */\n\n }, {\n key: 'updateOrderClass',\n value: function updateOrderClass() {\n var orderClass = void 0;\n\n if (this.hot.sortOrder === true) {\n orderClass = 'ascending';\n } else if (this.hot.sortOrder === false) {\n orderClass = 'descending';\n }\n this.sortOrderClass = orderClass;\n }\n }, {\n key: 'enableObserveChangesPlugin',\n value: function enableObserveChangesPlugin() {\n var _this = this;\n\n this.hot._registerTimeout(setTimeout(function () {\n _this.hot.updateSettings({\n observeChanges: true\n });\n }, 0));\n }\n\n /**\n * Default sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order - `true` for ascending, `false` for descending.\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The comparing function.\n */\n\n }, {\n key: 'defaultSort',\n value: function defaultSort(sortOrder, columnMeta) {\n return function (a, b) {\n if (typeof a[1] == 'string') {\n a[1] = a[1].toLowerCase();\n }\n if (typeof b[1] == 'string') {\n b[1] = b[1].toLowerCase();\n }\n\n if (a[1] === b[1]) {\n return 0;\n }\n\n if ((0, _mixed.isEmpty)(a[1])) {\n if ((0, _mixed.isEmpty)(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n if ((0, _mixed.isEmpty)(b[1])) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n if (isNaN(a[1]) && !isNaN(b[1])) {\n return sortOrder ? 1 : -1;\n } else if (!isNaN(a[1]) && isNaN(b[1])) {\n return sortOrder ? -1 : 1;\n } else if (!(isNaN(a[1]) || isNaN(b[1]))) {\n a[1] = parseFloat(a[1]);\n b[1] = parseFloat(b[1]);\n }\n if (a[1] < b[1]) {\n return sortOrder ? -1 : 1;\n }\n if (a[1] > b[1]) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Date sorting algorithm\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n\n }, {\n key: 'dateSort',\n value: function dateSort(sortOrder, columnMeta) {\n return function (a, b) {\n if (a[1] === b[1]) {\n return 0;\n }\n\n if ((0, _mixed.isEmpty)(a[1])) {\n if ((0, _mixed.isEmpty)(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n\n if ((0, _mixed.isEmpty)(b[1])) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n var aDate = (0, _moment2.default)(a[1], columnMeta.dateFormat);\n var bDate = (0, _moment2.default)(b[1], columnMeta.dateFormat);\n\n if (!aDate.isValid()) {\n return 1;\n }\n if (!bDate.isValid()) {\n return -1;\n }\n\n if (bDate.isAfter(aDate)) {\n return sortOrder ? -1 : 1;\n }\n if (bDate.isBefore(aDate)) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Numeric sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n\n }, {\n key: 'numericSort',\n value: function numericSort(sortOrder, columnMeta) {\n return function (a, b) {\n var parsedA = parseFloat(a[1]);\n var parsedB = parseFloat(b[1]);\n\n // Watch out when changing this part of code!\n // Check below returns 0 (as expected) when comparing empty string, null, undefined\n if (parsedA === parsedB || isNaN(parsedA) && isNaN(parsedB)) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n if ((0, _mixed.isEmpty)(a[1])) {\n return sortOrder ? -1 : 1;\n }\n\n if ((0, _mixed.isEmpty)(b[1])) {\n return sortOrder ? 1 : -1;\n }\n }\n\n if (isNaN(parsedA)) {\n return 1;\n }\n\n if (isNaN(parsedB)) {\n return -1;\n }\n\n if (parsedA < parsedB) {\n return sortOrder ? -1 : 1;\n } else if (parsedA > parsedB) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Perform the sorting.\n */\n\n }, {\n key: 'sort',\n value: function sort() {\n if (typeof this.hot.sortOrder == 'undefined') {\n this.hot.sortIndex.length = 0;\n\n return;\n }\n\n var colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n var emptyRows = this.hot.countEmptyRows();\n var sortFunction = void 0;\n var nrOfRows = void 0;\n\n this.hot.sortingEnabled = false; // this is required by translateRow plugin hook\n this.hot.sortIndex.length = 0;\n\n if (typeof colMeta.columnSorting.sortEmptyCells === 'undefined') {\n colMeta.columnSorting = { sortEmptyCells: this.sortEmptyCells };\n }\n\n if (this.hot.getSettings().maxRows === Number.POSITIVE_INFINITY) {\n nrOfRows = this.hot.countRows() - this.hot.getSettings().minSpareRows;\n } else {\n nrOfRows = this.hot.countRows() - emptyRows;\n }\n\n for (var i = 0, ilen = nrOfRows; i < ilen; i++) {\n this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]);\n }\n\n if (colMeta.sortFunction) {\n sortFunction = colMeta.sortFunction;\n } else {\n switch (colMeta.type) {\n case 'date':\n sortFunction = this.dateSort;\n break;\n case 'numeric':\n sortFunction = this.numericSort;\n break;\n default:\n sortFunction = this.defaultSort;\n }\n }\n\n (0, _mergeSort2.default)(this.hot.sortIndex, sortFunction(this.hot.sortOrder, colMeta));\n\n // Append spareRows\n for (var _i = this.hot.sortIndex.length; _i < this.hot.countRows(); _i++) {\n this.hot.sortIndex.push([_i, this.hot.getDataAtCell(_i, this.hot.sortColumn)]);\n }\n\n this.hot.sortingEnabled = true; // this is required by translateRow plugin hook\n }\n\n /**\n * Update indicator states.\n */\n\n }, {\n key: 'updateSortIndicator',\n value: function updateSortIndicator() {\n if (typeof this.hot.sortOrder == 'undefined') {\n return;\n }\n var colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n\n this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator;\n }\n\n /**\n * `modifyRow` hook callback. Translates physical row index to the sorted row index.\n *\n * @param {Number} row Row index.\n * @returns {Number} Sorted row index.\n */\n\n }, {\n key: 'translateRow',\n value: function translateRow(row) {\n if (this.hot.sortingEnabled && typeof this.hot.sortOrder !== 'undefined' && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) {\n return this.hot.sortIndex[row][0];\n }\n\n return row;\n }\n\n /**\n * Translates sorted row index to physical row index.\n *\n * @param {Number} row Sorted row index.\n * @returns {number} Physical row index.\n */\n\n }, {\n key: 'untranslateRow',\n value: function untranslateRow(row) {\n if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) {\n for (var i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] == row) {\n return i;\n }\n }\n }\n }\n\n /**\n * `afterGetColHeader` callback. Adds column sorting css classes to clickable headers.\n *\n * @private\n * @param {Number} col Column index.\n * @param {Element} TH TH HTML element.\n */\n\n }, {\n key: 'getColHeader',\n value: function getColHeader(col, TH) {\n if (col < 0 || !TH.parentNode) {\n return false;\n }\n\n var headerLink = TH.querySelector('.colHeader');\n var colspan = TH.getAttribute('colspan');\n var TRs = TH.parentNode.parentNode.childNodes;\n var headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode);\n headerLevel -= TRs.length;\n\n if (!headerLink) {\n return;\n }\n\n if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) {\n (0, _element.addClass)(headerLink, 'columnSorting');\n }\n (0, _element.removeClass)(headerLink, 'descending');\n (0, _element.removeClass)(headerLink, 'ascending');\n\n if (this.sortIndicators[col]) {\n if (col === this.hot.sortColumn) {\n if (this.sortOrderClass === 'ascending') {\n (0, _element.addClass)(headerLink, 'ascending');\n } else if (this.sortOrderClass === 'descending') {\n (0, _element.addClass)(headerLink, 'descending');\n }\n }\n }\n }\n\n /**\n * Check if any column is in a sorted state.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSorted',\n value: function isSorted() {\n return typeof this.hot.sortColumn != 'undefined';\n }\n\n /**\n * `afterCreateRow` callback. Updates the sorting state after a row have been created.\n *\n * @private\n * @param {Number} index\n * @param {Number} amount\n */\n\n }, {\n key: 'afterCreateRow',\n value: function afterCreateRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n\n for (var i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] >= index) {\n this.hot.sortIndex[i][0] += amount;\n }\n }\n\n for (var _i2 = 0; _i2 < amount; _i2++) {\n this.hot.sortIndex.splice(index + _i2, 0, [index + _i2, this.hot.getSourceData()[index + _i2][this.hot.sortColumn + this.hot.colOffset()]]);\n }\n\n this.saveSortingState();\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} index\n * @param {Number} amount\n */\n\n }, {\n key: 'afterRemoveRow',\n value: function afterRemoveRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n var removedRows = this.hot.sortIndex.splice(index, amount);\n\n removedRows = (0, _array.arrayMap)(removedRows, function (row) {\n return row[0];\n });\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return (0, _array.arrayReduce)(removedRows, function (count, removedLogicalRow) {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this.hot.sortIndex = (0, _array.arrayMap)(this.hot.sortIndex, function (logicalRow, physicalRow) {\n var rowShift = countRowShift(logicalRow[0]);\n\n if (rowShift) {\n logicalRow[0] -= rowShift;\n }\n\n return logicalRow;\n });\n\n this.saveSortingState();\n }\n\n /**\n * Set options by passed settings\n *\n * @private\n */\n\n }, {\n key: 'setPluginOptions',\n value: function setPluginOptions() {\n var columnSorting = this.hot.getSettings().columnSorting;\n\n if ((typeof columnSorting === 'undefined' ? 'undefined' : _typeof(columnSorting)) === 'object') {\n this.sortEmptyCells = columnSorting.sortEmptyCells || false;\n } else {\n this.sortEmptyCells = false;\n }\n }\n\n /**\n * `onAfterOnCellMouseDown` hook callback.\n *\n * @private\n * @param {Event} event Event which are provided by hook.\n * @param {CellCoords} coords Coords of the selected cell.\n */\n\n }, {\n key: 'onAfterOnCellMouseDown',\n value: function onAfterOnCellMouseDown(event, coords) {\n if (coords.row > -1) {\n return;\n }\n\n if ((0, _element.hasClass)(event.realTarget, 'columnSorting')) {\n // reset order state on every new column header click\n if (coords.col !== this.lastSortedColumn) {\n this.hot.sortOrder = true;\n }\n\n this.lastSortedColumn = coords.col;\n\n this.sortByColumn(coords.col);\n }\n }\n }]);\n\n return ColumnSorting;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('columnSorting', ColumnSorting);\n\nexports.default = ColumnSorting;\n\n/***/ }),\n/* 216 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Comment editor for the Comments plugin.\n *\n * @class CommentEditor\n * @plugin Comments\n */\nvar CommentEditor = function () {\n _createClass(CommentEditor, null, [{\n key: 'CLASS_EDITOR_CONTAINER',\n get: function get() {\n return 'htCommentsContainer';\n }\n }, {\n key: 'CLASS_EDITOR',\n get: function get() {\n return 'htComments';\n }\n }, {\n key: 'CLASS_INPUT',\n get: function get() {\n return 'htCommentTextArea';\n }\n }, {\n key: 'CLASS_CELL',\n get: function get() {\n return 'htCommentCell';\n }\n }]);\n\n function CommentEditor() {\n _classCallCheck(this, CommentEditor);\n\n this.editor = this.createEditor();\n this.editorStyle = this.editor.style;\n\n this.hidden = true;\n\n this.hide();\n }\n\n /**\n * Set position of the comments editor according to the provided x and y coordinates.\n *\n * @param {Number} x X position (in pixels).\n * @param {Number} y Y position (in pixels).\n */\n\n\n _createClass(CommentEditor, [{\n key: 'setPosition',\n value: function setPosition(x, y) {\n this.editorStyle.left = x + 'px';\n this.editorStyle.top = y + 'px';\n }\n\n /**\n * Set the editor size according to the provided arguments.\n *\n * @param {Number} width Width in pixels.\n * @param {Number} height Height in pixels.\n */\n\n }, {\n key: 'setSize',\n value: function setSize(width, height) {\n if (width && height) {\n var input = this.getInputElement();\n\n input.style.width = width + 'px';\n input.style.height = height + 'px';\n }\n }\n\n /**\n * Reset the editor size to its initial state.\n */\n\n }, {\n key: 'resetSize',\n value: function resetSize() {\n var input = this.getInputElement();\n\n input.style.width = '';\n input.style.height = '';\n }\n\n /**\n * Set the read-only state for the comments editor.\n *\n * @param {Boolean} state The new read only state.\n */\n\n }, {\n key: 'setReadOnlyState',\n value: function setReadOnlyState(state) {\n var input = this.getInputElement();\n\n input.readOnly = state;\n }\n\n /**\n * Show the comments editor.\n */\n\n }, {\n key: 'show',\n value: function show() {\n this.editorStyle.display = 'block';\n this.hidden = false;\n }\n\n /**\n * Hide the comments editor.\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n this.editorStyle.display = 'none';\n this.hidden = true;\n }\n\n /**\n * Checks if the editor is visible.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isVisible',\n value: function isVisible() {\n return this.editorStyle.display === 'block';\n }\n\n /**\n * Set the comment value.\n *\n * @param {String} [value] The value to use.\n */\n\n }, {\n key: 'setValue',\n value: function setValue() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n value = value || '';\n this.getInputElement().value = value;\n }\n\n /**\n * Get the comment value.\n *\n * @returns {String}\n */\n\n }, {\n key: 'getValue',\n value: function getValue() {\n return this.getInputElement().value;\n }\n\n /**\n * Checks if the comment input element is focused.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFocused',\n value: function isFocused() {\n return document.activeElement === this.getInputElement();\n }\n\n /**\n * Focus the comments input element.\n */\n\n }, {\n key: 'focus',\n value: function focus() {\n this.getInputElement().focus();\n }\n\n /**\n * Create the `textarea` to be used as a comments editor.\n *\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createEditor',\n value: function createEditor() {\n var container = document.querySelector('.' + CommentEditor.CLASS_EDITOR_CONTAINER);\n var editor = void 0;\n var textArea = void 0;\n\n if (!container) {\n container = document.createElement('div');\n (0, _element.addClass)(container, CommentEditor.CLASS_EDITOR_CONTAINER);\n document.body.appendChild(container);\n }\n editor = document.createElement('div');\n (0, _element.addClass)(editor, CommentEditor.CLASS_EDITOR);\n\n textArea = document.createElement('textarea');\n (0, _element.addClass)(textArea, CommentEditor.CLASS_INPUT);\n\n editor.appendChild(textArea);\n container.appendChild(editor);\n\n return editor;\n }\n\n /**\n * Get the input element.\n *\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getInputElement',\n value: function getInputElement() {\n return this.editor.querySelector('.' + CommentEditor.CLASS_INPUT);\n }\n\n /**\n * Destroy the comments editor.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.editor.parentNode.removeChild(this.editor);\n this.editor = null;\n this.editorStyle = null;\n }\n }]);\n\n return CommentEditor;\n}();\n\nexports.default = CommentEditor;\n\n/***/ }),\n/* 217 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _object = __webpack_require__(2);\n\nvar _function = __webpack_require__(35);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _src = __webpack_require__(11);\n\nvar _plugins = __webpack_require__(5);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _commentEditor = __webpack_require__(216);\n\nvar _commentEditor2 = _interopRequireDefault(_commentEditor);\n\nvar _utils = __webpack_require__(17);\n\n__webpack_require__(294);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\nvar META_COMMENT = 'comment';\nvar META_COMMENT_VALUE = 'value';\nvar META_STYLE = 'style';\nvar META_READONLY = 'readOnly';\n\n/**\n * @plugin Comments\n *\n * @description\n * This plugin allows setting and managing cell comments by either an option in the context menu or with the use of the API.\n *\n * To enable the plugin, you'll need to set the comments property of the config object to `true`:\n * ```js\n * ...\n * comments: true\n * ...\n * ```\n *\n * To add comments at the table initialization, define the `comment` property in the `cell` config array as in an example below.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * comments: true,\n * cell: [\n * {row: 1, col: 1, comment: {value: 'Foo'}},\n * {row: 2, col: 2, comment: {value: 'Bar'}}\n * ]\n * });\n *\n * // Access to the Comments plugin instance:\n * var commentsPlugin = hot.getPlugin('comments');\n *\n * // Manage comments programmatically:\n * commentsPlugin.editor.setCommentAtCell(1, 6, 'Comment contents');\n * commentsPlugin.showAtCell(1, 6);\n * commentsPlugin.removeCommentAtCell(1, 6);\n *\n * // You can also set range once and use proper methods:\n * commentsPlugin.setRange({row: 1, col: 6});\n * commentsPlugin.setComment('Comment contents');\n * commentsPlugin.show();\n * commentsPlugin.removeComment();\n * ...\n * ```\n */\n\nvar Comments = function (_BasePlugin) {\n _inherits(Comments, _BasePlugin);\n\n function Comments(hotInstance) {\n _classCallCheck(this, Comments);\n\n /**\n * Instance of {@link CommentEditor}.\n *\n * @type {CommentEditor}\n */\n var _this = _possibleConstructorReturn(this, (Comments.__proto__ || Object.getPrototypeOf(Comments)).call(this, hotInstance));\n\n _this.editor = null;\n /**\n * Instance of {@link EventManager}.\n *\n * @private\n * @type {EventManager}\n */\n _this.eventManager = null;\n /**\n * Current cell range.\n *\n * @type {Object}\n */\n _this.range = {};\n /**\n * @private\n * @type {Boolean}\n */\n _this.mouseDown = false;\n /**\n * @private\n * @type {Boolean}\n */\n _this.contextMenuEvent = false;\n /**\n * @private\n * @type {*}\n */\n _this.timer = null;\n /**\n * Delay used when showing/hiding the comments (in milliseconds).\n *\n * @type {Number}\n */\n _this.displayDelay = 250;\n\n privatePool.set(_this, {\n tempEditorDimensions: {},\n cellBelowCursor: null\n });\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(Comments, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().comments;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n if (!this.editor) {\n this.editor = new _commentEditor2.default();\n }\n\n if (!this.eventManager) {\n this.eventManager = new _eventManager2.default(this);\n }\n\n this.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.addToContextMenu(options);\n });\n this.addHook('afterRenderer', function (TD, row, col, prop, value, cellProperties) {\n return _this2.onAfterRenderer(TD, cellProperties);\n });\n this.addHook('afterScrollHorizontally', function () {\n return _this2.hide();\n });\n this.addHook('afterScrollVertically', function () {\n return _this2.hide();\n });\n\n this.addHook('afterBeginEditing', function (args) {\n return _this2.onAfterBeginEditing(args);\n });\n\n this.registerListeners();\n\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register all necessary DOM listeners.\n *\n * @private\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this3 = this;\n\n this.eventManager.addEventListener(document, 'mouseover', function (event) {\n return _this3.onMouseOver(event);\n });\n this.eventManager.addEventListener(document, 'mousedown', function (event) {\n return _this3.onMouseDown(event);\n });\n this.eventManager.addEventListener(document, 'mouseup', function (event) {\n return _this3.onMouseUp(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', function (event) {\n return _this3.onEditorBlur(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mousedown', function (event) {\n return _this3.onEditorMouseDown(event);\n });\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mouseup', function (event) {\n return _this3.onEditorMouseUp(event);\n });\n }\n\n /**\n * Set current cell range to be able to use general methods like {@link Comments#setComment},\n * {@link Comments#removeComment}, {@link Comments#show}.\n *\n * @param {Object} range Object with `from` and `to` properties, each with `row` and `col` properties.\n */\n\n }, {\n key: 'setRange',\n value: function setRange(range) {\n this.range = range;\n }\n\n /**\n * Clear the currently selected cell.\n */\n\n }, {\n key: 'clearRange',\n value: function clearRange() {\n this.range = {};\n }\n\n /**\n * Check if the event target is a cell containing a comment.\n *\n * @param {Event} event DOM event\n * @returns {Boolean}\n */\n\n }, {\n key: 'targetIsCellWithComment',\n value: function targetIsCellWithComment(event) {\n var closestCell = (0, _element.closest)(event.target, 'TD', 'TBODY');\n\n return !!(closestCell && (0, _element.hasClass)(closestCell, 'htCommentCell') && (0, _element.closest)(closestCell, [this.hot.rootElement]));\n }\n\n /**\n * Check if the event target is a comment textarea.\n *\n * @param {Event} event DOM event.\n * @returns {Boolean}\n */\n\n }, {\n key: 'targetIsCommentTextArea',\n value: function targetIsCommentTextArea(event) {\n return this.editor.getInputElement() === event.target;\n }\n\n /**\n * Set a comment for a cell according to the previously set range (see {@link Comments#setRange}).\n *\n * @param {String} value Comment contents.\n */\n\n }, {\n key: 'setComment',\n value: function setComment(value) {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n var editorValue = this.editor.getValue();\n var comment = '';\n\n if (value != null) {\n comment = value;\n } else if (editorValue != null) {\n comment = editorValue;\n }\n\n var row = this.range.from.row;\n var col = this.range.from.col;\n\n this.updateCommentMeta(row, col, _defineProperty({}, META_COMMENT_VALUE, comment));\n this.hot.render();\n }\n\n /**\n * Set a comment for a cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {String} value Comment contents.\n */\n\n }, {\n key: 'setCommentAtCell',\n value: function setCommentAtCell(row, col, value) {\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n this.setComment(value);\n }\n\n /**\n * Remove a comment from a cell according to previously set range (see {@link Comments#setRange}).\n *\n * @param {Boolean} [forceRender = true] If set to `true`, the table will be re-rendered at the end of the operation.\n */\n\n }, {\n key: 'removeComment',\n value: function removeComment() {\n var forceRender = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n\n this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT, void 0);\n\n if (forceRender) {\n this.hot.render();\n }\n\n this.hide();\n }\n\n /**\n * Remove comment from a cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Boolean} [forceRender = true] If `true`, the table will be re-rendered at the end of the operation.\n */\n\n }, {\n key: 'removeCommentAtCell',\n value: function removeCommentAtCell(row, col) {\n var forceRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n this.removeComment(forceRender);\n }\n\n /**\n * Get comment from a cell at the predefined range.\n */\n\n }, {\n key: 'getComment',\n value: function getComment() {\n var row = this.range.from.row;\n var column = this.range.from.col;\n\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Get comment from a cell at the provided coordinates.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'getCommentAtCell',\n value: function getCommentAtCell(row, column) {\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Show the comment editor accordingly to the previously set range (see {@link Comments#setRange}).\n *\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n\n }, {\n key: 'show',\n value: function show() {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n var meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);\n\n this.refreshEditor(true);\n this.editor.setValue(meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : false || '');\n\n if (this.editor.hidden) {\n this.editor.show();\n }\n\n return true;\n }\n\n /**\n * Show comment editor according to cell coordinates.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n\n }, {\n key: 'showAtCell',\n value: function showAtCell(row, col) {\n this.setRange({\n from: new _src.CellCoords(row, col)\n });\n\n return this.show();\n }\n\n /**\n * Hide the comment editor.\n */\n\n }, {\n key: 'hide',\n value: function hide() {\n if (!this.editor.hidden) {\n this.editor.hide();\n }\n }\n\n /**\n * Refresh comment editor position and styling.\n *\n * @param {Boolean} [force=false] If `true` then recalculation will be forced.\n */\n\n }, {\n key: 'refreshEditor',\n value: function refreshEditor() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!force && (!this.range.from || !this.editor.isVisible())) {\n return;\n }\n var scrollableElement = (0, _element.getScrollableElement)(this.hot.view.wt.wtTable.TABLE);\n var TD = this.hot.view.wt.wtTable.getCell(this.range.from);\n var row = this.range.from.row;\n var column = this.range.from.col;\n var cellOffset = (0, _element.offset)(TD);\n var lastColWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(column);\n var cellTopOffset = cellOffset.top < 0 ? 0 : cellOffset.top;\n var cellLeftOffset = cellOffset.left;\n\n if (this.hot.view.wt.wtViewport.hasVerticalScroll() && scrollableElement !== window) {\n cellTopOffset -= this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition();\n }\n\n if (this.hot.view.wt.wtViewport.hasHorizontalScroll() && scrollableElement !== window) {\n cellLeftOffset -= this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n }\n\n var x = cellLeftOffset + lastColWidth;\n var y = cellTopOffset;\n\n var commentStyle = this.getCommentMeta(row, column, META_STYLE);\n var readOnly = this.getCommentMeta(row, column, META_READONLY);\n\n if (commentStyle) {\n this.editor.setSize(commentStyle.width, commentStyle.height);\n } else {\n this.editor.resetSize();\n }\n\n this.editor.setReadOnlyState(readOnly);\n\n this.editor.setPosition(x, y);\n }\n\n /**\n * Check if there is a comment for selected range.\n *\n * @private\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkSelectionCommentsConsistency',\n value: function checkSelectionCommentsConsistency() {\n var selected = this.hot.getSelectedRange();\n\n if (!selected) {\n return false;\n }\n var hasComment = false;\n var cell = selected.from; // IN EXCEL THERE IS COMMENT ONLY FOR TOP LEFT CELL IN SELECTION\n\n if (this.getCommentMeta(cell.row, cell.col, META_COMMENT_VALUE)) {\n hasComment = true;\n }\n\n return hasComment;\n }\n\n /**\n * Set or update the comment-related cell meta.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @param {Object} metaObject Object defining all the comment-related meta information.\n */\n\n }, {\n key: 'updateCommentMeta',\n value: function updateCommentMeta(row, column, metaObject) {\n var oldComment = this.hot.getCellMeta(row, column)[META_COMMENT];\n var newComment = void 0;\n\n if (oldComment) {\n newComment = (0, _object.deepClone)(oldComment);\n (0, _object.deepExtend)(newComment, metaObject);\n } else {\n newComment = metaObject;\n }\n\n this.hot.setCellMeta(row, column, META_COMMENT, newComment);\n }\n\n /**\n * Get the comment related meta information.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @param {String} property Cell meta property.\n * @returns {Mixed}\n */\n\n }, {\n key: 'getCommentMeta',\n value: function getCommentMeta(row, column, property) {\n var cellMeta = this.hot.getCellMeta(row, column);\n\n if (!cellMeta[META_COMMENT]) {\n return void 0;\n }\n\n return cellMeta[META_COMMENT][property];\n }\n\n /**\n * `mousedown` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n this.mouseDown = true;\n\n if (!this.hot.view || !this.hot.view.wt) {\n return;\n }\n\n if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event)) {\n var eventCell = (0, _element.closest)(event.target, 'TD', 'TBODY');\n var coordinates = null;\n\n if (eventCell) {\n coordinates = this.hot.view.wt.wtTable.getCoords(eventCell);\n }\n\n if (!eventCell || this.range.from && coordinates && (this.range.from.row !== coordinates.row || this.range.from.col !== coordinates.col)) {\n this.hide();\n }\n }\n this.contextMenuEvent = false;\n }\n\n /**\n * `mouseover` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseover` event.\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n var _this4 = this;\n\n if (this.mouseDown || this.editor.isFocused()) {\n return;\n }\n var priv = privatePool.get(this);\n priv.cellBelowCursor = document.elementFromPoint(event.clientX, event.clientY);\n\n (0, _function.debounce)(function () {\n if ((0, _element.hasClass)(event.target, 'wtBorder') || priv.cellBelowCursor !== event.target || !_this4.editor) {\n return;\n }\n\n if (_this4.targetIsCellWithComment(event)) {\n var coordinates = _this4.hot.view.wt.wtTable.getCoords(event.target);\n var range = {\n from: new _src.CellCoords(coordinates.row, coordinates.col)\n };\n\n _this4.setRange(range);\n _this4.show();\n } else if ((0, _element.isChildOf)(event.target, document) && !_this4.targetIsCommentTextArea(event) && !_this4.editor.isFocused()) {\n _this4.hide();\n }\n }, this.displayDelay)();\n }\n\n /**\n * `mouseup` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n this.mouseDown = false;\n }\n\n /** *\n * The `afterRenderer` hook callback..\n *\n * @private\n * @param {HTMLTableCellElement} TD The rendered `TD` element.\n * @param {Object} cellProperties The rendered cell's property object.\n */\n\n }, {\n key: 'onAfterRenderer',\n value: function onAfterRenderer(TD, cellProperties) {\n if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) {\n (0, _element.addClass)(TD, cellProperties.commentedCellClassName);\n }\n }\n\n /**\n * `blur` event callback for the comment editor.\n *\n * @private\n * @param {Event} event The `blur` event.\n */\n\n }, {\n key: 'onEditorBlur',\n value: function onEditorBlur(event) {\n this.setComment();\n }\n\n /**\n * `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n\n }, {\n key: 'onEditorMouseDown',\n value: function onEditorMouseDown(event) {\n var priv = privatePool.get(this);\n\n priv.tempEditorDimensions = {\n width: (0, _element.outerWidth)(event.target),\n height: (0, _element.outerHeight)(event.target)\n };\n }\n\n /**\n * `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n\n }, {\n key: 'onEditorMouseUp',\n value: function onEditorMouseUp(event) {\n var priv = privatePool.get(this);\n var currentWidth = (0, _element.outerWidth)(event.target);\n var currentHeight = (0, _element.outerHeight)(event.target);\n\n if (currentWidth !== priv.tempEditorDimensions.width + 1 || currentHeight !== priv.tempEditorDimensions.height + 2) {\n this.updateCommentMeta(this.range.from.row, this.range.from.col, _defineProperty({}, META_STYLE, {\n width: currentWidth,\n height: currentHeight\n }));\n }\n }\n\n /**\n * Context Menu's \"Add comment\" callback. Results in showing the comment editor.\n *\n * @private\n */\n\n }, {\n key: 'onContextMenuAddComment',\n value: function onContextMenuAddComment() {\n var _this5 = this;\n\n var coords = this.hot.getSelectedRange();\n\n this.contextMenuEvent = true;\n this.setRange({\n from: coords.from\n });\n this.show();\n setTimeout(function () {\n if (_this5.hot) {\n _this5.hot.deselectCell();\n _this5.editor.focus();\n }\n }, 10);\n }\n\n /**\n * Context Menu's \"remove comment\" callback.\n *\n * @private\n * @param {Object} selection The current selection.\n */\n\n }, {\n key: 'onContextMenuRemoveComment',\n value: function onContextMenuRemoveComment(selection) {\n this.contextMenuEvent = true;\n\n for (var i = selection.start.row; i <= selection.end.row; i++) {\n for (var j = selection.start.col; j <= selection.end.col; j++) {\n this.removeCommentAtCell(i, j, false);\n }\n }\n\n this.hot.render();\n }\n\n /**\n * Context Menu's \"make comment read-only\" callback.\n *\n * @private\n * @param {Object} selection The current selection.\n */\n\n }, {\n key: 'onContextMenuMakeReadOnly',\n value: function onContextMenuMakeReadOnly(selection) {\n this.contextMenuEvent = true;\n\n for (var i = selection.start.row; i <= selection.end.row; i++) {\n for (var j = selection.start.col; j <= selection.end.col; j++) {\n var currentState = !!this.getCommentMeta(i, j, META_READONLY);\n\n this.updateCommentMeta(i, j, _defineProperty({}, META_READONLY, !currentState));\n }\n }\n }\n\n /**\n * Add Comments plugin options to the Context Menu.\n *\n * @private\n * @param {Object} defaultOptions\n */\n\n }, {\n key: 'addToContextMenu',\n value: function addToContextMenu(defaultOptions) {\n var _this6 = this;\n\n defaultOptions.items.push((0, _plugins.getPlugin)(this.hot, 'contextMenu').constructor.SEPARATOR, {\n key: 'commentsAddEdit',\n name: function name() {\n return _this6.checkSelectionCommentsConsistency() ? 'Edit comment' : 'Add comment';\n },\n callback: function callback() {\n return _this6.onContextMenuAddComment();\n },\n disabled: function disabled() {\n return !(this.getSelected() && !this.selection.selectedHeader.corner);\n }\n }, {\n key: 'commentsRemove',\n name: function name() {\n return 'Delete comment';\n },\n\n callback: function callback(key, selection) {\n return _this6.onContextMenuRemoveComment(selection);\n },\n disabled: function disabled() {\n return _this6.hot.selection.selectedHeader.corner;\n }\n }, {\n key: 'commentsReadOnly',\n name: function name() {\n var _this7 = this;\n\n var label = 'Read only comment';\n var hasProperty = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var readOnlyProperty = _this7.getCellMeta(row, col)[META_COMMENT];\n if (readOnlyProperty) {\n readOnlyProperty = readOnlyProperty[META_READONLY];\n }\n\n if (readOnlyProperty) {\n return true;\n }\n });\n\n if (hasProperty) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n\n callback: function callback(key, selection) {\n return _this6.onContextMenuMakeReadOnly(selection);\n },\n disabled: function disabled() {\n return _this6.hot.selection.selectedHeader.corner || !_this6.checkSelectionCommentsConsistency();\n }\n });\n }\n\n /**\n * `afterBeginEditing` hook callback.\n *\n * @private\n * @param {Number} row Row index of the currently edited cell.\n * @param {Number} column Column index of the currently edited cell.\n */\n\n }, {\n key: 'onAfterBeginEditing',\n value: function onAfterBeginEditing(row, column) {\n this.hide();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.editor) {\n this.editor.destroy();\n }\n _get(Comments.prototype.__proto__ || Object.getPrototypeOf(Comments.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return Comments;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('comments', Comments);\n\nexports.default = Comments;\n\n/***/ }),\n/* 218 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Command executor for ContextMenu.\n *\n * @class CommandExecutor\n * @plugin ContextMenu\n */\nvar CommandExecutor = function () {\n function CommandExecutor(hotInstance) {\n _classCallCheck(this, CommandExecutor);\n\n this.hot = hotInstance;\n this.commands = {};\n this.commonCallback = null;\n }\n\n /**\n * Register command.\n *\n * @param {String} name Command name.\n * @param {Object} commandDescriptor Command descriptor object with properties like `key` (command id),\n * `callback` (task to execute), `name` (command name), `disabled` (command availability).\n */\n\n\n _createClass(CommandExecutor, [{\n key: 'registerCommand',\n value: function registerCommand(name, commandDescriptor) {\n this.commands[name] = commandDescriptor;\n }\n\n /**\n * Set common callback which will be trigger on every executed command.\n *\n * @param {Function} callback Function which will be fired on every command execute.\n */\n\n }, {\n key: 'setCommonCallback',\n value: function setCommonCallback(callback) {\n this.commonCallback = callback;\n }\n\n /**\n * Execute command by its name.\n *\n * @param {String} commandName Command id.\n * @param {*} params Arguments passed to command task.\n */\n\n }, {\n key: 'execute',\n value: function execute(commandName) {\n var _this = this;\n\n for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n var commandSplit = commandName.split(':');\n commandName = commandSplit[0];\n\n var subCommandName = commandSplit.length === 2 ? commandSplit[1] : null;\n var command = this.commands[commandName];\n\n if (!command) {\n throw new Error('Menu command \\'' + commandName + '\\' not exists.');\n }\n if (subCommandName && command.submenu) {\n command = findSubCommand(subCommandName, command.submenu.items);\n }\n if (command.disabled === true) {\n return;\n }\n if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) {\n return;\n }\n if ((0, _object.hasOwnProperty)(command, 'submenu')) {\n return;\n }\n var callbacks = [];\n\n if (typeof command.callback === 'function') {\n callbacks.push(command.callback);\n }\n if (typeof this.commonCallback === 'function') {\n callbacks.push(this.commonCallback);\n }\n params.unshift(commandSplit.join(':'));\n (0, _array.arrayEach)(callbacks, function (callback) {\n return callback.apply(_this.hot, params);\n });\n }\n }]);\n\n return CommandExecutor;\n}();\n\nfunction findSubCommand(subCommandName, subCommands) {\n var command = void 0;\n\n (0, _array.arrayEach)(subCommands, function (cmd) {\n var cmds = cmd.key ? cmd.key.split(':') : null;\n\n if (Array.isArray(cmds) && cmds[1] === subCommandName) {\n command = cmd;\n\n return false;\n }\n });\n\n return command;\n}\n\nexports.default = CommandExecutor;\n\n/***/ }),\n/* 219 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _commandExecutor = __webpack_require__(218);\n\nvar _commandExecutor2 = _interopRequireDefault(_commandExecutor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _itemsFactory = __webpack_require__(221);\n\nvar _itemsFactory2 = _interopRequireDefault(_itemsFactory);\n\nvar _menu = __webpack_require__(222);\n\nvar _menu2 = _interopRequireDefault(_menu);\n\nvar _plugins = __webpack_require__(5);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _predefinedItems = __webpack_require__(50);\n\n__webpack_require__(295);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('afterContextMenuDefaultOptions');\n_pluginHooks2.default.getSingleton().register('afterContextMenuShow');\n_pluginHooks2.default.getSingleton().register('afterContextMenuHide');\n_pluginHooks2.default.getSingleton().register('afterContextMenuExecute');\n\n/**\n * @description\n * This plugin creates the Handsontable Context Menu. It allows to create a new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n *\n * or array of any available strings:\n * * `[\"row_above\", \"row_below\", \"col_left\", \"col_right\",\n * \"remove_row\", \"remove_col\", \"---------\", \"undo\", \"redo\"]`.\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as a array\n * contextMenu: ['row_above', 'row_below', '---------', 'undo', 'redo']\n * ...\n * ```\n *\n * @plugin ContextMenu\n */\n\nvar ContextMenu = function (_BasePlugin) {\n _inherits(ContextMenu, _BasePlugin);\n\n _createClass(ContextMenu, null, [{\n key: 'DEFAULT_ITEMS',\n\n /**\n * Default menu items order when `contextMenu` is enabled by `true`.\n *\n * @returns {Array}\n */\n get: function get() {\n return [_predefinedItems.ROW_ABOVE, _predefinedItems.ROW_BELOW, _predefinedItems.SEPARATOR, _predefinedItems.COLUMN_LEFT, _predefinedItems.COLUMN_RIGHT, _predefinedItems.SEPARATOR, _predefinedItems.REMOVE_ROW, _predefinedItems.REMOVE_COLUMN, _predefinedItems.SEPARATOR, _predefinedItems.UNDO, _predefinedItems.REDO, _predefinedItems.SEPARATOR, _predefinedItems.READ_ONLY, _predefinedItems.SEPARATOR, _predefinedItems.ALIGNMENT];\n }\n }]);\n\n function ContextMenu(hotInstance) {\n _classCallCheck(this, ContextMenu);\n\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (ContextMenu.__proto__ || Object.getPrototypeOf(ContextMenu)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Instance of {@link CommandExecutor}.\n *\n * @type {CommandExecutor}\n */\n _this.commandExecutor = new _commandExecutor2.default(_this.hot);\n /**\n * Instance of {@link ItemsFactory}.\n *\n * @type {ItemsFactory}\n */\n _this.itemsFactory = null;\n /**\n * Instance of {@link Menu}.\n *\n * @type {Menu}\n */\n _this.menu = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ContextMenu, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().contextMenu;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n this.itemsFactory = new _itemsFactory2.default(this.hot, ContextMenu.DEFAULT_ITEMS);\n\n var settings = this.hot.getSettings().contextMenu;\n var predefinedItems = {\n items: this.itemsFactory.getItems(settings)\n };\n this.registerEvents();\n\n if (typeof settings.callback === 'function') {\n this.commandExecutor.setCommonCallback(settings.callback);\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'enablePlugin', this).call(this);\n\n this.callOnPluginsReady(function () {\n _this2.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems);\n\n _this2.itemsFactory.setPredefinedItems(predefinedItems.items);\n var menuItems = _this2.itemsFactory.getItems(settings);\n\n _this2.menu = new _menu2.default(_this2.hot, {\n className: 'htContextMenu',\n keepInViewport: true\n });\n _this2.hot.runHooks('beforeContextMenuSetItems', menuItems);\n\n _this2.menu.setMenuItems(menuItems);\n\n _this2.menu.addLocalHook('afterOpen', function () {\n return _this2.onMenuAfterOpen();\n });\n _this2.menu.addLocalHook('afterClose', function () {\n return _this2.onMenuAfterClose();\n });\n _this2.menu.addLocalHook('executeCommand', function () {\n for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n\n return _this2.executeCommand.apply(_this2, params);\n });\n\n // Register all commands. Predefined and added by user or by plugins\n (0, _array.arrayEach)(menuItems, function (command) {\n return _this2.commandExecutor.registerCommand(command.key, command);\n });\n });\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n this.menu = null;\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register dom listeners.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', function (event) {\n return _this3.onContextMenu(event);\n });\n }\n\n /**\n * Open menu and re-position it based on dom event object.\n *\n * @param {Event} event The event object.\n */\n\n }, {\n key: 'open',\n value: function open(event) {\n if (!this.menu) {\n return;\n }\n this.menu.open();\n this.menu.setPosition({\n top: parseInt((0, _event.pageY)(event), 10) - (0, _element.getWindowScrollTop)(),\n left: parseInt((0, _event.pageX)(event), 10) - (0, _element.getWindowScrollLeft)()\n });\n\n // ContextMenu is not detected HotTableEnv correctly because is injected outside hot-table\n this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv;\n // Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv;\n }\n\n /**\n * Close menu.\n */\n\n }, {\n key: 'close',\n value: function close() {\n if (!this.menu) {\n return;\n }\n this.menu.close();\n }\n\n /**\n * Execute context menu command.\n *\n * You can execute all predefined commands:\n * * `'row_above'` - Insert row above\n * * `'row_below'` - Insert row below\n * * `'col_left'` - Insert column on the left\n * * `'col_right'` - Insert column on the right\n * * `'clear_column'` - Clear selected column\n * * `'remove_row'` - Remove row\n * * `'remove_col'` - Remove column\n * * `'undo'` - Undo last action\n * * `'redo'` - Redo last action\n * * `'make_read_only'` - Make cell read only\n * * `'alignment:left'` - Alignment to the left\n * * `'alignment:top'` - Alignment to the top\n * * `'alignment:right'` - Alignment to the right\n * * `'alignment:bottom'` - Alignment to the bottom\n * * `'alignment:middle'` - Alignment to the middle\n * * `'alignment:center'` - Alignment to the center (justify)\n *\n * Or you can execute command registered in settings where `key` is your command name.\n *\n * @param {String} commandName\n * @param {*} params\n */\n\n }, {\n key: 'executeCommand',\n value: function executeCommand() {\n for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n params[_key2] = arguments[_key2];\n }\n\n this.commandExecutor.execute.apply(this.commandExecutor, params);\n }\n\n /**\n * On context menu listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onContextMenu',\n value: function onContextMenu(event) {\n var settings = this.hot.getSettings();\n var showRowHeaders = settings.rowHeaders;\n var showColHeaders = settings.colHeaders;\n\n function isValidElement(element) {\n return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';\n }\n // if event is from hot-table we must get web component element not element inside him\n var element = event.realTarget;\n this.close();\n\n if ((0, _element.hasClass)(element, 'handsontableInput')) {\n return;\n }\n\n event.preventDefault();\n (0, _event.stopPropagation)(event);\n\n if (!(showRowHeaders || showColHeaders)) {\n if (!isValidElement(element) && !((0, _element.hasClass)(element, 'current') && (0, _element.hasClass)(element, 'wtBorder'))) {\n return;\n }\n }\n\n this.open(event);\n }\n\n /**\n * On menu after open listener.\n *\n * @private\n */\n\n }, {\n key: 'onMenuAfterOpen',\n value: function onMenuAfterOpen() {\n this.hot.runHooks('afterContextMenuShow', this);\n }\n\n /**\n * On menu after close listener.\n *\n * @private\n */\n\n }, {\n key: 'onMenuAfterClose',\n value: function onMenuAfterClose() {\n this.hot.listen();\n this.hot.runHooks('afterContextMenuHide', this);\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n }\n _get(ContextMenu.prototype.__proto__ || Object.getPrototypeOf(ContextMenu.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ContextMenu;\n}(_base2.default);\n\nContextMenu.SEPARATOR = {\n name: _predefinedItems.SEPARATOR\n};\n\n(0, _plugins.registerPlugin)('contextMenu', ContextMenu);\n\nexports.default = ContextMenu;\n\n/***/ }),\n/* 220 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _event = __webpack_require__(7);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class for checking if element will fit at the desired side of cursor.\n *\n * @class Cursor\n * @plugin ContextMenu\n */\nvar Cursor = function () {\n function Cursor(object) {\n _classCallCheck(this, Cursor);\n\n var windowScrollTop = (0, _element.getWindowScrollTop)();\n var windowScrollLeft = (0, _element.getWindowScrollLeft)();\n var top = void 0,\n topRelative = void 0;\n var left = void 0,\n leftRelative = void 0;\n var cellHeight = void 0,\n cellWidth = void 0;\n\n this.type = this.getSourceType(object);\n\n if (this.type === 'literal') {\n top = parseInt(object.top, 10);\n left = parseInt(object.left, 10);\n cellHeight = object.height || 0;\n cellWidth = object.width || 0;\n topRelative = top;\n leftRelative = left;\n top += windowScrollTop;\n left += windowScrollLeft;\n } else if (this.type === 'event') {\n top = parseInt((0, _event.pageY)(object), 10);\n left = parseInt((0, _event.pageX)(object), 10);\n cellHeight = object.target.clientHeight;\n cellWidth = object.target.clientWidth;\n topRelative = top - windowScrollTop;\n leftRelative = left - windowScrollLeft;\n }\n\n this.top = top;\n this.topRelative = topRelative;\n this.left = left;\n this.leftRelative = leftRelative;\n this.scrollTop = windowScrollTop;\n this.scrollLeft = windowScrollLeft;\n this.cellHeight = cellHeight;\n this.cellWidth = cellWidth;\n }\n\n /**\n * Get source type name.\n *\n * @param {*} object Event or Object with coordinates.\n * @returns {String} Returns one of this values: `'literal'`, `'event'`.\n */\n\n\n _createClass(Cursor, [{\n key: 'getSourceType',\n value: function getSourceType(object) {\n var type = 'literal';\n\n if (object instanceof Event) {\n type = 'event';\n }\n\n return type;\n }\n\n /**\n * Checks if element can be placed above the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit above the cursor.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsAbove',\n value: function fitsAbove(element) {\n return this.topRelative >= element.offsetHeight;\n }\n\n /**\n * Checks if element can be placed below the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit below the cursor.\n * @param {Number} [viewportHeight] The viewport height.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsBelow',\n value: function fitsBelow(element) {\n var viewportHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerHeight;\n\n return this.topRelative + element.offsetHeight <= viewportHeight;\n }\n\n /**\n * Checks if element can be placed on the right of the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the right of the cursor.\n * @param {Number} [viewportWidth] The viewport width.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsOnRight',\n value: function fitsOnRight(element) {\n var viewportWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerWidth;\n\n return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth;\n }\n\n /**\n * Checks if element can be placed on the left on the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the left of the cursor.\n * @returns {Boolean}\n */\n\n }, {\n key: 'fitsOnLeft',\n value: function fitsOnLeft(element) {\n return this.leftRelative >= element.offsetWidth;\n }\n }]);\n\n return Cursor;\n}();\n\nexports.default = Cursor;\n\n/***/ }),\n/* 221 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _object = __webpack_require__(2);\n\nvar _array = __webpack_require__(1);\n\nvar _predefinedItems = __webpack_require__(50);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Predefined items class factory for menu items.\n *\n * @class ItemsFactory\n * @plugin ContextMenu\n */\nvar ItemsFactory = function () {\n function ItemsFactory(hotInstance) {\n var orderPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, ItemsFactory);\n\n this.hot = hotInstance;\n this.predefinedItems = (0, _predefinedItems.predefinedItems)();\n this.defaultOrderPattern = orderPattern;\n }\n\n /**\n * Set predefined items.\n *\n * @param {Array} predefinedItems Array of predefined items.\n */\n\n\n _createClass(ItemsFactory, [{\n key: 'setPredefinedItems',\n value: function setPredefinedItems(predefinedItems) {\n var _this = this;\n\n var items = {};\n\n this.defaultOrderPattern.length = 0;\n\n (0, _object.objectEach)(predefinedItems, function (value, key) {\n var menuItemKey = '';\n\n if (value.name === _predefinedItems.SEPARATOR) {\n items[_predefinedItems.SEPARATOR] = value;\n menuItemKey = _predefinedItems.SEPARATOR;\n\n // Menu item added as a property to array\n } else if (isNaN(parseInt(key, 10))) {\n value.key = value.key === void 0 ? key : value.key;\n items[key] = value;\n menuItemKey = value.key;\n } else {\n items[value.key] = value;\n menuItemKey = value.key;\n }\n _this.defaultOrderPattern.push(menuItemKey);\n });\n this.predefinedItems = items;\n }\n\n /**\n * Get all menu items based on pattern.\n *\n * @param {Array|Object|Boolean} pattern Pattern which you can define by displaying menu items order. If `true` default\n * pattern will be used.\n * @returns {Array}\n */\n\n }, {\n key: 'getItems',\n value: function getItems() {\n var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n return _getItems(pattern, this.defaultOrderPattern, this.predefinedItems);\n }\n }]);\n\n return ItemsFactory;\n}();\n\nfunction _getItems() {\n var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var defaultPattern = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var result = [];\n\n if (pattern && pattern.items) {\n pattern = pattern.items;\n } else if (!Array.isArray(pattern)) {\n pattern = defaultPattern;\n }\n if ((0, _object.isObject)(pattern)) {\n (0, _object.objectEach)(pattern, function (value, key) {\n var item = items[typeof value === 'string' ? value : key];\n\n if (!item) {\n item = value;\n }\n if ((0, _object.isObject)(value)) {\n (0, _object.extend)(item, value);\n } else if (typeof item === 'string') {\n item = { name: item };\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n } else {\n (0, _array.arrayEach)(pattern, function (name, key) {\n var item = items[name];\n\n // Item deleted from settings `allowInsertRow: false` etc.\n if (!item && _predefinedItems.ITEMS.indexOf(name) >= 0) {\n return;\n }\n if (!item) {\n item = { name: name, key: '' + key };\n }\n if ((0, _object.isObject)(name)) {\n (0, _object.extend)(item, name);\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n }\n\n return result;\n}\n\nexports.default = ItemsFactory;\n\n/***/ }),\n/* 222 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = __webpack_require__(64);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _cursor = __webpack_require__(220);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _object = __webpack_require__(2);\n\nvar _function = __webpack_require__(35);\n\nvar _utils = __webpack_require__(17);\n\nvar _unicode = __webpack_require__(16);\n\nvar _localHooks = __webpack_require__(150);\n\nvar _localHooks2 = _interopRequireDefault(_localHooks);\n\nvar _predefinedItems = __webpack_require__(50);\n\nvar _event = __webpack_require__(7);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Menu\n * @plugin ContextMenu\n */\nvar Menu = function () {\n function Menu(hotInstance, options) {\n _classCallCheck(this, Menu);\n\n this.hot = hotInstance;\n this.options = options || {\n parent: null,\n name: null,\n className: '',\n keepInViewport: true,\n standalone: false\n };\n this.eventManager = new _eventManager2.default(this);\n this.container = this.createContainer(this.options.name);\n this.hotMenu = null;\n this.hotSubMenus = {};\n this.parentMenu = this.options.parent || null;\n this.menuItems = null;\n this.origOutsideClickDeselects = null;\n this.keyEvent = false;\n\n this.offset = {\n above: 0,\n below: 0,\n left: 0,\n right: 0\n };\n this._afterScrollCallback = null;\n\n this.registerEvents();\n }\n\n /**\n * Register event listeners.\n *\n * @private\n */\n\n\n _createClass(Menu, [{\n key: 'registerEvents',\n value: function registerEvents() {\n var _this = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousedown', function (event) {\n return _this.onDocumentMouseDown(event);\n });\n }\n\n /**\n * Set array of objects which defines menu items.\n *\n * @param {Array} menuItems Menu items to display.\n */\n\n }, {\n key: 'setMenuItems',\n value: function setMenuItems(menuItems) {\n this.menuItems = menuItems;\n }\n\n /**\n * Set offset menu position for specified area (`above`, `below`, `left` or `right`).\n *\n * @param {String} area Specified area name (`above`, `below`, `left` or `right`).\n * @param {Number} offset Offset value.\n */\n\n }, {\n key: 'setOffset',\n value: function setOffset(area) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n this.offset[area] = offset;\n }\n\n /**\n * Check if menu is using as sub-menu.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isSubMenu',\n value: function isSubMenu() {\n return this.parentMenu !== null;\n }\n\n /**\n * Open menu.\n */\n\n }, {\n key: 'open',\n value: function open() {\n var _this2 = this;\n\n this.container.removeAttribute('style');\n this.container.style.display = 'block';\n\n var delayedOpenSubMenu = (0, _function.debounce)(function (row) {\n return _this2.openSubMenu(row);\n }, 300);\n\n var filteredItems = (0, _array.arrayFilter)(this.menuItems, function (item) {\n return (0, _utils.isItemHidden)(item, _this2.hot);\n });\n\n filteredItems = (0, _utils.filterSeparators)(filteredItems, _predefinedItems.SEPARATOR);\n\n var settings = {\n data: filteredItems,\n colHeaders: false,\n colWidths: [200],\n autoRowSize: false,\n readOnly: true,\n copyPaste: false,\n columns: [{\n data: 'name',\n renderer: function renderer(hot, TD, row, col, prop, value) {\n return _this2.menuItemRenderer(hot, TD, row, col, prop, value);\n }\n }],\n renderAllRows: true,\n fragmentSelection: 'cell',\n disableVisualSelection: 'area',\n beforeKeyDown: function beforeKeyDown(event) {\n return _this2.onBeforeKeyDown(event);\n },\n afterOnCellMouseOver: function afterOnCellMouseOver(event, coords, TD) {\n if (_this2.isAllSubMenusClosed()) {\n delayedOpenSubMenu(coords.row);\n } else {\n _this2.openSubMenu(coords.row);\n }\n },\n rowHeights: function rowHeights(row) {\n return filteredItems[row].name === _predefinedItems.SEPARATOR ? 1 : 23;\n }\n };\n this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects;\n this.hot.getSettings().outsideClickDeselects = false;\n this.hotMenu = new _core2.default(this.container, settings);\n this.hotMenu.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n this.hotMenu.addHook('afterSelection', function (r, c, r2, c2, preventScrolling) {\n return _this2.onAfterSelection(r, c, r2, c2, preventScrolling);\n });\n this.hotMenu.init();\n this.hotMenu.listen();\n this.blockMainTableCallbacks();\n this.runLocalHooks('afterOpen');\n }\n\n /**\n * Close menu.\n *\n * @param {Boolean} [closeParent=false] if `true` try to close parent menu if exists.\n */\n\n }, {\n key: 'close',\n value: function close() {\n var closeParent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.isOpened()) {\n return;\n }\n if (closeParent && this.parentMenu) {\n this.parentMenu.close();\n } else {\n this.closeAllSubMenus();\n this.container.style.display = 'none';\n this.releaseMainTableCallbacks();\n this.hotMenu.destroy();\n this.hotMenu = null;\n this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects;\n this.runLocalHooks('afterClose');\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n }\n }\n\n /**\n * Open sub menu at the provided row index.\n *\n * @param {Number} row Row index.\n * @returns {Menu|Boolean} Returns created menu or `false` if no one menu was created.\n */\n\n }, {\n key: 'openSubMenu',\n value: function openSubMenu(row) {\n if (!this.hotMenu) {\n return false;\n }\n var cell = this.hotMenu.getCell(row, 0);\n\n this.closeAllSubMenus();\n\n if (!cell || !(0, _utils.hasSubMenu)(cell)) {\n return false;\n }\n var dataItem = this.hotMenu.getSourceDataAtRow(row);\n var subMenu = new Menu(this.hot, {\n parent: this,\n name: dataItem.name,\n className: this.options.className,\n keepInViewport: true\n });\n subMenu.setMenuItems(dataItem.submenu.items);\n subMenu.open();\n subMenu.setPosition(cell.getBoundingClientRect());\n this.hotSubMenus[dataItem.key] = subMenu;\n\n return subMenu;\n }\n\n /**\n * Close sub menu at row index.\n *\n * @param {Number} row Row index.\n */\n\n }, {\n key: 'closeSubMenu',\n value: function closeSubMenu(row) {\n var dataItem = this.hotMenu.getSourceDataAtRow(row);\n var menus = this.hotSubMenus[dataItem.key];\n\n if (menus) {\n menus.destroy();\n delete this.hotSubMenus[dataItem.key];\n }\n }\n\n /**\n * Close all opened sub menus.\n */\n\n }, {\n key: 'closeAllSubMenus',\n value: function closeAllSubMenus() {\n var _this3 = this;\n\n (0, _array.arrayEach)(this.hotMenu.getData(), function (value, row) {\n return _this3.closeSubMenu(row);\n });\n }\n\n /**\n * Checks if all created and opened sub menus are closed.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isAllSubMenusClosed',\n value: function isAllSubMenusClosed() {\n return Object.keys(this.hotSubMenus).length === 0;\n }\n\n /**\n * Destroy instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.clearLocalHooks();\n this.close();\n this.parentMenu = null;\n this.eventManager.destroy();\n }\n\n /**\n * Checks if menu was opened.\n *\n * @returns {Boolean} Returns `true` if menu was opened.\n */\n\n }, {\n key: 'isOpened',\n value: function isOpened() {\n return this.hotMenu !== null;\n }\n\n /**\n * Execute menu command.\n *\n * @param {Event} [event]\n */\n\n }, {\n key: 'executeCommand',\n value: function executeCommand(event) {\n if (!this.isOpened() || !this.hotMenu.getSelected()) {\n return;\n }\n var selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);\n\n this.runLocalHooks('select', selectedItem, event);\n\n if (selectedItem.isCommand === false || selectedItem.name === _predefinedItems.SEPARATOR) {\n return;\n }\n var selRange = this.hot.getSelectedRange();\n var normalizedSelection = selRange ? (0, _utils.normalizeSelection)(selRange) : {};\n var autoClose = true;\n\n // Don't close context menu if item is disabled or it has submenu\n if (selectedItem.disabled === true || typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true || selectedItem.submenu) {\n autoClose = false;\n }\n\n this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n\n if (this.isSubMenu()) {\n this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n }\n\n if (autoClose) {\n this.close(true);\n }\n }\n\n /**\n * Set menu position based on dom event or based on literal object.\n *\n * @param {Event|Object} coords Event or literal Object with coordinates.\n */\n\n }, {\n key: 'setPosition',\n value: function setPosition(coords) {\n var cursor = new _cursor2.default(coords);\n\n if (this.options.keepInViewport) {\n if (cursor.fitsBelow(this.container)) {\n this.setPositionBelowCursor(cursor);\n } else if (cursor.fitsAbove(this.container)) {\n this.setPositionAboveCursor(cursor);\n } else {\n this.setPositionBelowCursor(cursor);\n }\n if (cursor.fitsOnRight(this.container)) {\n this.setPositionOnRightOfCursor(cursor);\n } else {\n this.setPositionOnLeftOfCursor(cursor);\n }\n } else {\n this.setPositionBelowCursor(cursor);\n this.setPositionOnRightOfCursor(cursor);\n }\n }\n\n /**\n * Set menu position above cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionAboveCursor',\n value: function setPositionAboveCursor(cursor) {\n var top = this.offset.above + cursor.top - this.container.offsetHeight;\n\n if (this.isSubMenu()) {\n top = cursor.top + cursor.cellHeight - this.container.offsetHeight + 3;\n }\n this.container.style.top = top + 'px';\n }\n\n /**\n * Set menu position below cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionBelowCursor',\n value: function setPositionBelowCursor(cursor) {\n var top = this.offset.below + cursor.top;\n\n if (this.isSubMenu()) {\n top = cursor.top - 1;\n }\n this.container.style.top = top + 'px';\n }\n\n /**\n * Set menu position on the right of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionOnRightOfCursor',\n value: function setPositionOnRightOfCursor(cursor) {\n var left = void 0;\n\n if (this.isSubMenu()) {\n left = 1 + cursor.left + cursor.cellWidth;\n } else {\n left = this.offset.right + 1 + cursor.left;\n }\n\n this.container.style.left = left + 'px';\n }\n\n /**\n * Set menu position on the left of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n\n }, {\n key: 'setPositionOnLeftOfCursor',\n value: function setPositionOnLeftOfCursor(cursor) {\n var left = this.offset.left + cursor.left - this.container.offsetWidth + (0, _element.getScrollbarWidth)() + 4;\n\n this.container.style.left = left + 'px';\n }\n\n /**\n * Select first cell in opened menu.\n */\n\n }, {\n key: 'selectFirstCell',\n value: function selectFirstCell() {\n var cell = this.hotMenu.getCell(0, 0);\n\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectNextCell(0, 0);\n } else {\n this.hotMenu.selectCell(0, 0);\n }\n }\n\n /**\n * Select last cell in opened menu.\n */\n\n }, {\n key: 'selectLastCell',\n value: function selectLastCell() {\n var lastRow = this.hotMenu.countRows() - 1;\n var cell = this.hotMenu.getCell(lastRow, 0);\n\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectPrevCell(lastRow, 0);\n } else {\n this.hotMenu.selectCell(lastRow, 0);\n }\n }\n\n /**\n * Select next cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n\n }, {\n key: 'selectNextCell',\n value: function selectNextCell(row, col) {\n var nextRow = row + 1;\n var cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null;\n\n if (!cell) {\n return;\n }\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectNextCell(nextRow, col);\n } else {\n this.hotMenu.selectCell(nextRow, col);\n }\n }\n\n /**\n * Select previous cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n\n }, {\n key: 'selectPrevCell',\n value: function selectPrevCell(row, col) {\n var prevRow = row - 1;\n var cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null;\n\n if (!cell) {\n return;\n }\n if ((0, _utils.isSeparator)(cell) || (0, _utils.isDisabled)(cell) || (0, _utils.isSelectionDisabled)(cell)) {\n this.selectPrevCell(prevRow, col);\n } else {\n this.hotMenu.selectCell(prevRow, col);\n }\n }\n\n /**\n * Menu item renderer.\n *\n * @private\n */\n\n }, {\n key: 'menuItemRenderer',\n value: function menuItemRenderer(hot, TD, row, col, prop, value) {\n var _this4 = this;\n\n var item = hot.getSourceDataAtRow(row);\n var wrapper = document.createElement('div');\n\n var isSubMenu = function isSubMenu(item) {\n return (0, _object.hasOwnProperty)(item, 'submenu');\n };\n var itemIsSeparator = function itemIsSeparator(item) {\n return new RegExp(_predefinedItems.SEPARATOR, 'i').test(item.name);\n };\n var itemIsDisabled = function itemIsDisabled(item) {\n return item.disabled === true || typeof item.disabled == 'function' && item.disabled.call(_this4.hot) === true;\n };\n var itemIsSelectionDisabled = function itemIsSelectionDisabled(item) {\n return item.disableSelection;\n };\n\n if (typeof value === 'function') {\n value = value.call(this.hot);\n }\n (0, _element.empty)(TD);\n (0, _element.addClass)(wrapper, 'htItemWrapper');\n TD.appendChild(wrapper);\n\n if (itemIsSeparator(item)) {\n (0, _element.addClass)(TD, 'htSeparator');\n } else if (typeof item.renderer === 'function') {\n (0, _element.addClass)(TD, 'htCustomMenuRenderer');\n TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value));\n } else {\n (0, _element.fastInnerHTML)(wrapper, value);\n }\n if (itemIsDisabled(item)) {\n (0, _element.addClass)(TD, 'htDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else if (itemIsSelectionDisabled(item)) {\n (0, _element.addClass)(TD, 'htSelectionDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else if (isSubMenu(item)) {\n (0, _element.addClass)(TD, 'htSubmenu');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.selectCell(row, col, void 0, void 0, false, false);\n });\n }\n } else {\n (0, _element.removeClass)(TD, 'htSubmenu');\n (0, _element.removeClass)(TD, 'htDisabled');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.deselectCell();\n });\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', function () {\n return hot.selectCell(row, col, void 0, void 0, false, false);\n });\n }\n }\n }\n\n /**\n * Create container/wrapper for handsontable.\n *\n * @private\n * @param {String} [name] Class name.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'createContainer',\n value: function createContainer() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (name) {\n name = name.replace(/[^A-z0-9]/g, '_');\n name = this.options.className + 'Sub_' + name;\n }\n var container = void 0;\n\n if (name) {\n container = document.querySelector('.' + this.options.className + '.' + name);\n } else {\n container = document.querySelector('.' + this.options.className);\n }\n if (!container) {\n container = document.createElement('div');\n (0, _element.addClass)(container, 'htMenu ' + this.options.className);\n\n if (name) {\n (0, _element.addClass)(container, name);\n }\n document.getElementsByTagName('body')[0].appendChild(container);\n }\n\n return container;\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'blockMainTableCallbacks',\n value: function blockMainTableCallbacks() {\n this._afterScrollCallback = function () {};\n this.hot.addHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'releaseMainTableCallbacks',\n value: function releaseMainTableCallbacks() {\n if (this._afterScrollCallback) {\n this.hot.removeHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback);\n this._afterScrollCallback = null;\n }\n }\n\n /**\n * On before key down listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onBeforeKeyDown',\n value: function onBeforeKeyDown(event) {\n var selection = this.hotMenu.getSelected();\n var stopEvent = false;\n this.keyEvent = true;\n\n switch (event.keyCode) {\n case _unicode.KEY_CODES.ESCAPE:\n this.close();\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ENTER:\n if (selection) {\n if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) {\n stopEvent = true;\n } else {\n this.executeCommand(event);\n this.close(true);\n }\n }\n break;\n\n case _unicode.KEY_CODES.ARROW_DOWN:\n if (selection) {\n this.selectNextCell(selection[0], selection[1]);\n } else {\n this.selectFirstCell();\n }\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ARROW_UP:\n if (selection) {\n this.selectPrevCell(selection[0], selection[1]);\n } else {\n this.selectLastCell();\n }\n stopEvent = true;\n break;\n\n case _unicode.KEY_CODES.ARROW_RIGHT:\n if (selection) {\n var menu = this.openSubMenu(selection[0]);\n\n if (menu) {\n menu.selectFirstCell();\n }\n }\n stopEvent = true;\n\n break;\n\n case _unicode.KEY_CODES.ARROW_LEFT:\n if (selection && this.isSubMenu()) {\n this.close();\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n stopEvent = true;\n }\n break;\n default:\n break;\n }\n if (stopEvent) {\n event.preventDefault();\n (0, _event.stopImmediatePropagation)(event);\n }\n\n this.keyEvent = false;\n }\n\n /**\n * On after init listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n var data = this.hotMenu.getSettings().data;\n var hiderStyle = this.hotMenu.view.wt.wtTable.hider.style;\n var holderStyle = this.hotMenu.view.wt.wtTable.holder.style;\n var currentHiderWidth = parseInt(hiderStyle.width, 10);\n\n var realHeight = (0, _array.arrayReduce)(data, function (accumulator, value) {\n return accumulator + (value.name === _predefinedItems.SEPARATOR ? 1 : 26);\n }, 0);\n\n holderStyle.width = currentHiderWidth + 22 + 'px';\n holderStyle.height = realHeight + 4 + 'px';\n hiderStyle.height = holderStyle.height;\n }\n\n /**\n * On after selection listener.\n *\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n */\n\n }, {\n key: 'onAfterSelection',\n value: function onAfterSelection(r, c, r2, c2, preventScrolling) {\n if (this.keyEvent === false) {\n preventScrolling.value = true;\n }\n }\n\n /**\n * Document mouse down listener.\n *\n * @private\n * @param {Event} event\n */\n\n }, {\n key: 'onDocumentMouseDown',\n value: function onDocumentMouseDown(event) {\n if (!this.isOpened()) {\n return;\n }\n if (this.container && (0, _element.isChildOf)(event.target, this.container)) {\n this.executeCommand(event);\n }\n // Close menu when clicked element is not belongs to menu itself\n if (this.options.standalone && this.hotMenu && !(0, _element.isChildOf)(event.target, this.hotMenu.rootElement)) {\n this.close(true);\n\n // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)\n } else if ((this.isAllSubMenusClosed() || this.isSubMenu()) && !(0, _element.isChildOf)(event.target, '.htMenu') && (0, _element.isChildOf)(event.target, document)) {\n this.close(true);\n }\n }\n }]);\n\n return Menu;\n}();\n\n(0, _object.mixin)(Menu, _localHooks2.default);\n\nexports.default = Menu;\n\n/***/ }),\n/* 223 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = alignmentItem;\n\nvar _utils = __webpack_require__(17);\n\nvar _separator = __webpack_require__(70);\n\nvar KEY = exports.KEY = 'alignment';\n\nfunction alignmentItem() {\n return {\n key: KEY,\n name: 'Alignment',\n disabled: function disabled() {\n return !(this.getSelectedRange() && !this.selection.selectedHeader.corner);\n },\n\n submenu: {\n items: [{\n key: KEY + ':left',\n name: function name() {\n var _this = this;\n\n var label = 'Left';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htLeft') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this2 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this2.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htLeft';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this2.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this2.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':center',\n name: function name() {\n var _this3 = this;\n\n var label = 'Center';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this3.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htCenter') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this4 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this4.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htCenter';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this4.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this4.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':right',\n name: function name() {\n var _this5 = this;\n\n var label = 'Right';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this5.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htRight') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this6 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this6.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htRight';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this6.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this6.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':justify',\n name: function name() {\n var _this7 = this;\n\n var label = 'Justify';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this7.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htJustify') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this8 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this8.getCellMeta(row, col).className;\n });\n var type = 'horizontal';\n var alignment = 'htJustify';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this8.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this8.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n name: _separator.KEY\n }, {\n key: KEY + ':top',\n name: function name() {\n var _this9 = this;\n\n var label = 'Top';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this9.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htTop') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n return label;\n },\n callback: function callback() {\n var _this10 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this10.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htTop';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this10.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this10.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':middle',\n name: function name() {\n var _this11 = this;\n\n var label = 'Middle';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this11.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htMiddle') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this12 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this12.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htMiddle';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this12.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this12.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }, {\n key: KEY + ':bottom',\n name: function name() {\n var _this13 = this;\n\n var label = 'Bottom';\n var hasClass = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n var className = _this13.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htBottom') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this14 = this;\n\n var range = this.getSelectedRange();\n var stateBefore = (0, _utils.getAlignmentClasses)(range, function (row, col) {\n return _this14.getCellMeta(row, col).className;\n });\n var type = 'vertical';\n var alignment = 'htBottom';\n\n this.runHooks('beforeCellAlignment', stateBefore, range, type, alignment);\n (0, _utils.align)(range, type, alignment, function (row, col) {\n return _this14.getCellMeta(row, col);\n }, function (row, col, key, value) {\n return _this14.setCellMeta(row, col, key, value);\n });\n this.render();\n },\n\n disabled: false\n }]\n }\n };\n}\n\n/***/ }),\n/* 224 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = clearColumnItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'clear_column';\n\nfunction clearColumnItem() {\n return {\n key: KEY,\n name: 'Clear column',\n\n callback: function callback(key, selection) {\n var column = selection.start.col;\n\n if (this.countRows()) {\n this.populateFromArray(0, column, [[null]], Math.max(selection.start.row, selection.end.row), column, 'ContextMenu.clearColumn');\n }\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;\n }\n };\n}\n\n/***/ }),\n/* 225 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = columnLeftItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'col_left';\n\nfunction columnLeftItem() {\n return {\n key: KEY,\n name: 'Insert column on the left',\n callback: function callback(key, selection) {\n this.alter('insert_col', selection.start.col, 1, 'ContextMenu.columnLeft');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n var onlyOneColumn = this.countCols() === 1;\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || !onlyOneColumn && rowSelected;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n/***/ }),\n/* 226 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = columnRightItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'col_right';\n\nfunction columnRightItem() {\n return {\n key: KEY,\n name: 'Insert column on the right',\n\n callback: function callback(key, selection) {\n this.alter('insert_col', selection.end.col + 1, 1, 'ContextMenu.columnRight');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n var entireRowSelection = [selected[0], 0, selected[0], this.countCols() - 1];\n var rowSelected = entireRowSelection.join(',') == selected.join(',');\n var onlyOneColumn = this.countCols() === 1;\n\n return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || !onlyOneColumn && rowSelected;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n/***/ }),\n/* 227 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = readOnlyItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'make_read_only';\n\nfunction readOnlyItem() {\n return {\n key: KEY,\n name: function name() {\n var _this = this;\n\n var label = 'Read only';\n var atLeastOneReadOnly = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {\n return _this.getCellMeta(row, col).readOnly;\n });\n\n if (atLeastOneReadOnly) {\n label = (0, _utils.markLabelAsSelected)(label);\n }\n\n return label;\n },\n callback: function callback() {\n var _this2 = this;\n\n var range = this.getSelectedRange();\n var atLeastOneReadOnly = (0, _utils.checkSelectionConsistency)(range, function (row, col) {\n return _this2.getCellMeta(row, col).readOnly;\n });\n\n range.forAll(function (row, col) {\n _this2.setCellMeta(row, col, 'readOnly', !atLeastOneReadOnly);\n });\n this.render();\n },\n disabled: function disabled() {\n return !(this.getSelectedRange() && !this.selection.selectedHeader.corner);\n }\n };\n}\n\n/***/ }),\n/* 228 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = redoItem;\nvar KEY = exports.KEY = 'redo';\n\nfunction redoItem() {\n return {\n key: KEY,\n name: 'Redo',\n\n callback: function callback() {\n this.redo();\n },\n disabled: function disabled() {\n return this.undoRedo && !this.undoRedo.isRedoAvailable();\n }\n };\n}\n\n/***/ }),\n/* 229 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = removeColumnItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'remove_col';\n\nfunction removeColumnItem() {\n return {\n key: KEY,\n name: 'Remove column',\n\n callback: function callback(key, selection) {\n var amount = selection.end.col - selection.start.col + 1;\n\n this.alter('remove_col', selection.start.col, amount, 'ContextMenu.removeColumn');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n var totalColumns = this.countCols();\n\n return !selected || this.selection.selectedHeader.rows || this.selection.selectedHeader.corner || !this.isColumnModificationAllowed() || !totalColumns;\n },\n hidden: function hidden() {\n return !this.getSettings().allowRemoveColumn;\n }\n };\n}\n\n/***/ }),\n/* 230 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = removeRowItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'remove_row';\n\nfunction removeRowItem() {\n return {\n key: KEY,\n name: 'Remove row',\n\n callback: function callback(key, selection) {\n var amount = selection.end.row - selection.start.row + 1;\n\n this.alter('remove_row', selection.start.row, amount, 'ContextMenu.removeRow');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n var totalRows = this.countRows();\n\n return !selected || this.selection.selectedHeader.cols || this.selection.selectedHeader.corner || !totalRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowRemoveRow;\n }\n };\n}\n\n/***/ }),\n/* 231 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = rowAboveItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'row_above';\n\nfunction rowAboveItem() {\n return {\n key: KEY,\n name: 'Insert row above',\n\n callback: function callback(key, selection) {\n this.alter('insert_row', selection.start.row, 1, 'ContextMenu.rowAbove');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n return !selected || this.selection.selectedHeader.cols || this.countRows() >= this.getSettings().maxRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n/***/ }),\n/* 232 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.KEY = undefined;\nexports.default = rowBelowItem;\n\nvar _utils = __webpack_require__(17);\n\nvar KEY = exports.KEY = 'row_below';\n\nfunction rowBelowItem() {\n return {\n key: KEY,\n name: 'Insert row below',\n\n callback: function callback(key, selection) {\n this.alter('insert_row', selection.end.row + 1, 1, 'ContextMenu.rowBelow');\n },\n disabled: function disabled() {\n var selected = (0, _utils.getValidSelection)(this);\n\n return !selected || this.selection.selectedHeader.cols || this.countRows() >= this.getSettings().maxRows;\n },\n hidden: function hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n/***/ }),\n/* 233 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = undoItem;\nvar KEY = exports.KEY = 'undo';\n\nfunction undoItem() {\n return {\n key: KEY,\n name: 'Undo',\n\n callback: function callback() {\n this.undo();\n },\n disabled: function disabled() {\n return this.undoRedo && !this.undoRedo.isUndoAvailable();\n }\n };\n}\n\n/***/ }),\n/* 234 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _zeroclipboard = __webpack_require__(300);\n\nvar _zeroclipboard2 = _interopRequireDefault(_zeroclipboard);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _predefinedItems = __webpack_require__(50);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @description\n * This plugin adds a copy/paste functionality to the context menu. Due to browser restrictions, it uses ZeroClipboard to allow\n * copying data with a click.\n *\n * @plugin ContextMenuCopyPaste\n * @dependencies ContextMenu\n */\nvar ContextMenuCopyPaste = function (_BasePlugin) {\n _inherits(ContextMenuCopyPaste, _BasePlugin);\n\n /**\n * @param {Object} hotInstance\n */\n function ContextMenuCopyPaste(hotInstance) {\n _classCallCheck(this, ContextMenuCopyPaste);\n\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n var _this = _possibleConstructorReturn(this, (ContextMenuCopyPaste.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste)).call(this, hotInstance));\n\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Path to swf file which is necessary for ZeroClipboard.\n *\n * @type {String}\n */\n _this.swfPath = null;\n /**\n * outsideClickDeselectsCache setting cache.\n *\n * @type {Boolean}\n */\n _this.outsideClickDeselectsCache = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ContextMenuCopyPaste, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().contextMenuCopyPaste;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n if (_typeof(this.hot.getSettings().contextMenuCopyPaste) === 'object') {\n this.swfPath = this.hot.getSettings().contextMenuCopyPaste.swfPath;\n }\n if (typeof _zeroclipboard2.default === 'undefined') {\n console.error('To be able to use the Copy/Paste feature from the context menu, you need to manually include ZeroClipboard.js file to your website.');\n }\n try {\n /* eslint-disable no-new */\n new ActiveXObject('ShockwaveFlash.ShockwaveFlash');\n } catch (exception) {\n if (typeof navigator.mimeTypes['application/x-shockwave-flash'] == 'undefined') {\n console.error('To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.');\n }\n }\n if (this.swfPath) {\n _zeroclipboard2.default.config({\n swfPath: this.swfPath\n });\n }\n this.hot.addHook('afterContextMenuShow', function () {\n return _this2.onAfterContextMenuShow();\n });\n this.hot.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.onAfterContextMenuDefaultOptions(options);\n });\n this.registerEvents();\n _get(ContextMenuCopyPaste.prototype.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ContextMenuCopyPaste.prototype.__proto__ || Object.getPrototypeOf(ContextMenuCopyPaste.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.eventManager.addEventListener(document, 'mouseenter', function () {\n return _this3.removeCurrentClass();\n });\n this.eventManager.addEventListener(document, 'mouseleave', function () {\n return _this3.removeZeroClipboardClass();\n });\n }\n\n /**\n * Get a value to copy.\n *\n * @returns {String}\n */\n\n }, {\n key: 'getCopyValue',\n value: function getCopyValue() {\n this.hot.copyPaste.setCopyableText();\n this.hot.copyPaste.copyPasteInstance.triggerCopy();\n return this.hot.copyPaste.copyPasteInstance.elTextarea.value;\n }\n\n /**\n * Add Copy and Paste functionality to the context menu.\n *\n * @private\n * @param {Object} defaultOptions\n */\n\n }, {\n key: 'onAfterContextMenuDefaultOptions',\n value: function onAfterContextMenuDefaultOptions(defaultOptions) {\n defaultOptions.items.unshift({\n key: 'copy',\n name: 'Copy',\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n }, {\n key: 'paste',\n name: 'Paste',\n callback: function callback() {\n this.copyPaste.triggerPaste();\n },\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n }, { name: _predefinedItems.SEPARATOR });\n }\n\n /**\n * After context menu show listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterContextMenuShow',\n value: function onAfterContextMenuShow() {\n var _this4 = this;\n\n var contextMenu = this.hot.getPlugin('contextMenu');\n var data = contextMenu.menu.hotMenu.getSourceData();\n\n // find position of 'copy' option.\n (0, _array.arrayEach)(data, function (item, index) {\n if (item.key === 'copy') {\n var zeroClipboardInstance = new _zeroclipboard2.default(contextMenu.menu.hotMenu.getCell(index, 0));\n\n zeroClipboardInstance.off();\n zeroClipboardInstance.on('copy', function (event) {\n var clipboard = event.clipboardData;\n\n clipboard.setData('text/plain', _this4.getCopyValue());\n _this4.hot.getSettings().outsideClickDeselects = _this4.outsideClickDeselectsCache;\n });\n\n return false;\n }\n });\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'removeCurrentClass',\n value: function removeCurrentClass() {\n var contextMenu = this.hot.getPlugin('contextMenu');\n\n if (!contextMenu.enabled) {\n return;\n }\n if (contextMenu.menu.isOpened()) {\n var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.current');\n\n if (element) {\n (0, _element.removeClass)(element, 'current');\n }\n }\n this.outsideClickDeselectsCache = this.hot.getSettings().outsideClickDeselects;\n this.hot.getSettings().outsideClickDeselects = false;\n }\n\n /**\n * @private\n */\n\n }, {\n key: 'removeZeroClipboardClass',\n value: function removeZeroClipboardClass() {\n var contextMenu = this.hot.getPlugin('contextMenu');\n\n if (!contextMenu.enabled) {\n return;\n }\n if (contextMenu.menu.isOpened()) {\n var element = contextMenu.menu.hotMenu.rootElement.querySelector('td.zeroclipboard-is-hover');\n\n if (element) {\n (0, _element.removeClass)(element, 'zeroclipboard-is-hover');\n }\n }\n this.hot.getSettings().outsideClickDeselects = this.outsideClickDeselectsCache;\n }\n }]);\n\n return ContextMenuCopyPaste;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('contextMenuCopyPaste', ContextMenuCopyPaste);\n\nexports.default = ContextMenuCopyPaste;\n\n/***/ }),\n/* 235 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _copyPaste = __webpack_require__(184);\n\nvar _copyPaste2 = _interopRequireDefault(_copyPaste);\n\nvar _SheetClip = __webpack_require__(132);\n\nvar _SheetClip2 = _interopRequireDefault(_SheetClip);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _unicode = __webpack_require__(16);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _event = __webpack_require__(7);\n\nvar _element = __webpack_require__(0);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_pluginHooks2.default.getSingleton().register('afterCopyLimit');\n_pluginHooks2.default.getSingleton().register('modifyCopyableRange');\n_pluginHooks2.default.getSingleton().register('beforeCut');\n_pluginHooks2.default.getSingleton().register('afterCut');\n_pluginHooks2.default.getSingleton().register('beforePaste');\n_pluginHooks2.default.getSingleton().register('afterPaste');\n_pluginHooks2.default.getSingleton().register('beforeCopy');\n_pluginHooks2.default.getSingleton().register('afterCopy');\n\n/**\n * @description\n * This plugin enables the copy/paste functionality in Handsontable.\n *\n * @example\n * ```js\n * ...\n * copyPaste: true,\n * ...\n * ```\n * @class CopyPaste\n * @plugin CopyPaste\n */\nfunction CopyPastePlugin(instance) {\n var _this = this;\n\n this.copyPasteInstance = (0, _copyPaste2.default)();\n this.copyPasteInstance.onCut(onCut);\n this.copyPasteInstance.triggerCopy = callCopyAction;\n this.copyPasteInstance.onPaste(onPaste);\n this.onPaste = onPaste; // for paste testing purposes\n this.copyableRanges = [];\n\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n\n function onCut() {\n instance.isListening();\n }\n\n function callCutAction() {\n var rangedData = _this.getRangedData(_this.copyableRanges);\n\n if (instance.getSettings().fragmentSelection && _SheetClip2.default.stringify(rangedData) != (0, _element.getSelectionText)()) {\n return;\n }\n\n var allowCuttingOut = !!instance.runHooks('beforeCut', rangedData, _this.copyableRanges);\n\n if (allowCuttingOut) {\n instance.copyPaste.copyPasteInstance.copyable(_SheetClip2.default.stringify(rangedData));\n instance.selection.empty();\n instance.runHooks('afterCut', rangedData, _this.copyableRanges);\n } else {\n instance.copyPaste.copyPasteInstance.copyable('');\n }\n }\n\n function callCopyAction() {\n if (!instance.isListening()) {\n return;\n }\n\n var rangedData = _this.getRangedData(_this.copyableRanges);\n\n if (instance.getSettings().fragmentSelection && _SheetClip2.default.stringify(rangedData) != (0, _element.getSelectionText)()) {\n return;\n }\n\n var allowCopying = !!instance.runHooks('beforeCopy', rangedData, _this.copyableRanges);\n\n if (allowCopying) {\n instance.copyPaste.copyPasteInstance.copyable(_SheetClip2.default.stringify(rangedData));\n instance.runHooks('afterCopy', rangedData, _this.copyableRanges);\n } else {\n instance.copyPaste.copyPasteInstance.copyable('');\n }\n }\n\n function onPaste(str) {\n var input, inputArray, selected, coordsFrom, coordsTo, cellRange, topLeftCorner, bottomRightCorner, areaStart, areaEnd;\n\n if (!instance.isListening() || !instance.selection.isSelected()) {\n return;\n }\n input = str;\n inputArray = _SheetClip2.default.parse(input);\n selected = instance.getSelected();\n coordsFrom = new _src.CellCoords(selected[0], selected[1]);\n coordsTo = new _src.CellCoords(selected[2], selected[3]);\n cellRange = new _src.CellRange(coordsFrom, coordsFrom, coordsTo);\n topLeftCorner = cellRange.getTopLeftCorner();\n bottomRightCorner = cellRange.getBottomRightCorner();\n areaStart = topLeftCorner;\n areaEnd = new _src.CellCoords(Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row), Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));\n\n var isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1;\n var isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1;\n\n instance.addHookOnce('afterChange', function (changes, source) {\n var changesLength = changes ? changes.length : 0;\n\n if (changesLength) {\n var offset = { row: 0, col: 0 };\n var highestColumnIndex = -1;\n\n (0, _array.arrayEach)(changes, function (change, index) {\n var nextChange = changesLength > index + 1 ? changes[index + 1] : null;\n\n if (nextChange) {\n if (!isSelRowAreaCoverInputValue) {\n offset.row += Math.max(nextChange[0] - change[0] - 1, 0);\n }\n if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) {\n highestColumnIndex = change[1];\n offset.col += Math.max(nextChange[1] - change[1] - 1, 0);\n }\n }\n });\n instance.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col);\n }\n });\n\n var allowPasting = !!instance.runHooks('beforePaste', inputArray, _this.copyableRanges);\n\n if (allowPasting) {\n instance.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'CopyPaste.paste', instance.getSettings().pasteMode);\n instance.runHooks('afterPaste', inputArray, _this.copyableRanges);\n }\n }\n\n function onBeforeKeyDown(event) {\n if (!instance.getSelected()) {\n return;\n }\n if (instance.getActiveEditor() && instance.getActiveEditor().isOpened()) {\n return;\n }\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n if ((0, _unicode.isCtrlKey)(event.keyCode)) {\n // When fragmentSelection is enabled and some text is selected then don't blur selection calling 'setCopyableText'\n if (instance.getSettings().fragmentSelection && (0, _element.getSelectionText)()) {\n return;\n }\n // when CTRL is pressed, prepare selectable text in textarea\n _this.setCopyableText();\n (0, _event.stopImmediatePropagation)(event);\n\n return;\n }\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode == _unicode.KEY_CODES.A) {\n instance._registerTimeout(setTimeout(_this.setCopyableText.bind(_this), 0));\n }\n if (event.keyCode == _unicode.KEY_CODES.X) {\n callCutAction();\n }\n if (event.keyCode == _unicode.KEY_CODES.C) {\n callCopyAction();\n }\n }\n }\n\n /**\n * Destroy plugin instance.\n *\n * @function destroy\n * @memberof CopyPaste#\n */\n this.destroy = function () {\n if (this.copyPasteInstance) {\n this.copyPasteInstance.removeCallback(onCut);\n this.copyPasteInstance.removeCallback(onPaste);\n this.copyPasteInstance.destroy();\n this.copyPasteInstance = null;\n }\n instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n };\n\n instance.addHook('afterDestroy', this.destroy.bind(this));\n\n /**\n * @function triggerPaste\n * @memberof CopyPaste#\n */\n this.triggerPaste = this.copyPasteInstance.triggerPaste.bind(this.copyPasteInstance);\n\n /**\n * @function triggerCut\n * @memberof CopyPaste#\n */\n this.triggerCut = this.copyPasteInstance.triggerCut.bind(this.copyPasteInstance);\n\n /**\n * Prepares copyable text in the invisible textarea.\n *\n * @function setCopyable\n * @memberof CopyPaste#\n */\n this.setCopyableText = function () {\n var settings = instance.getSettings();\n var copyRowsLimit = settings.copyRowsLimit;\n var copyColsLimit = settings.copyColsLimit;\n\n var selRange = instance.getSelectedRange();\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n var startRow = topLeft.row;\n var startCol = topLeft.col;\n var endRow = bottomRight.row;\n var endCol = bottomRight.col;\n var finalEndRow = Math.min(endRow, startRow + copyRowsLimit - 1);\n var finalEndCol = Math.min(endCol, startCol + copyColsLimit - 1);\n\n this.copyableRanges.length = 0;\n\n this.copyableRanges.push({\n startRow: startRow,\n startCol: startCol,\n endRow: finalEndRow,\n endCol: finalEndCol\n });\n\n this.copyableRanges = instance.runHooks('modifyCopyableRange', this.copyableRanges);\n\n var copyableData = this.getRangedCopyableData(this.copyableRanges);\n\n instance.copyPaste.copyPasteInstance.copyable(copyableData);\n\n if (endRow !== finalEndRow || endCol !== finalEndCol) {\n instance.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, copyRowsLimit, copyColsLimit);\n }\n };\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.19.0\n * @param {Array} ranges Array of Objects with properties `startRow`, `endRow`, `startCol` and `endCol`.\n * @returns {String} Returns string which will be copied into clipboard.\n */\n this.getRangedCopyableData = function (ranges) {\n var dataSet = [];\n var copyableRows = [];\n var copyableColumns = [];\n\n // Count all copyable rows and columns\n (0, _array.arrayEach)(ranges, function (range) {\n (0, _number.rangeEach)(range.startRow, range.endRow, function (row) {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n (0, _number.rangeEach)(range.startCol, range.endCol, function (column) {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n (0, _array.arrayEach)(copyableRows, function (row) {\n var rowSet = [];\n\n (0, _array.arrayEach)(copyableColumns, function (column) {\n rowSet.push(instance.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return _SheetClip2.default.stringify(dataSet);\n };\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.31.1\n * @param {Array} ranges Array of Objects with properties `startRow`, `startCol`, `endRow` and `endCol`.\n * @returns {Array} Returns array of arrays which will be copied into clipboard.\n */\n this.getRangedData = function (ranges) {\n var dataSet = [];\n var copyableRows = [];\n var copyableColumns = [];\n\n // Count all copyable rows and columns\n (0, _array.arrayEach)(ranges, function (range) {\n (0, _number.rangeEach)(range.startRow, range.endRow, function (row) {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n (0, _number.rangeEach)(range.startCol, range.endCol, function (column) {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n (0, _array.arrayEach)(copyableRows, function (row) {\n var rowSet = [];\n\n (0, _array.arrayEach)(copyableColumns, function (column) {\n rowSet.push(instance.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return dataSet;\n };\n}\n\n/**\n * Init plugin.\n *\n * @function init\n * @memberof CopyPaste#\n */\nfunction init() {\n var instance = this,\n pluginEnabled = instance.getSettings().copyPaste !== false;\n\n if (pluginEnabled && !instance.copyPaste) {\n /**\n * Instance of CopyPaste Plugin {@link Handsontable.CopyPaste}\n *\n * @alias copyPaste\n * @memberof! Handsontable.Core#\n * @type {CopyPaste}\n */\n instance.copyPaste = new CopyPastePlugin(instance);\n } else if (!pluginEnabled && instance.copyPaste) {\n instance.copyPaste.destroy();\n instance.copyPaste = null;\n }\n}\n\n_pluginHooks2.default.getSingleton().add('afterInit', init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', init);\n\nexports.default = CopyPastePlugin;\n\n/***/ }),\n/* 236 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _object = __webpack_require__(2);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction CustomBorders() {}\n/** *\n * Current instance (table where borders should be placed)\n */\nvar instance;\n\n/**\n * This plugin enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for more examples.\n *\n * @example\n * ```js\n * ...\n * customBorders: [\n * {range: {\n * from: {row: 1, col: 1},\n * to: {row: 3, col: 4}},\n * left: {},\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * {row: 2, col: 2, left: {width: 2, color: 'red'},\n * right: {width: 1, color: 'green'}, top: '', bottom: ''}\n * ],\n * ...\n * ```\n * @private\n * @class CustomBorders\n * @plugin CustomBorders\n */\n\n/** *\n * Check if plugin should be enabled.\n */\nvar checkEnable = function checkEnable(customBorders) {\n if (typeof customBorders === 'boolean') {\n if (customBorders === true) {\n return true;\n }\n }\n if ((typeof customBorders === 'undefined' ? 'undefined' : _typeof(customBorders)) === 'object') {\n if (customBorders.length > 0) {\n return true;\n }\n }\n\n return false;\n};\n\n/** *\n * Initialize plugin.\n */\nvar init = function init() {\n if (checkEnable(this.getSettings().customBorders)) {\n if (!this.customBorders) {\n instance = this;\n this.customBorders = new CustomBorders();\n }\n }\n};\n\n/** *\n * Get index of border from the settings.\n *\n * @param {String} className\n * @returns {Number}\n */\nvar getSettingIndex = function getSettingIndex(className) {\n for (var i = 0; i < instance.view.wt.selections.length; i++) {\n if (instance.view.wt.selections[i].settings.className == className) {\n return i;\n }\n }\n\n return -1;\n};\n\n/** *\n * Insert WalkontableSelection instance into Walkontable settings.\n *\n * @param border\n */\nvar insertBorderIntoSettings = function insertBorderIntoSettings(border) {\n var coordinates = {\n row: border.row,\n col: border.col\n };\n var selection = new _src.Selection(border, new _src.CellRange(coordinates, coordinates, coordinates));\n var index = getSettingIndex(border.className);\n\n if (index >= 0) {\n instance.view.wt.selections[index] = selection;\n } else {\n instance.view.wt.selections.push(selection);\n }\n};\n\n/** *\n * Prepare borders from setting (single cell).\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param borderObj\n */\nvar prepareBorderFromCustomAdded = function prepareBorderFromCustomAdded(row, col, borderObj) {\n var border = createEmptyBorders(row, col);\n border = extendDefaultBorder(border, borderObj);\n this.setCellMeta(row, col, 'borders', border);\n\n insertBorderIntoSettings(border);\n};\n\n/** *\n * Prepare borders from setting (object).\n *\n * @param {Object} rowObj\n */\nvar prepareBorderFromCustomAddedRange = function prepareBorderFromCustomAddedRange(rowObj) {\n var range = rowObj.range;\n\n for (var row = range.from.row; row <= range.to.row; row++) {\n for (var col = range.from.col; col <= range.to.col; col++) {\n var border = createEmptyBorders(row, col);\n var add = 0;\n\n if (row == range.from.row) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'top')) {\n border.top = rowObj.top;\n }\n }\n\n if (row == range.to.row) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'bottom')) {\n border.bottom = rowObj.bottom;\n }\n }\n\n if (col == range.from.col) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'left')) {\n border.left = rowObj.left;\n }\n }\n\n if (col == range.to.col) {\n add++;\n\n if ((0, _object.hasOwnProperty)(rowObj, 'right')) {\n border.right = rowObj.right;\n }\n }\n\n if (add > 0) {\n this.setCellMeta(row, col, 'borders', border);\n insertBorderIntoSettings(border);\n }\n }\n }\n};\n\n/** *\n * Create separated class name for borders for each cell.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {String}\n */\nvar createClassName = function createClassName(row, col) {\n return 'border_row' + row + 'col' + col;\n};\n\n/** *\n * Create default single border for each position (top/right/bottom/left).\n *\n * @returns {Object} `{{width: number, color: string}}`\n */\nvar createDefaultCustomBorder = function createDefaultCustomBorder() {\n return {\n width: 1,\n color: '#000'\n };\n};\n\n/** *\n * Create default object for empty border.\n *\n * @returns {Object} `{{hide: boolean}}`\n */\nvar createSingleEmptyBorder = function createSingleEmptyBorder() {\n return {\n hide: true\n };\n};\n\n/** *\n * Create default Handsontable border object.\n *\n * @returns {Object} `{{width: number, color: string, cornerVisible: boolean}}`\n */\nvar createDefaultHtBorder = function createDefaultHtBorder() {\n return {\n width: 1,\n color: '#000',\n cornerVisible: false\n };\n};\n\n/** *\n * Prepare empty border for each cell with all custom borders hidden.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @returns {Object} `{{className: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}`\n */\nvar createEmptyBorders = function createEmptyBorders(row, col) {\n return {\n className: createClassName(row, col),\n border: createDefaultHtBorder(),\n row: row,\n col: col,\n top: createSingleEmptyBorder(),\n right: createSingleEmptyBorder(),\n bottom: createSingleEmptyBorder(),\n left: createSingleEmptyBorder()\n };\n};\n\nvar extendDefaultBorder = function extendDefaultBorder(defaultBorder, customBorder) {\n if ((0, _object.hasOwnProperty)(customBorder, 'border')) {\n defaultBorder.border = customBorder.border;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'top')) {\n defaultBorder.top = customBorder.top;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'right')) {\n defaultBorder.right = customBorder.right;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'bottom')) {\n defaultBorder.bottom = customBorder.bottom;\n }\n\n if ((0, _object.hasOwnProperty)(customBorder, 'left')) {\n defaultBorder.left = customBorder.left;\n }\n\n return defaultBorder;\n};\n\n/**\n * Remove borders divs from DOM.\n *\n * @param borderClassName\n */\nvar removeBordersFromDom = function removeBordersFromDom(borderClassName) {\n var borders = document.querySelectorAll('.' + borderClassName);\n\n for (var i = 0; i < borders.length; i++) {\n if (borders[i]) {\n if (borders[i].nodeName != 'TD') {\n var parent = borders[i].parentNode;\n\n if (parent.parentNode) {\n parent.parentNode.removeChild(parent);\n }\n }\n }\n }\n};\n\n/** *\n * Remove border (triggered from context menu).\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\nvar removeAllBorders = function removeAllBorders(row, col) {\n var borderClassName = createClassName(row, col);\n removeBordersFromDom(borderClassName);\n this.removeCellMeta(row, col, 'borders');\n};\n\n/** *\n * Set borders for each cell re. to border position\n *\n * @param row\n * @param col\n * @param place\n * @param remove\n */\nvar setBorder = function setBorder(row, col, place, remove) {\n\n var bordersMeta = this.getCellMeta(row, col).borders;\n\n if (!bordersMeta || bordersMeta.border == undefined) {\n bordersMeta = createEmptyBorders(row, col);\n }\n\n if (remove) {\n bordersMeta[place] = createSingleEmptyBorder();\n } else {\n bordersMeta[place] = createDefaultCustomBorder();\n }\n\n this.setCellMeta(row, col, 'borders', bordersMeta);\n\n var borderClassName = createClassName(row, col);\n removeBordersFromDom(borderClassName);\n insertBorderIntoSettings(bordersMeta);\n\n this.render();\n};\n\n/** *\n * Prepare borders based on cell and border position\n *\n * @param range\n * @param place\n * @param remove\n */\nvar prepareBorder = function prepareBorder(range, place, remove) {\n\n if (range.from.row == range.to.row && range.from.col == range.to.col) {\n if (place == 'noBorders') {\n removeAllBorders.call(this, range.from.row, range.from.col);\n } else {\n setBorder.call(this, range.from.row, range.from.col, place, remove);\n }\n } else {\n switch (place) {\n case 'noBorders':\n for (var column = range.from.col; column <= range.to.col; column++) {\n for (var row = range.from.row; row <= range.to.row; row++) {\n removeAllBorders.call(this, row, column);\n }\n }\n break;\n case 'top':\n for (var topCol = range.from.col; topCol <= range.to.col; topCol++) {\n setBorder.call(this, range.from.row, topCol, place, remove);\n }\n break;\n case 'right':\n for (var rowRight = range.from.row; rowRight <= range.to.row; rowRight++) {\n setBorder.call(this, rowRight, range.to.col, place);\n }\n break;\n case 'bottom':\n for (var bottomCol = range.from.col; bottomCol <= range.to.col; bottomCol++) {\n setBorder.call(this, range.to.row, bottomCol, place);\n }\n break;\n case 'left':\n for (var rowLeft = range.from.row; rowLeft <= range.to.row; rowLeft++) {\n setBorder.call(this, rowLeft, range.from.col, place);\n }\n break;\n default:\n break;\n }\n }\n};\n\n/** *\n * Check if selection has border by className\n *\n * @param hot\n * @param direction\n */\nvar checkSelectionBorders = function checkSelectionBorders(hot, direction) {\n var atLeastOneHasBorder = false;\n\n hot.getSelectedRange().forAll(function (r, c) {\n var metaBorders = hot.getCellMeta(r, c).borders;\n\n if (metaBorders) {\n if (direction) {\n if (!(0, _object.hasOwnProperty)(metaBorders[direction], 'hide')) {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n } else {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n }\n });\n return atLeastOneHasBorder;\n};\n\n/** *\n * Mark label in contextMenu as selected\n *\n * @param label\n * @returns {string}\n */\nvar markSelected = function markSelected(label) {\n return '<span class=\"selected\">' + String.fromCharCode(10003) + '</span>' + label; // workaround for https://github.com/handsontable/handsontable/issues/1946\n};\n\n/** *\n * Add border options to context menu\n *\n * @param defaultOptions\n */\nvar addBordersOptionsToContextMenu = function addBordersOptionsToContextMenu(defaultOptions) {\n if (!this.getSettings().customBorders) {\n return;\n }\n\n defaultOptions.items.push({\n name: '---------'\n });\n defaultOptions.items.push({\n key: 'borders',\n name: 'Borders',\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n },\n\n submenu: {\n items: [{\n key: 'borders:top',\n name: function name() {\n var label = 'Top';\n var hasBorder = checkSelectionBorders(this, 'top');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'top');\n prepareBorder.call(this, this.getSelectedRange(), 'top', hasBorder);\n }\n }, {\n key: 'borders:right',\n name: function name() {\n var label = 'Right';\n var hasBorder = checkSelectionBorders(this, 'right');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'right');\n prepareBorder.call(this, this.getSelectedRange(), 'right', hasBorder);\n }\n }, {\n key: 'borders:bottom',\n name: function name() {\n var label = 'Bottom';\n var hasBorder = checkSelectionBorders(this, 'bottom');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'bottom');\n prepareBorder.call(this, this.getSelectedRange(), 'bottom', hasBorder);\n }\n }, {\n key: 'borders:left',\n name: function name() {\n var label = 'Left';\n var hasBorder = checkSelectionBorders(this, 'left');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback: function callback() {\n var hasBorder = checkSelectionBorders(this, 'left');\n prepareBorder.call(this, this.getSelectedRange(), 'left', hasBorder);\n }\n }, {\n key: 'borders:no_borders',\n name: 'Remove border(s)',\n callback: function callback() {\n prepareBorder.call(this, this.getSelectedRange(), 'noBorders');\n },\n disabled: function disabled() {\n return !checkSelectionBorders(this);\n }\n }]\n }\n });\n};\n\n_pluginHooks2.default.getSingleton().add('beforeInit', init);\n_pluginHooks2.default.getSingleton().add('afterContextMenuDefaultOptions', addBordersOptionsToContextMenu);\n_pluginHooks2.default.getSingleton().add('afterInit', function () {\n var customBorders = this.getSettings().customBorders;\n\n if (customBorders) {\n for (var i = 0; i < customBorders.length; i++) {\n if (customBorders[i].range) {\n prepareBorderFromCustomAddedRange.call(this, customBorders[i]);\n } else {\n prepareBorderFromCustomAdded.call(this, customBorders[i].row, customBorders[i].col, customBorders[i]);\n }\n }\n\n this.render();\n this.view.wt.draw(true);\n }\n});\n\n/***/ }),\n/* 237 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @description\n * Plugin used to scroll Handsontable by selecting a cell and dragging outside of the visible viewport.\n *\n * @private\n * @class DragToScroll\n * @plugin DragToScroll\n */\nfunction DragToScroll() {\n this.boundaries = null;\n this.callback = null;\n}\n\n/**\n * @param boundaries {Object} compatible with getBoundingClientRect\n */\nDragToScroll.prototype.setBoundaries = function (boundaries) {\n this.boundaries = boundaries;\n};\n\n/**\n * @param callback {Function}\n */\nDragToScroll.prototype.setCallback = function (callback) {\n this.callback = callback;\n};\n\n/**\n * Check if mouse position (x, y) is outside of the viewport\n * @param x\n * @param y\n */\nDragToScroll.prototype.check = function (x, y) {\n var diffX = 0;\n var diffY = 0;\n\n if (y < this.boundaries.top) {\n // y is less than top\n diffY = y - this.boundaries.top;\n } else if (y > this.boundaries.bottom) {\n // y is more than bottom\n diffY = y - this.boundaries.bottom;\n }\n\n if (x < this.boundaries.left) {\n // x is less than left\n diffX = x - this.boundaries.left;\n } else if (x > this.boundaries.right) {\n // x is more than right\n diffX = x - this.boundaries.right;\n }\n\n this.callback(diffX, diffY);\n};\n\nvar dragToScroll;\nvar instance;\n\nvar setupListening = function setupListening(instance) {\n instance.dragToScrollListening = false;\n var scrollHandler = instance.view.wt.wtTable.holder; // native scroll\n dragToScroll = new DragToScroll();\n\n if (scrollHandler === window) {\n // not much we can do currently\n return;\n }\n\n dragToScroll.setBoundaries(scrollHandler.getBoundingClientRect());\n dragToScroll.setCallback(function (scrollX, scrollY) {\n if (scrollX < 0) {\n scrollHandler.scrollLeft -= 50;\n } else if (scrollX > 0) {\n scrollHandler.scrollLeft += 50;\n }\n\n if (scrollY < 0) {\n scrollHandler.scrollTop -= 20;\n } else if (scrollY > 0) {\n scrollHandler.scrollTop += 20;\n }\n });\n\n instance.dragToScrollListening = true;\n};\n\n_pluginHooks2.default.getSingleton().add('afterInit', function () {\n var instance = this;\n var eventManager = new _eventManager2.default(this);\n\n eventManager.addEventListener(document, 'mouseup', function () {\n instance.dragToScrollListening = false;\n });\n\n eventManager.addEventListener(document, 'mousemove', function (event) {\n if (instance.dragToScrollListening) {\n dragToScroll.check(event.clientX, event.clientY);\n }\n });\n});\n\n_pluginHooks2.default.getSingleton().add('afterDestroy', function () {\n new _eventManager2.default(this).clear();\n});\n\n_pluginHooks2.default.getSingleton().add('afterOnCellMouseDown', function () {\n setupListening(this);\n});\n\n_pluginHooks2.default.getSingleton().add('afterOnCellCornerMouseDown', function () {\n setupListening(this);\n});\n\nexports.default = DragToScroll;\n\n/***/ }),\n/* 238 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = freezeColumnItem;\nfunction freezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'freeze_column',\n name: 'Freeze this column',\n callback: function callback() {\n var selectedColumn = this.getSelectedRange().from.col;\n\n manualColumnFreezePlugin.freezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden: function hidden() {\n var selection = this.getSelectedRange();\n var hide = false;\n\n if (selection === void 0) {\n hide = true;\n } else if (selection.from.col !== selection.to.col || selection.from.col <= this.getSettings().fixedColumnsLeft - 1) {\n hide = true;\n }\n\n return hide;\n }\n };\n}\n\n/***/ }),\n/* 239 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = unfreezeColumnItem;\nfunction unfreezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'unfreeze_column',\n name: 'Unfreeze this column',\n callback: function callback() {\n var selectedColumn = this.getSelectedRange().from.col;\n\n manualColumnFreezePlugin.unfreezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden: function hidden() {\n var selection = this.getSelectedRange();\n var hide = false;\n\n if (selection === void 0) {\n hide = true;\n } else if (selection.from.col !== selection.to.col || selection.from.col >= this.getSettings().fixedColumnsLeft) {\n hide = true;\n }\n\n return hide;\n }\n };\n}\n\n/***/ }),\n/* 240 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _array = __webpack_require__(1);\n\nvar _freezeColumn = __webpack_require__(238);\n\nvar _freezeColumn2 = _interopRequireDefault(_freezeColumn);\n\nvar _unfreezeColumn = __webpack_require__(239);\n\nvar _unfreezeColumn2 = _interopRequireDefault(_unfreezeColumn);\n\n__webpack_require__(296);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar privatePool = new WeakMap();\n/**\n * This plugin allows to manually \"freeze\" and \"unfreeze\" a column using an entry in the Context Menu.\n * You can turn it on by setting a `manualColumnFreeze` property to `true`.\n *\n * @plugin ManualColumnFreeze\n * @dependencies ManualColumnMove\n */\n\nvar ManualColumnFreeze = function (_BasePlugin) {\n _inherits(ManualColumnFreeze, _BasePlugin);\n\n function ManualColumnFreeze(hotInstance) {\n _classCallCheck(this, ManualColumnFreeze);\n\n var _this = _possibleConstructorReturn(this, (ManualColumnFreeze.__proto__ || Object.getPrototypeOf(ManualColumnFreeze)).call(this, hotInstance));\n\n privatePool.set(_this, {\n moveByFreeze: false,\n afterFirstUse: false\n });\n /**\n * Original column positions\n *\n * @type {Array}\n */\n _this.frozenColumnsBasePositions = [];\n /**\n * Reference to the `ManualColumnMove` plugin.\n */\n _this.manualColumnMovePlugin = void 0;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnFreeze, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualColumnFreeze;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterContextMenuDefaultOptions', function (options) {\n return _this2.addContextMenuEntry(options);\n });\n this.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n this.addHook('beforeColumnMove', function (rows, target) {\n return _this2.onBeforeColumnMove(rows, target);\n });\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var priv = privatePool.get(this);\n\n priv.afterFirstUse = false;\n priv.moveByFreeze = false;\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Freeze the given column (add it to fixed columns).\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'freezeColumn',\n value: function freezeColumn(column) {\n var priv = privatePool.get(this);\n var settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft === this.hot.countCols() || column <= settings.fixedColumnsLeft - 1) {\n return; // already fixed\n }\n\n priv.moveByFreeze = true;\n\n if (column !== this.getMovePlugin().columnsMapper.getValueByIndex(column)) {\n this.frozenColumnsBasePositions[settings.fixedColumnsLeft] = column;\n }\n\n this.getMovePlugin().moveColumn(column, settings.fixedColumnsLeft++);\n }\n\n /**\n * Unfreeze the given column (remove it from fixed columns and bring to it's previous position).\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'unfreezeColumn',\n value: function unfreezeColumn(column) {\n var priv = privatePool.get(this);\n var settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft <= 0 || column > settings.fixedColumnsLeft - 1) {\n return; // not fixed\n }\n\n var returnCol = this.getBestColumnReturnPosition(column);\n\n priv.moveByFreeze = true;\n settings.fixedColumnsLeft--;\n\n this.getMovePlugin().moveColumn(column, returnCol + 1);\n }\n\n /**\n * Get the reference to the ManualColumnMove plugin.\n *\n * @private\n * @returns {Object}\n */\n\n }, {\n key: 'getMovePlugin',\n value: function getMovePlugin() {\n if (!this.manualColumnMovePlugin) {\n this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove');\n }\n\n return this.manualColumnMovePlugin;\n }\n\n /**\n * Estimates the most fitting return position for unfrozen column.\n *\n * @private\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'getBestColumnReturnPosition',\n value: function getBestColumnReturnPosition(column) {\n var movePlugin = this.getMovePlugin();\n var settings = this.hot.getSettings();\n var i = settings.fixedColumnsLeft;\n var j = movePlugin.columnsMapper.getValueByIndex(i);\n var initialCol = void 0;\n\n if (this.frozenColumnsBasePositions[column] == null) {\n initialCol = movePlugin.columnsMapper.getValueByIndex(column);\n\n while (j < initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n } else {\n initialCol = this.frozenColumnsBasePositions[column];\n this.frozenColumnsBasePositions[column] = void 0;\n\n while (j <= initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n i = j;\n }\n\n return i - 1;\n }\n /**\n * Add the manualColumnFreeze context menu entries.\n *\n * @private\n * @param {Object} options Context menu options.\n */\n\n }, {\n key: 'addContextMenuEntry',\n value: function addContextMenuEntry(options) {\n options.items.push({ name: '---------' }, (0, _freezeColumn2.default)(this), (0, _unfreezeColumn2.default)(this));\n }\n\n /**\n * Enabling `manualColumnMove` plugin on `afterInit` hook.\n *\n * @private\n */\n\n }, {\n key: 'onAfterInit',\n value: function onAfterInit() {\n if (!this.getMovePlugin().isEnabled()) {\n this.getMovePlugin().enablePlugin();\n }\n }\n\n /**\n * Prevent moving the rows from/to fixed area.\n *\n * @private\n * @param {Array} rows\n * @param {Number} target\n */\n\n }, {\n key: 'onBeforeColumnMove',\n value: function onBeforeColumnMove(rows, target) {\n var priv = privatePool.get(this);\n\n if (priv.afterFirstUse && !priv.moveByFreeze) {\n var frozenLen = this.hot.getSettings().fixedColumnsLeft;\n var disallowMoving = target < frozenLen;\n\n if (!disallowMoving) {\n (0, _array.arrayEach)(rows, function (value, index, array) {\n if (value < frozenLen) {\n disallowMoving = true;\n return false;\n }\n });\n }\n\n if (disallowMoving) {\n return false;\n }\n }\n\n if (priv.moveByFreeze) {\n priv.moveByFreeze = false;\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _get(ManualColumnFreeze.prototype.__proto__ || Object.getPrototypeOf(ManualColumnFreeze.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualColumnFreeze;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualColumnFreeze', ManualColumnFreeze);\n\nexports.default = ManualColumnFreeze;\n\n/***/ }),\n/* 241 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _arrayMapper = __webpack_require__(149);\n\nvar _arrayMapper2 = _interopRequireDefault(_arrayMapper);\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class ColumnsMapper\n * @plugin ManualColumnMove\n */\nvar ColumnsMapper = function () {\n function ColumnsMapper(manualColumnMove) {\n _classCallCheck(this, ColumnsMapper);\n\n /**\n * Instance of ManualColumnMove plugin.\n *\n * @type {ManualColumnMove}\n */\n this.manualColumnMove = manualColumnMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n\n\n _createClass(ColumnsMapper, [{\n key: 'createMap',\n value: function createMap(length) {\n var _this = this;\n\n var originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n (0, _number.rangeEach)(originLength - 1, function (itemIndex) {\n _this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._arrayMap = null;\n }\n\n /**\n * Moving elements in columnsMapper.\n *\n * @param {Number} from Column index to move.\n * @param {Number} to Target index.\n */\n\n }, {\n key: 'moveColumn',\n value: function moveColumn(from, to) {\n var indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n\n }, {\n key: 'clearNull',\n value: function clearNull() {\n this._arrayMap = (0, _array.arrayFilter)(this._arrayMap, function (i) {\n return i !== null;\n });\n }\n }]);\n\n return ColumnsMapper;\n}();\n\n(0, _object.mixin)(ColumnsMapper, _arrayMapper2.default);\n\nexports.default = ColumnsMapper;\n\n/***/ }),\n/* 242 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _columnsMapper = __webpack_require__(241);\n\nvar _columnsMapper2 = _interopRequireDefault(_columnsMapper);\n\nvar _backlight = __webpack_require__(243);\n\nvar _backlight2 = _interopRequireDefault(_backlight);\n\nvar _guideline = __webpack_require__(244);\n\nvar _guideline2 = _interopRequireDefault(_guideline);\n\nvar _src = __webpack_require__(11);\n\n__webpack_require__(297);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeColumnMove');\n_pluginHooks2.default.getSingleton().register('afterColumnMove');\n_pluginHooks2.default.getSingleton().register('unmodifyCol');\n\nvar privatePool = new WeakMap();\nvar CSS_PLUGIN = 'ht__manualColumnMove';\nvar CSS_SHOW_UI = 'show-ui';\nvar CSS_ON_MOVING = 'on-moving--columns';\nvar CSS_AFTER_SELECTION = 'after-selection--columns';\n\n/**\n * @plugin ManualColumnMove\n *\n * @description\n * This plugin allows to change columns order.\n *\n * API:\n * - moveColumn - move single column to the new position.\n * - moveColumns - move many columns (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of Handsontable.\n *\n * UI components:\n * - backlight - highlight of selected columns.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualColumnMove\n * @plugin ManualColumnMove\n */\n\nvar ManualColumnMove = function (_BasePlugin) {\n _inherits(ManualColumnMove, _BasePlugin);\n\n function ManualColumnMove(hotInstance) {\n _classCallCheck(this, ManualColumnMove);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n var _this = _possibleConstructorReturn(this, (ManualColumnMove.__proto__ || Object.getPrototypeOf(ManualColumnMove)).call(this, hotInstance));\n\n privatePool.set(_this, {\n columnsToMove: [],\n countCols: 0,\n fixedColumns: 0,\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageX: void 0,\n coords: void 0,\n TD: void 0,\n col: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n _this.removedColumns = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n _this.columnsMapper = new _columnsMapper2.default(_this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n _this.backlight = new _backlight2.default(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n _this.guideline = new _guideline2.default(hotInstance);\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnMove, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualColumnMove;\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations);\n });\n this.addHook('afterScrollVertically', function () {\n return _this2.onAfterScrollVertically();\n });\n this.addHook('modifyCol', function (row, source) {\n return _this2.onModifyCol(row, source);\n });\n this.addHook('beforeRemoveCol', function (index, amount) {\n return _this2.onBeforeRemoveCol(index, amount);\n });\n this.addHook('afterRemoveCol', function (index, amount) {\n return _this2.onAfterRemoveCol(index, amount);\n });\n this.addHook('afterCreateCol', function (index, amount) {\n return _this2.onAfterCreateCol(index, amount);\n });\n this.addHook('afterLoadData', function (firstTime) {\n return _this2.onAfterLoadData(firstTime);\n });\n this.addHook('unmodifyCol', function (column) {\n return _this2.onUnmodifyCol(column);\n });\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n (0, _element.addClass)(this.hot.rootElement, CSS_PLUGIN);\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.columnsMapper.clearMap();\n }\n\n (0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Move a single column.\n *\n * @param {Number} column Visual column index to be moved.\n * @param {Number} target Visual column index being a target for the moved column.\n */\n\n }, {\n key: 'moveColumn',\n value: function moveColumn(column, target) {\n this.moveColumns([column], target);\n }\n\n /**\n * Move multiple columns.\n *\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for the moved columns.\n */\n\n }, {\n key: 'moveColumns',\n value: function moveColumns(columns, target) {\n var _this3 = this;\n\n var priv = privatePool.get(this);\n var beforeColumnHook = this.hot.runHooks('beforeColumnMove', columns, target);\n\n priv.disallowMoving = !beforeColumnHook;\n\n if (beforeColumnHook !== false) {\n // first we need to rewrite an visual indexes to logical for save reference after move\n (0, _array.arrayEach)(columns, function (column, index, array) {\n array[index] = _this3.columnsMapper.getValueByIndex(column);\n });\n\n // next, when we have got an logical indexes, we can move columns\n (0, _array.arrayEach)(columns, function (column, index) {\n var actualPosition = _this3.columnsMapper.getIndexByValue(column);\n\n if (actualPosition !== target) {\n _this3.columnsMapper.moveColumn(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear columnsMapper from null entries\n this.columnsMapper.clearNull();\n }\n\n this.hot.runHooks('afterColumnMove', columns, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the column order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startColumn Visual column index for the start of the selection.\n * @param {Number} endColumn Visual column index for the end of the selection.\n */\n\n }, {\n key: 'changeSelection',\n value: function changeSelection(startColumn, endColumn) {\n var selection = this.hot.selection;\n var lastRowIndex = this.hot.countRows() - 1;\n\n selection.setRangeStartOnly(new _src.CellCoords(0, startColumn));\n selection.setRangeEnd(new _src.CellCoords(lastRowIndex, endColumn), false);\n }\n\n /**\n * Get the sum of the widths of columns in the provided range.\n *\n * @private\n * @param {Number} from Visual column index.\n * @param {Number} to Visual column index.\n * @returns {Number}\n */\n\n }, {\n key: 'getColumnsWidth',\n value: function getColumnsWidth(from, to) {\n var width = 0;\n\n for (var i = from; i < to; i++) {\n var columnWidth = 0;\n\n if (i < 0) {\n columnWidth = this.hot.view.wt.wtTable.getColumnWidth(i) || 0;\n } else {\n columnWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(i) || 0;\n }\n\n width += columnWidth;\n }\n\n return width;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n\n }, {\n key: 'initialSettings',\n value: function initialSettings() {\n var pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveColumns(pluginSettings, 0);\n } else if (pluginSettings !== void 0) {\n this.persistentStateLoad();\n }\n }\n\n /**\n * Check if the provided column is in the fixedColumnsLeft section.\n *\n * @private\n * @param {Number} column Visual column index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedColumnsLeft',\n value: function isFixedColumnsLeft(column) {\n return column < this.hot.getSettings().fixedColumnsLeft;\n }\n\n /**\n * Save the manual column positions to the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateSave',\n value: function persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualColumnMove', this.columnsMapper._arrayMap);\n }\n\n /**\n * Load the manual column positions from the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateLoad',\n value: function persistentStateLoad() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnMove', storedState);\n\n if (storedState.value) {\n this.columnsMapper._arrayMap = storedState.value;\n }\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'prepareColumnsToMoving',\n value: function prepareColumnsToMoving(start, end) {\n var selectedColumns = [];\n\n (0, _number.rangeEach)(start, end, function (i) {\n selectedColumns.push(i);\n });\n\n return selectedColumns;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n\n }, {\n key: 'refreshPositions',\n value: function refreshPositions() {\n var priv = privatePool.get(this);\n var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleColumn();\n var lastVisible = this.hot.view.wt.wtTable.getLastVisibleColumn();\n var wtTable = this.hot.view.wt.wtTable;\n var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n var scrollLeft = typeof scrollableElement.scrollX === 'number' ? scrollableElement.scrollX : scrollableElement.scrollLeft;\n var tdOffsetLeft = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, priv.coordsColumn);\n var mouseOffsetLeft = priv.target.eventPageX - (priv.rootElementOffset - (scrollableElement.scrollX === void 0 ? scrollLeft : 0));\n var hiderWidth = wtTable.hider.offsetWidth;\n var tbodyOffsetLeft = wtTable.TBODY.offsetLeft;\n var backlightElemMarginLeft = this.backlight.getOffset().left;\n var backlightElemWidth = this.backlight.getSize().width;\n var rowHeaderWidth = 0;\n\n if (priv.rootElementOffset + wtTable.holder.offsetWidth + scrollLeft < priv.target.eventPageX) {\n if (priv.coordsColumn < priv.countCols) {\n priv.coordsColumn++;\n }\n }\n\n if (priv.hasRowHeaders) {\n rowHeaderWidth = this.hot.view.wt.wtOverlays.leftOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth;\n }\n if (this.isFixedColumnsLeft(priv.coordsColumn)) {\n tdOffsetLeft += scrollLeft;\n }\n tdOffsetLeft += rowHeaderWidth;\n\n if (priv.coordsColumn < 0) {\n // if hover on rowHeader\n if (priv.fixedColumns > 0) {\n priv.target.col = 0;\n } else {\n priv.target.col = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n }\n } else if (priv.target.TD.offsetWidth / 2 + tdOffsetLeft <= mouseOffsetLeft) {\n var newCoordsCol = priv.coordsColumn >= priv.countCols ? priv.countCols - 1 : priv.coordsColumn;\n // if hover on right part of TD\n priv.target.col = newCoordsCol + 1;\n // unfortunately first column is bigger than rest\n tdOffsetLeft += priv.target.TD.offsetWidth;\n\n if (priv.target.col > lastVisible) {\n this.hot.scrollViewportTo(void 0, lastVisible + 1, void 0, true);\n }\n } else {\n // elsewhere on table\n priv.target.col = priv.coordsColumn;\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n }\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n\n var backlightLeft = mouseOffsetLeft;\n var guidelineLeft = tdOffsetLeft;\n\n if (mouseOffsetLeft + backlightElemWidth + backlightElemMarginLeft >= hiderWidth) {\n // prevent display backlight on the right side of the table\n backlightLeft = hiderWidth - backlightElemWidth - backlightElemMarginLeft;\n } else if (mouseOffsetLeft + backlightElemMarginLeft < tbodyOffsetLeft + rowHeaderWidth) {\n // prevent display backlight on the left side of the table\n backlightLeft = tbodyOffsetLeft + rowHeaderWidth + Math.abs(backlightElemMarginLeft);\n }\n\n if (tdOffsetLeft >= hiderWidth - 1) {\n // prevent display guideline outside the table\n guidelineLeft = hiderWidth - 1;\n } else if (guidelineLeft === 0) {\n // guideline has got `margin-left: -1px` as default\n guidelineLeft = 1;\n } else if (scrollableElement.scrollX !== void 0 && priv.coordsColumn < priv.fixedColumns) {\n guidelineLeft -= priv.rootElementOffset <= scrollableElement.scrollX ? priv.rootElementOffset : 0;\n }\n\n this.backlight.setPosition(null, backlightLeft);\n this.guideline.setPosition(null, guidelineLeft);\n }\n\n /**\n * This method checks arrayMap from columnsMapper and updates the columnsMapper if it's necessary.\n *\n * @private\n */\n\n }, {\n key: 'updateColumnsMapper',\n value: function updateColumnsMapper() {\n var countCols = this.hot.countSourceCols();\n var columnsMapperLen = this.columnsMapper._arrayMap.length;\n\n if (columnsMapperLen === 0) {\n this.columnsMapper.createMap(countCols || this.hot.getSettings().startCols);\n } else if (columnsMapperLen < countCols) {\n var diff = countCols - columnsMapperLen;\n\n this.columnsMapper.insertItems(columnsMapperLen, diff);\n } else if (columnsMapperLen > countCols) {\n var maxIndex = countCols - 1;\n var columnsToRemove = [];\n\n (0, _array.arrayEach)(this.columnsMapper._arrayMap, function (value, index, array) {\n if (value > maxIndex) {\n columnsToRemove.push(index);\n }\n });\n\n this.columnsMapper.removeItems(columnsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'unregisterEvents',\n value: function unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event\n * @param {CellCoords} coords\n * @param {HTMLElement} TD\n * @param {Object} blockCalculations\n */\n\n }, {\n key: 'onBeforeOnCellMouseDown',\n value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n var wtTable = this.hot.view.wt.wtTable;\n var isHeaderSelection = this.hot.selection.selectedHeader.cols;\n var selection = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n var isSortingElement = event.realTarget.className.indexOf('columnSorting') > -1;\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0 || isSortingElement) {\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.col, to.col);\n var end = Math.max(from.col, to.col);\n\n if (coords.row < 0 && coords.col >= start && coords.col <= end) {\n blockCalculations.column = true;\n priv.pressed = true;\n priv.target.eventPageX = event.pageX;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n priv.target.col = coords.col;\n priv.columnsToMove = this.prepareColumnsToMoving(start, end);\n priv.hasRowHeaders = !!this.hot.getSettings().rowHeaders;\n priv.countCols = this.hot.countCols();\n priv.fixedColumns = this.hot.getSettings().fixedColumnsLeft;\n priv.rootElementOffset = (0, _element.offset)(this.hot.rootElement).left;\n\n var countColumnsFrom = priv.hasRowHeaders ? -1 : 0;\n var topPos = wtTable.holder.scrollTop + wtTable.getColumnHeaderHeight(0) + 1;\n var fixedColumns = coords.col < priv.fixedColumns;\n var scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n var wrapperIsWindow = scrollableElement.scrollX ? scrollableElement.scrollX - priv.rootElementOffset : 0;\n\n var mouseOffset = event.layerX - (fixedColumns ? wrapperIsWindow : 0);\n var leftOffset = Math.abs(this.getColumnsWidth(start, coords.col) + mouseOffset);\n\n this.backlight.setPosition(topPos, this.getColumnsWidth(countColumnsFrom, start) + leftOffset);\n this.backlight.setSize(this.getColumnsWidth(start, end + 1), wtTable.hider.offsetHeight - topPos);\n this.backlight.setOffset(null, leftOffset * -1);\n\n (0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);\n } else {\n (0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n var width = this.backlight.getSize().width;\n this.backlight.setSize(0);\n\n setTimeout(function () {\n this.backlight.setPosition(width);\n });\n }\n\n priv.target.eventPageX = event.pageX;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n\n }, {\n key: 'onBeforeOnCellMouseOver',\n value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n var selectedRange = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.columnsToMove.indexOf(coords.col) > -1) {\n (0, _element.removeClass)(this.hot.rootElement, CSS_SHOW_UI);\n } else {\n (0, _element.addClass)(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n var priv = privatePool.get(this);\n\n priv.coordsColumn = void 0;\n priv.pressed = false;\n priv.backlightWidth = 0;\n\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.selectedHeader.cols) {\n (0, _element.addClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n if (priv.columnsToMove.length < 1 || priv.target.col === void 0 || priv.columnsToMove.indexOf(priv.target.col) > -1) {\n return;\n }\n\n this.moveColumns(priv.columnsToMove, priv.target.col);\n this.persistentStateSave();\n this.hot.render();\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n\n if (!priv.disallowMoving) {\n var selectionStart = this.columnsMapper.getIndexByValue(priv.columnsToMove[0]);\n var selectionEnd = this.columnsMapper.getIndexByValue(priv.columnsToMove[priv.columnsToMove.length - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.columnsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n\n }, {\n key: 'onAfterScrollVertically',\n value: function onAfterScrollVertically() {\n var wtTable = this.hot.view.wt.wtTable;\n var headerHeight = wtTable.getColumnHeaderHeight(0) + 1;\n var scrollTop = wtTable.holder.scrollTop;\n var posTop = headerHeight + scrollTop;\n\n this.backlight.setPosition(posTop);\n this.backlight.setSize(null, wtTable.hider.offsetHeight - posTop);\n }\n\n /**\n * `afterCreateCol` hook callback.\n *\n * @private\n * @param {Number} index Index of the created column.\n * @param {Number} amount Amount of created columns.\n */\n\n }, {\n key: 'onAfterCreateCol',\n value: function onAfterCreateCol(index, amount) {\n this.columnsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove column listener.\n *\n * @private\n * @param {Number} index Column index.\n * @param {Number} amount Defines how many columns removed.\n */\n\n }, {\n key: 'onBeforeRemoveCol',\n value: function onBeforeRemoveCol(index, amount) {\n var _this5 = this;\n\n this.removedColumns.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) {\n _this5.removedColumns.push(_this5.hot.runHooks('modifyCol', removedIndex, _this5.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveCol` hook callback.\n *\n * @private\n * @param {Number} index Index of the removed column.\n * @param {Number} amount Amount of removed columns.\n */\n\n }, {\n key: 'onAfterRemoveCol',\n value: function onAfterRemoveCol(index, amount) {\n this.columnsMapper.unshiftItems(this.removedColumns);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n * @param {Boolean} firstTime True if that was loading data during the initialization.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstTime) {\n this.updateColumnsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} column Visual column index.\n * @returns {Number} Modified column index.\n */\n\n }, {\n key: 'onModifyCol',\n value: function onModifyCol(column, source) {\n if (source !== this.pluginName) {\n // ugly fix for try to insert new, needed columns after pasting data\n var columnInMapper = this.columnsMapper.getValueByIndex(column);\n column = columnInMapper === null ? column : columnInMapper;\n }\n\n return column;\n }\n\n /**\n * 'unmodifyCol' hook callback.\n *\n * @private\n * @param {Number} column Visual column index.\n * @returns {Number} Logical column index.\n */\n\n }, {\n key: 'onUnmodifyCol',\n value: function onUnmodifyCol(column) {\n var indexInMapper = this.columnsMapper.getIndexByValue(column);\n\n return indexInMapper === null ? column : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n this.updateColumnsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualColumnMove.prototype.__proto__ || Object.getPrototypeOf(ManualColumnMove.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualColumnMove;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('ManualColumnMove', ManualColumnMove);\n\nexports.default = ManualColumnMove;\n\n/***/ }),\n/* 243 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(151);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualColumnMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\n\nvar BacklightUI = function (_BaseUI) {\n _inherits(BacklightUI, _BaseUI);\n\n function BacklightUI() {\n _classCallCheck(this, BacklightUI);\n\n return _possibleConstructorReturn(this, (BacklightUI.__proto__ || Object.getPrototypeOf(BacklightUI)).apply(this, arguments));\n }\n\n _createClass(BacklightUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(BacklightUI.prototype.__proto__ || Object.getPrototypeOf(BacklightUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return BacklightUI;\n}(_base2.default);\n\nexports.default = BacklightUI;\n\n/***/ }),\n/* 244 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(151);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualColumnMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\n\nvar GuidelineUI = function (_BaseUI) {\n _inherits(GuidelineUI, _BaseUI);\n\n function GuidelineUI() {\n _classCallCheck(this, GuidelineUI);\n\n return _possibleConstructorReturn(this, (GuidelineUI.__proto__ || Object.getPrototypeOf(GuidelineUI)).apply(this, arguments));\n }\n\n _createClass(GuidelineUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(GuidelineUI.prototype.__proto__ || Object.getPrototypeOf(GuidelineUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return GuidelineUI;\n}(_base2.default);\n\nexports.default = GuidelineUI;\n\n/***/ }),\n/* 245 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualColumnResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired width of the column.\n * - guide - the helper guide that shows the desired width as a vertical guide.\n *\n * @plugin ManualColumnResize\n */\nvar ManualColumnResize = function (_BasePlugin) {\n _inherits(ManualColumnResize, _BasePlugin);\n\n function ManualColumnResize(hotInstance) {\n _classCallCheck(this, ManualColumnResize);\n\n var _this = _possibleConstructorReturn(this, (ManualColumnResize.__proto__ || Object.getPrototypeOf(ManualColumnResize)).call(this, hotInstance));\n\n _this.currentTH = null;\n _this.currentCol = null;\n _this.selectedCols = [];\n _this.currentWidth = null;\n _this.newSize = null;\n _this.startY = null;\n _this.startWidth = null;\n _this.startOffset = null;\n _this.handle = document.createElement('DIV');\n _this.guide = document.createElement('DIV');\n _this.eventManager = new _eventManager2.default(_this);\n _this.pressed = null;\n _this.dblclick = 0;\n _this.autoresizeTimeout = null;\n _this.manualColumnWidths = [];\n\n (0, _element.addClass)(_this.handle, 'manualColumnResizer');\n (0, _element.addClass)(_this.guide, 'manualColumnResizerGuide');\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualColumnResize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().manualColumnResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.manualColumnWidths = [];\n var initialColumnWidth = this.hot.getSettings().manualColumnResize;\n var loadedManualColumnWidths = this.loadManualColumnWidths();\n\n this.addHook('modifyColWidth', function (width, col) {\n return _this2.onModifyColWidth(width, col);\n });\n this.addHook('beforeStretchingColumnWidth', function (stretchedWidth, column) {\n return _this2.onBeforeStretchingColumnWidth(stretchedWidth, column);\n });\n this.addHook('beforeColumnResize', function (currentColumn, newSize, isDoubleClick) {\n return _this2.onBeforeColumnResize(currentColumn, newSize, isDoubleClick);\n });\n\n if (typeof loadedManualColumnWidths != 'undefined') {\n this.manualColumnWidths = loadedManualColumnWidths;\n } else if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n } else {\n this.manualColumnWidths = [];\n }\n\n // Handsontable.hooks.register('beforeColumnResize');\n // Handsontable.hooks.register('afterColumnResize');\n\n this.bindEvents();\n\n _get(ManualColumnResize.prototype.__proto__ || Object.getPrototypeOf(ManualColumnResize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var initialColumnWidth = this.hot.getSettings().manualColumnResize;\n\n if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n } else if (!initialColumnWidth) {\n this.manualColumnWidths = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ManualColumnResize.prototype.__proto__ || Object.getPrototypeOf(ManualColumnResize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n\n }, {\n key: 'saveManualColumnWidths',\n value: function saveManualColumnWidths() {\n this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n\n }, {\n key: 'loadManualColumnWidths',\n value: function loadManualColumnWidths() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n\n }, {\n key: 'setupHandlePosition',\n value: function setupHandlePosition(TH) {\n var _this3 = this;\n\n if (!TH.parentNode) {\n return false;\n }\n\n this.currentTH = TH;\n\n var col = this.hot.view.wt.wtTable.getCoords(TH).col; // getCoords returns CellCoords\n var headerHeight = (0, _element.outerHeight)(this.currentTH);\n\n if (col >= 0) {\n // if not col header\n var box = this.currentTH.getBoundingClientRect();\n\n this.currentCol = col;\n this.selectedCols = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.selectedHeader.cols) {\n var _hot$getSelectedRange = this.hot.getSelectedRange(),\n from = _hot$getSelectedRange.from,\n to = _hot$getSelectedRange.to;\n\n var start = from.col;\n var end = to.col;\n\n if (start >= end) {\n start = to.col;\n end = from.col;\n }\n\n if (this.currentCol >= start && this.currentCol <= end) {\n (0, _number.rangeEach)(start, end, function (i) {\n return _this3.selectedCols.push(i);\n });\n } else {\n this.selectedCols.push(this.currentCol);\n }\n } else {\n this.selectedCols.push(this.currentCol);\n }\n\n this.startOffset = box.left - 6;\n this.startWidth = parseInt(box.width, 10);\n this.handle.style.top = box.top + 'px';\n this.handle.style.left = this.startOffset + this.startWidth + 'px';\n this.handle.style.height = headerHeight + 'px';\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n\n }, {\n key: 'refreshHandlePosition',\n value: function refreshHandlePosition() {\n this.handle.style.left = this.startOffset + this.currentWidth + 'px';\n }\n\n /**\n * Set the resize guide position.\n */\n\n }, {\n key: 'setupGuidePosition',\n value: function setupGuidePosition() {\n var handleHeight = parseInt((0, _element.outerHeight)(this.handle), 10);\n var handleBottomPosition = parseInt(this.handle.style.top, 10) + handleHeight;\n var maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);\n\n (0, _element.addClass)(this.handle, 'active');\n (0, _element.addClass)(this.guide, 'active');\n\n this.guide.style.top = handleBottomPosition + 'px';\n this.guide.style.left = this.handle.style.left;\n this.guide.style.height = maximumVisibleElementHeight - handleHeight + 'px';\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n\n }, {\n key: 'refreshGuidePosition',\n value: function refreshGuidePosition() {\n this.guide.style.left = this.handle.style.left;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n\n }, {\n key: 'hideHandleAndGuide',\n value: function hideHandleAndGuide() {\n (0, _element.removeClass)(this.handle, 'active');\n (0, _element.removeClass)(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered a column header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkIfColumnHeader',\n value: function checkIfColumnHeader(element) {\n if (element != this.hot.rootElement) {\n var parent = element.parentNode;\n\n if (parent.tagName === 'THEAD') {\n return true;\n }\n\n return this.checkIfColumnHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getTHFromTargetElement',\n value: function getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n if (this.checkIfColumnHeader(event.target)) {\n var th = this.getTHFromTargetElement(event.target);\n\n if (!th) {\n return;\n }\n\n var colspan = th.getAttribute('colspan');\n\n if (th && (colspan === null || colspan === 1)) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n\n }, {\n key: 'afterMouseDownTimeout',\n value: function afterMouseDownTimeout() {\n var _this4 = this;\n\n var render = function render() {\n _this4.hot.forceFullRender = true;\n _this4.hot.view.render(); // updates all\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedCol, forceRender) {\n var hookNewSize = _this4.hot.runHooks('beforeColumnResize', selectedCol, _this4.newSize, true);\n\n if (hookNewSize !== void 0) {\n _this4.newSize = hookNewSize;\n }\n\n if (_this4.hot.getSettings().stretchH === 'all') {\n _this4.clearManualSize(selectedCol);\n } else {\n _this4.setManualSize(selectedCol, _this4.newSize); // double click sets by auto row size plugin\n }\n\n if (forceRender) {\n render();\n }\n\n _this4.saveManualColumnWidths();\n\n _this4.hot.runHooks('afterColumnResize', selectedCol, _this4.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n var selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n var _this5 = this;\n\n if ((0, _element.hasClass)(event.target, 'manualColumnResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout === null) {\n this.autoresizeTimeout = setTimeout(function () {\n return _this5.afterMouseDownTimeout();\n }, 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startX = (0, _event.pageX)(event);\n this.newSize = this.startWidth;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new column width.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var _this6 = this;\n\n if (this.pressed) {\n this.currentWidth = this.startWidth + ((0, _event.pageX)(event) - this.startX);\n\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n _this6.newSize = _this6.setManualSize(selectedCol, _this6.currentWidth);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the column resizing.\n *\n * @private\n * @param {MouseEvent} e\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n var _this7 = this;\n\n var render = function render() {\n _this7.hot.forceFullRender = true;\n _this7.hot.view.render(); // updates all\n _this7.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedCol, forceRender) {\n _this7.hot.runHooks('beforeColumnResize', selectedCol, _this7.newSize);\n\n if (forceRender) {\n render();\n }\n\n _this7.saveManualColumnWidths();\n\n _this7.hot.runHooks('afterColumnResize', selectedCol, _this7.newSize);\n };\n\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startWidth) {\n var selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedCols, function (selectedCol) {\n resize(selectedCol, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n var _this8 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', function (e) {\n return _this8.onMouseOver(e);\n });\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', function (e) {\n return _this8.onMouseDown(e);\n });\n this.eventManager.addEventListener(window, 'mousemove', function (e) {\n return _this8.onMouseMove(e);\n });\n this.eventManager.addEventListener(window, 'mouseup', function (e) {\n return _this8.onMouseUp(e);\n });\n }\n\n /**\n * Cache the current column width.\n *\n * @param {Number} column Column index.\n * @param {Number} width Column width.\n * @returns {Number}\n */\n\n }, {\n key: 'setManualSize',\n value: function setManualSize(column, width) {\n width = Math.max(width, 20);\n\n /**\n * We need to run col through modifyCol hook, in case the order of displayed columns is different than the order\n * in data source. For instance, this order can be modified by manualColumnMove plugin.\n */\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = width;\n\n return width;\n }\n\n /**\n * Clear cache for the current column index.\n *\n * @param {Number} column Column index.\n */\n\n }, {\n key: 'clearManualSize',\n value: function clearManualSize(column) {\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = void 0;\n }\n\n /**\n * Modify the provided column width, based on the plugin settings\n *\n * @private\n * @param {Number} width Column width.\n * @param {Number} column Column index.\n * @returns {Number}\n */\n\n }, {\n key: 'onModifyColWidth',\n value: function onModifyColWidth(width, column) {\n if (this.enabled) {\n column = this.hot.runHooks('modifyCol', column);\n\n if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) {\n return this.manualColumnWidths[column];\n }\n }\n\n return width;\n }\n\n /**\n * Modify the provided column stretched width. This hook decides if specified column should be stretched or not.\n *\n * @private\n * @param {Number} stretchedWidth Stretched width.\n * @param {Number} column Column index.\n * @returns {Number}\n */\n\n }, {\n key: 'onBeforeStretchingColumnWidth',\n value: function onBeforeStretchingColumnWidth(stretchedWidth, column) {\n var width = this.manualColumnWidths[column];\n\n if (width === void 0) {\n width = stretchedWidth;\n }\n\n return width;\n }\n\n /**\n * `beforeColumnResize` hook callback.\n *\n * @private\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n\n }, {\n key: 'onBeforeColumnResize',\n value: function onBeforeColumnResize() {\n // clear the header height cache information\n this.hot.view.wt.wtViewport.hasOversizedColumnHeadersMarked = {};\n }\n }]);\n\n return ManualColumnResize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualColumnResize', ManualColumnResize);\n\nexports.default = ManualColumnResize;\n\n/***/ }),\n/* 246 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _element = __webpack_require__(0);\n\nvar _number = __webpack_require__(6);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _rowsMapper = __webpack_require__(247);\n\nvar _rowsMapper2 = _interopRequireDefault(_rowsMapper);\n\nvar _backlight = __webpack_require__(248);\n\nvar _backlight2 = _interopRequireDefault(_backlight);\n\nvar _guideline = __webpack_require__(249);\n\nvar _guideline2 = _interopRequireDefault(_guideline);\n\nvar _src = __webpack_require__(11);\n\n__webpack_require__(298);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n_pluginHooks2.default.getSingleton().register('beforeRowMove');\n_pluginHooks2.default.getSingleton().register('afterRowMove');\n_pluginHooks2.default.getSingleton().register('unmodifyRow');\n\nvar privatePool = new WeakMap();\nvar CSS_PLUGIN = 'ht__manualRowMove';\nvar CSS_SHOW_UI = 'show-ui';\nvar CSS_ON_MOVING = 'on-moving--rows';\nvar CSS_AFTER_SELECTION = 'after-selection--rows';\n\n/**\n * @plugin ManualRowMove\n *\n * @description\n * This plugin allows to change rows order.\n *\n * API:\n * - moveRow - move single row to the new position.\n * - moveRows - move many rows (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of handsontable.\n *\n * UI components:\n * - backlight - highlight of selected rows.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualRowMove\n * @plugin ManualRowMove\n */\n\nvar ManualRowMove = function (_BasePlugin) {\n _inherits(ManualRowMove, _BasePlugin);\n\n function ManualRowMove(hotInstance) {\n _classCallCheck(this, ManualRowMove);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n var _this = _possibleConstructorReturn(this, (ManualRowMove.__proto__ || Object.getPrototypeOf(ManualRowMove)).call(this, hotInstance));\n\n privatePool.set(_this, {\n rowsToMove: [],\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageY: void 0,\n coords: void 0,\n TD: void 0,\n row: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n _this.removedRows = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n _this.rowsMapper = new _rowsMapper2.default(_this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n _this.eventManager = new _eventManager2.default(_this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n _this.backlight = new _backlight2.default(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n _this.guideline = new _guideline2.default(hotInstance);\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualRowMove, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return !!this.hot.getSettings().manualRowMove;\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations);\n });\n this.addHook('beforeOnCellMouseOver', function (event, coords, TD, blockCalculations) {\n return _this2.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations);\n });\n this.addHook('afterScrollHorizontally', function () {\n return _this2.onAfterScrollHorizontally();\n });\n this.addHook('modifyRow', function (row, source) {\n return _this2.onModifyRow(row, source);\n });\n this.addHook('beforeRemoveRow', function (index, amount) {\n return _this2.onBeforeRemoveRow(index, amount);\n });\n this.addHook('afterRemoveRow', function (index, amount) {\n return _this2.onAfterRemoveRow(index, amount);\n });\n this.addHook('afterCreateRow', function (index, amount) {\n return _this2.onAfterCreateRow(index, amount);\n });\n this.addHook('afterLoadData', function (firstTime) {\n return _this2.onAfterLoadData(firstTime);\n });\n this.addHook('beforeColumnSort', function (column, order) {\n return _this2.onBeforeColumnSort(column, order);\n });\n this.addHook('unmodifyRow', function (row) {\n return _this2.onUnmodifyRow(row);\n });\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n (0, _element.addClass)(this.hot.rootElement, CSS_PLUGIN);\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n var pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.rowsMapper.clearMap();\n }\n\n (0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Move a single row.\n *\n * @param {Number} row Visual row index to be moved.\n * @param {Number} target Visual row index being a target for the moved row.\n */\n\n }, {\n key: 'moveRow',\n value: function moveRow(row, target) {\n this.moveRows([row], target);\n }\n\n /**\n * Move multiple rows.\n *\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for the moved rows.\n */\n\n }, {\n key: 'moveRows',\n value: function moveRows(rows, target) {\n var _this3 = this;\n\n var priv = privatePool.get(this);\n var beforeMoveHook = this.hot.runHooks('beforeRowMove', rows, target);\n\n priv.disallowMoving = beforeMoveHook === false;\n\n if (!priv.disallowMoving) {\n // first we need to rewrite an visual indexes to logical for save reference after move\n (0, _array.arrayEach)(rows, function (row, index, array) {\n array[index] = _this3.rowsMapper.getValueByIndex(row);\n });\n\n // next, when we have got an logical indexes, we can move rows\n (0, _array.arrayEach)(rows, function (row, index) {\n var actualPosition = _this3.rowsMapper.getIndexByValue(row);\n\n if (actualPosition !== target) {\n _this3.rowsMapper.moveRow(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear rowsMapper from null entries\n this.rowsMapper.clearNull();\n }\n\n this.hot.runHooks('afterRowMove', rows, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the row order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startRow Visual row index for the start of the selection.\n * @param {Number} endRow Visual row index for the end of the selection.\n */\n\n }, {\n key: 'changeSelection',\n value: function changeSelection(startRow, endRow) {\n var selection = this.hot.selection;\n var lastColIndex = this.hot.countCols() - 1;\n\n selection.setRangeStartOnly(new _src.CellCoords(startRow, 0));\n selection.setRangeEnd(new _src.CellCoords(endRow, lastColIndex), false);\n }\n\n /**\n * Get the sum of the heights of rows in the provided range.\n *\n * @private\n * @param {Number} from Visual row index.\n * @param {Number} to Visual row index.\n * @returns {Number}\n */\n\n }, {\n key: 'getRowsHeight',\n value: function getRowsHeight(from, to) {\n var height = 0;\n\n for (var i = from; i < to; i++) {\n var rowHeight = this.hot.view.wt.wtTable.getRowHeight(i) || 23;\n\n height += rowHeight;\n }\n\n return height;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n\n }, {\n key: 'initialSettings',\n value: function initialSettings() {\n var pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveRows(pluginSettings, 0);\n } else if (pluginSettings !== void 0) {\n var persistentState = this.persistentStateLoad();\n\n if (persistentState.length) {\n this.moveRows(persistentState, 0);\n }\n }\n }\n\n /**\n * Check if the provided row is in the fixedRowsTop section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedRowTop',\n value: function isFixedRowTop(row) {\n return row < this.hot.getSettings().fixedRowsTop;\n }\n\n /**\n * Check if the provided row is in the fixedRowsBottom section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n\n }, {\n key: 'isFixedRowBottom',\n value: function isFixedRowBottom(row) {\n return row > this.hot.getSettings().fixedRowsBottom;\n }\n\n /**\n * Save the manual row positions to the persistent state.\n *\n * @private\n */\n\n }, {\n key: 'persistentStateSave',\n value: function persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualRowMove', this.rowsMapper._arrayMap);\n }\n\n /**\n * Load the manual row positions from the persistent state.\n *\n * @private\n * @returns {Array} Stored state.\n */\n\n }, {\n key: 'persistentStateLoad',\n value: function persistentStateLoad() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowMove', storedState);\n\n return storedState.value ? storedState.value : [];\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n\n }, {\n key: 'prepareRowsToMoving',\n value: function prepareRowsToMoving() {\n var selection = this.hot.getSelectedRange();\n var selectedRows = [];\n\n if (!selection) {\n return selectedRows;\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.row, to.row);\n var end = Math.max(from.row, to.row);\n\n (0, _number.rangeEach)(start, end, function (i) {\n selectedRows.push(i);\n });\n\n return selectedRows;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n\n }, {\n key: 'refreshPositions',\n value: function refreshPositions() {\n var priv = privatePool.get(this);\n var coords = priv.target.coords;\n var firstVisible = this.hot.view.wt.wtTable.getFirstVisibleRow();\n var lastVisible = this.hot.view.wt.wtTable.getLastVisibleRow();\n var fixedRows = this.hot.getSettings().fixedRowsTop;\n var countRows = this.hot.countRows();\n\n if (coords.row < fixedRows && firstVisible > 0) {\n this.hot.scrollViewportTo(firstVisible - 1);\n }\n if (coords.row >= lastVisible && lastVisible < countRows) {\n this.hot.scrollViewportTo(lastVisible + 1, undefined, true);\n }\n\n var wtTable = this.hot.view.wt.wtTable;\n var TD = priv.target.TD;\n var rootElementOffset = (0, _element.offset)(this.hot.rootElement);\n var tdOffsetTop = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row);\n var mouseOffsetTop = priv.target.eventPageY - rootElementOffset.top + wtTable.holder.scrollTop;\n var hiderHeight = wtTable.hider.offsetHeight;\n var tbodyOffsetTop = wtTable.TBODY.offsetTop;\n var backlightElemMarginTop = this.backlight.getOffset().top;\n var backlightElemHeight = this.backlight.getSize().height;\n\n if (rootElementOffset.top + wtTable.holder.offsetHeight < priv.target.eventPageY) {\n priv.target.coords.row++;\n }\n\n if (this.isFixedRowTop(coords.row)) {\n tdOffsetTop += wtTable.holder.scrollTop;\n }\n\n // todo: fixedRowsBottom\n // if (this.isFixedRowBottom(coords.row)) {\n //\n // }\n\n if (coords.row < 0) {\n // if hover on colHeader\n priv.target.row = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n } else if (TD.offsetHeight / 2 + tdOffsetTop <= mouseOffsetTop) {\n // if hover on lower part of TD\n priv.target.row = coords.row + 1;\n // unfortunately first row is bigger than rest\n tdOffsetTop += coords.row === 0 ? TD.offsetHeight - 1 : TD.offsetHeight;\n } else {\n // elsewhere on table\n priv.target.row = coords.row;\n }\n\n var backlightTop = mouseOffsetTop;\n var guidelineTop = tdOffsetTop;\n\n if (mouseOffsetTop + backlightElemHeight + backlightElemMarginTop >= hiderHeight) {\n // prevent display backlight below table\n backlightTop = hiderHeight - backlightElemHeight - backlightElemMarginTop;\n } else if (mouseOffsetTop + backlightElemMarginTop < tbodyOffsetTop) {\n // prevent display above below table\n backlightTop = tbodyOffsetTop + Math.abs(backlightElemMarginTop);\n }\n\n if (tdOffsetTop >= hiderHeight - 1) {\n // prevent display guideline below table\n guidelineTop = hiderHeight - 1;\n }\n\n var topOverlayHeight = 0;\n if (this.hot.view.wt.wtOverlays.topOverlay) {\n topOverlayHeight = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.TABLE.offsetHeight;\n }\n\n if (coords.row >= fixedRows && guidelineTop - wtTable.holder.scrollTop < topOverlayHeight) {\n this.hot.scrollViewportTo(coords.row);\n }\n\n this.backlight.setPosition(backlightTop);\n this.guideline.setPosition(guidelineTop);\n }\n\n /**\n * This method checks arrayMap from rowsMapper and updates the rowsMapper if it's necessary.\n *\n * @private\n */\n\n }, {\n key: 'updateRowsMapper',\n value: function updateRowsMapper() {\n var countRows = this.hot.countSourceRows();\n var rowsMapperLen = this.rowsMapper._arrayMap.length;\n\n if (rowsMapperLen === 0) {\n this.rowsMapper.createMap(countRows || this.hot.getSettings().startRows);\n } else if (rowsMapperLen < countRows) {\n var diff = countRows - rowsMapperLen;\n\n this.rowsMapper.insertItems(rowsMapperLen, diff);\n } else if (rowsMapperLen > countRows) {\n var maxIndex = countRows - 1;\n var rowsToRemove = [];\n\n (0, _array.arrayEach)(this.rowsMapper._arrayMap, function (value, index, array) {\n if (value > maxIndex) {\n rowsToRemove.push(index);\n }\n });\n\n this.rowsMapper.removeItems(rowsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this4 = this;\n\n this.eventManager.addEventListener(document.documentElement, 'mousemove', function (event) {\n return _this4.onMouseMove(event);\n });\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function () {\n return _this4.onMouseUp();\n });\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: 'unregisterEvents',\n value: function unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * `beforeColumnSort` hook callback. If user uses the sorting, manual row moving is disabled.\n *\n * @private\n * @param {Number} column Column index where soring is present\n * @param {*} order State of sorting. ASC/DESC/None\n */\n\n }, {\n key: 'onBeforeColumnSort',\n value: function onBeforeColumnSort(column, order) {\n var priv = privatePool.get(this);\n\n priv.disallowMoving = order !== void 0;\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event\n * @param {CellCoords} coords\n * @param {HTMLElement} TD\n * @param {Object} blockCalculations\n */\n\n }, {\n key: 'onBeforeOnCellMouseDown',\n value: function onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n var wtTable = this.hot.view.wt.wtTable;\n var isHeaderSelection = this.hot.selection.selectedHeader.rows;\n var selection = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0) {\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n var guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n var backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n var from = selection.from,\n to = selection.to;\n\n var start = Math.min(from.row, to.row);\n var end = Math.max(from.row, to.row);\n\n if (coords.col < 0 && coords.row >= start && coords.row <= end) {\n blockCalculations.row = true;\n priv.pressed = true;\n priv.target.eventPageY = event.pageY;\n priv.target.coords = coords;\n priv.target.TD = TD;\n priv.rowsToMove = this.prepareRowsToMoving();\n\n var leftPos = wtTable.holder.scrollLeft + wtTable.getColumnWidth(-1);\n\n this.backlight.setPosition(null, leftPos);\n this.backlight.setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end + 1));\n this.backlight.setOffset((this.getRowsHeight(start, coords.row) + event.layerY) * -1, null);\n\n (0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);\n\n this.refreshPositions();\n } else {\n (0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n var height = this.backlight.getSize().height;\n this.backlight.setSize(null, 0);\n\n setTimeout(function () {\n this.backlight.setPosition(null, height);\n });\n }\n\n priv.target.eventPageY = event.pageY;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n\n }, {\n key: 'onBeforeOnCellMouseOver',\n value: function onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n var selectedRange = this.hot.getSelectedRange();\n var priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.rowsToMove.indexOf(coords.row) > -1) {\n (0, _element.removeClass)(this.hot.rootElement, CSS_SHOW_UI);\n } else {\n (0, _element.addClass)(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.target.coords = coords;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp() {\n var priv = privatePool.get(this);\n var target = priv.target.row;\n var rowsLen = priv.rowsToMove.length;\n\n priv.pressed = false;\n priv.backlightHeight = 0;\n\n (0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.selectedHeader.rows) {\n (0, _element.addClass)(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n\n if (rowsLen < 1 || target === void 0 || priv.rowsToMove.indexOf(target) > -1 || priv.rowsToMove[rowsLen - 1] === target - 1) {\n return;\n }\n\n this.moveRows(priv.rowsToMove, target);\n\n this.persistentStateSave();\n this.hot.render();\n\n if (!priv.disallowMoving) {\n var selectionStart = this.rowsMapper.getIndexByValue(priv.rowsToMove[0]);\n var selectionEnd = this.rowsMapper.getIndexByValue(priv.rowsToMove[rowsLen - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.rowsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n\n }, {\n key: 'onAfterScrollHorizontally',\n value: function onAfterScrollHorizontally() {\n var wtTable = this.hot.view.wt.wtTable;\n var headerWidth = wtTable.getColumnWidth(-1);\n var scrollLeft = wtTable.holder.scrollLeft;\n var posLeft = headerWidth + scrollLeft;\n\n this.backlight.setPosition(null, posLeft);\n this.backlight.setSize(wtTable.hider.offsetWidth - posLeft);\n }\n\n /**\n * `afterCreateRow` hook callback.\n *\n * @private\n * @param {Number} index Index of the created row.\n * @param {Number} amount Amount of created rows.\n */\n\n }, {\n key: 'onAfterCreateRow',\n value: function onAfterCreateRow(index, amount) {\n this.rowsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove row listener.\n *\n * @private\n * @param {Number} index Row index.\n * @param {Number} amount Defines how many rows removed.\n */\n\n }, {\n key: 'onBeforeRemoveRow',\n value: function onBeforeRemoveRow(index, amount) {\n var _this5 = this;\n\n this.removedRows.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n (0, _number.rangeEach)(index, index + amount - 1, function (removedIndex) {\n _this5.removedRows.push(_this5.hot.runHooks('modifyRow', removedIndex, _this5.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} index Index of the removed row.\n * @param {Number} amount Amount of removed rows.\n */\n\n }, {\n key: 'onAfterRemoveRow',\n value: function onAfterRemoveRow(index, amount) {\n this.rowsMapper.unshiftItems(this.removedRows);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n * @param {Boolean} firstTime True if that was loading data during the initialization.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstTime) {\n this.updateRowsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} row Visual Row index.\n * @returns {Number} Modified row index.\n */\n\n }, {\n key: 'onModifyRow',\n value: function onModifyRow(row, source) {\n if (source !== this.pluginName) {\n var rowInMapper = this.rowsMapper.getValueByIndex(row);\n row = rowInMapper === null ? row : rowInMapper;\n }\n\n return row;\n }\n\n /**\n * 'unmodifyRow' hook callback.\n *\n * @private\n * @param {Number} row Visual row index.\n * @returns {Number} Logical row index.\n */\n\n }, {\n key: 'onUnmodifyRow',\n value: function onUnmodifyRow(row) {\n var indexInMapper = this.rowsMapper.getIndexByValue(row);\n\n return indexInMapper === null ? row : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n\n }, {\n key: 'onAfterPluginsInitialized',\n value: function onAfterPluginsInitialized() {\n this.updateRowsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n _get(ManualRowMove.prototype.__proto__ || Object.getPrototypeOf(ManualRowMove.prototype), 'destroy', this).call(this);\n }\n }]);\n\n return ManualRowMove;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('ManualRowMove', ManualRowMove);\n\nexports.default = ManualRowMove;\n\n/***/ }),\n/* 247 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _arrayMapper = __webpack_require__(149);\n\nvar _arrayMapper2 = _interopRequireDefault(_arrayMapper);\n\nvar _array = __webpack_require__(1);\n\nvar _object = __webpack_require__(2);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class RowsMapper\n * @plugin ManualRowMove\n */\nvar RowsMapper = function () {\n function RowsMapper(manualRowMove) {\n _classCallCheck(this, RowsMapper);\n\n /**\n * Instance of ManualRowMove plugin.\n *\n * @type {ManualRowMove}\n */\n this.manualRowMove = manualRowMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n\n\n _createClass(RowsMapper, [{\n key: 'createMap',\n value: function createMap(length) {\n var _this = this;\n\n var originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n (0, _number.rangeEach)(originLength - 1, function (itemIndex) {\n _this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._arrayMap = null;\n }\n\n /**\n * Moving elements in rowsMapper.\n *\n * @param {Number} from Row index to move.\n * @param {Number} to Target index.\n */\n\n }, {\n key: 'moveRow',\n value: function moveRow(from, to) {\n var indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n\n }, {\n key: 'clearNull',\n value: function clearNull() {\n this._arrayMap = (0, _array.arrayFilter)(this._arrayMap, function (i) {\n return i !== null;\n });\n }\n }]);\n\n return RowsMapper;\n}();\n\n(0, _object.mixin)(RowsMapper, _arrayMapper2.default);\n\nexports.default = RowsMapper;\n\n/***/ }),\n/* 248 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(152);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualRowMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\n\nvar BacklightUI = function (_BaseUI) {\n _inherits(BacklightUI, _BaseUI);\n\n function BacklightUI() {\n _classCallCheck(this, BacklightUI);\n\n return _possibleConstructorReturn(this, (BacklightUI.__proto__ || Object.getPrototypeOf(BacklightUI)).apply(this, arguments));\n }\n\n _createClass(BacklightUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(BacklightUI.prototype.__proto__ || Object.getPrototypeOf(BacklightUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return BacklightUI;\n}(_base2.default);\n\nexports.default = BacklightUI;\n\n/***/ }),\n/* 249 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(152);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CSS_CLASSNAME = 'ht__manualRowMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\n\nvar GuidelineUI = function (_BaseUI) {\n _inherits(GuidelineUI, _BaseUI);\n\n function GuidelineUI() {\n _classCallCheck(this, GuidelineUI);\n\n return _possibleConstructorReturn(this, (GuidelineUI.__proto__ || Object.getPrototypeOf(GuidelineUI)).apply(this, arguments));\n }\n\n _createClass(GuidelineUI, [{\n key: 'build',\n\n /**\n * Custom className on build process.\n */\n value: function build() {\n _get(GuidelineUI.prototype.__proto__ || Object.getPrototypeOf(GuidelineUI.prototype), 'build', this).call(this);\n\n (0, _element.addClass)(this._element, CSS_CLASSNAME);\n }\n }]);\n\n return GuidelineUI;\n}(_base2.default);\n\nexports.default = GuidelineUI;\n\n/***/ }),\n/* 250 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualRowResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired height of the row.\n * - guide - the helper guide that shows the desired height as a horizontal guide.\n *\n * @plugin ManualRowResize\n */\nvar ManualRowResize = function (_BasePlugin) {\n _inherits(ManualRowResize, _BasePlugin);\n\n function ManualRowResize(hotInstance) {\n _classCallCheck(this, ManualRowResize);\n\n var _this = _possibleConstructorReturn(this, (ManualRowResize.__proto__ || Object.getPrototypeOf(ManualRowResize)).call(this, hotInstance));\n\n _this.currentTH = null;\n _this.currentRow = null;\n _this.selectedRows = [];\n _this.currentHeight = null;\n _this.newSize = null;\n _this.startY = null;\n _this.startHeight = null;\n _this.startOffset = null;\n _this.handle = document.createElement('DIV');\n _this.guide = document.createElement('DIV');\n _this.eventManager = new _eventManager2.default(_this);\n _this.pressed = null;\n _this.dblclick = 0;\n _this.autoresizeTimeout = null;\n _this.manualRowHeights = [];\n\n (0, _element.addClass)(_this.handle, 'manualRowResizer');\n (0, _element.addClass)(_this.guide, 'manualRowResizerGuide');\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ManualRowResize, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().manualRowResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.manualRowHeights = [];\n\n var initialRowHeights = this.hot.getSettings().manualRowResize;\n var loadedManualRowHeights = this.loadManualRowHeights();\n\n if (typeof loadedManualRowHeights != 'undefined') {\n this.manualRowHeights = loadedManualRowHeights;\n } else if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n } else {\n this.manualRowHeights = [];\n }\n\n this.addHook('modifyRowHeight', function (height, row) {\n return _this2.onModifyRowHeight(height, row);\n });\n\n // Handsontable.hooks.register('beforeRowResize');\n // Handsontable.hooks.register('afterRowResize');\n\n this.bindEvents();\n\n _get(ManualRowResize.prototype.__proto__ || Object.getPrototypeOf(ManualRowResize.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n var initialRowHeights = this.hot.getSettings().manualRowResize;\n\n if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n } else if (!initialRowHeights) {\n this.manualRowHeights = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(ManualRowResize.prototype.__proto__ || Object.getPrototypeOf(ManualRowResize.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n\n }, {\n key: 'saveManualRowHeights',\n value: function saveManualRowHeights() {\n this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n\n }, {\n key: 'loadManualRowHeights',\n value: function loadManualRowHeights() {\n var storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n\n }, {\n key: 'setupHandlePosition',\n value: function setupHandlePosition(TH) {\n var _this3 = this;\n\n this.currentTH = TH;\n var row = this.hot.view.wt.wtTable.getCoords(TH).row; // getCoords returns CellCoords\n var headerWidth = (0, _element.outerWidth)(this.currentTH);\n\n if (row >= 0) {\n // if not col header\n var box = this.currentTH.getBoundingClientRect();\n\n this.currentRow = row;\n this.selectedRows = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.selectedHeader.rows) {\n var _hot$getSelectedRange = this.hot.getSelectedRange(),\n from = _hot$getSelectedRange.from,\n to = _hot$getSelectedRange.to;\n\n var start = from.row;\n var end = to.row;\n\n if (start >= end) {\n start = to.row;\n end = from.row;\n }\n\n if (this.currentRow >= start && this.currentRow <= end) {\n (0, _number.rangeEach)(start, end, function (i) {\n return _this3.selectedRows.push(i);\n });\n } else {\n this.selectedRows.push(this.currentRow);\n }\n } else {\n this.selectedRows.push(this.currentRow);\n }\n\n this.startOffset = box.top - 6;\n this.startHeight = parseInt(box.height, 10);\n this.handle.style.left = box.left + 'px';\n this.handle.style.top = this.startOffset + this.startHeight + 'px';\n this.handle.style.width = headerWidth + 'px';\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n\n }, {\n key: 'refreshHandlePosition',\n value: function refreshHandlePosition() {\n this.handle.style.top = this.startOffset + this.currentHeight + 'px';\n }\n\n /**\n * Set the resize guide position.\n */\n\n }, {\n key: 'setupGuidePosition',\n value: function setupGuidePosition() {\n var handleWidth = parseInt((0, _element.outerWidth)(this.handle), 10);\n var handleRightPosition = parseInt(this.handle.style.left, 10) + handleWidth;\n var maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);\n (0, _element.addClass)(this.handle, 'active');\n (0, _element.addClass)(this.guide, 'active');\n\n this.guide.style.top = this.handle.style.top;\n this.guide.style.left = handleRightPosition + 'px';\n this.guide.style.width = maximumVisibleElementWidth - handleWidth + 'px';\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n\n }, {\n key: 'refreshGuidePosition',\n value: function refreshGuidePosition() {\n this.guide.style.top = this.handle.style.top;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n\n }, {\n key: 'hideHandleAndGuide',\n value: function hideHandleAndGuide() {\n (0, _element.removeClass)(this.handle, 'active');\n (0, _element.removeClass)(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered as a row header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n\n }, {\n key: 'checkIfRowHeader',\n value: function checkIfRowHeader(element) {\n if (element != this.hot.rootElement) {\n var parent = element.parentNode;\n\n if (parent.tagName === 'TBODY') {\n return true;\n }\n\n return this.checkIfRowHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n\n }, {\n key: 'getTHFromTargetElement',\n value: function getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n if (this.checkIfRowHeader(event.target)) {\n var th = this.getTHFromTargetElement(event.target);\n\n if (th) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n\n }, {\n key: 'afterMouseDownTimeout',\n value: function afterMouseDownTimeout() {\n var _this4 = this;\n\n var render = function render() {\n _this4.hot.forceFullRender = true;\n _this4.hot.view.render(); // updates all\n _this4.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var resize = function resize(selectedRow, forceRender) {\n var hookNewSize = _this4.hot.runHooks('beforeRowResize', selectedRow, _this4.newSize, true);\n\n if (hookNewSize !== void 0) {\n _this4.newSize = hookNewSize;\n }\n\n _this4.setManualSize(selectedRow, _this4.newSize); // double click sets auto row size\n\n if (forceRender) {\n render();\n }\n\n _this4.hot.runHooks('afterRowResize', selectedRow, _this4.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n var selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n resize(selectedRow);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n resize(selectedRow, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseDown',\n value: function onMouseDown(event) {\n var _this5 = this;\n\n if ((0, _element.hasClass)(event.target, 'manualRowResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout == null) {\n this.autoresizeTimeout = setTimeout(function () {\n return _this5.afterMouseDownTimeout();\n }, 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startY = (0, _event.pageY)(event);\n this.newSize = this.startHeight;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new row height.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n var _this6 = this;\n\n if (this.pressed) {\n this.currentHeight = this.startHeight + ((0, _event.pageY)(event) - this.startY);\n\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n _this6.newSize = _this6.setManualSize(selectedRow, _this6.currentHeight);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the row resizing.\n *\n * @private\n * @param {MouseEvent} event\n */\n\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n var _this7 = this;\n\n var render = function render() {\n _this7.hot.forceFullRender = true;\n _this7.hot.view.render(); // updates all\n _this7.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n var runHooks = function runHooks(selectedRow, forceRender) {\n _this7.hot.runHooks('beforeRowResize', selectedRow, _this7.newSize);\n\n if (forceRender) {\n render();\n }\n\n _this7.saveManualRowHeights();\n\n _this7.hot.runHooks('afterRowResize', selectedRow, _this7.newSize);\n };\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startHeight) {\n var selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n runHooks(selectedRow);\n });\n render();\n } else {\n (0, _array.arrayEach)(this.selectedRows, function (selectedRow) {\n runHooks(selectedRow, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n var _this8 = this;\n\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', function (e) {\n return _this8.onMouseOver(e);\n });\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', function (e) {\n return _this8.onMouseDown(e);\n });\n this.eventManager.addEventListener(window, 'mousemove', function (e) {\n return _this8.onMouseMove(e);\n });\n this.eventManager.addEventListener(window, 'mouseup', function (e) {\n return _this8.onMouseUp(e);\n });\n }\n\n /**\n * Cache the current row height.\n *\n * @param {Number} row Row index.\n * @param {Number} height Row height.\n * @returns {Number}\n */\n\n }, {\n key: 'setManualSize',\n value: function setManualSize(row, height) {\n row = this.hot.runHooks('modifyRow', row);\n this.manualRowHeights[row] = height;\n\n return height;\n }\n\n /**\n * Modify the provided row height, based on the plugin settings.\n *\n * @private\n * @param {Number} height Row height.\n * @param {Number} row Row index.\n * @returns {Number}\n */\n\n }, {\n key: 'onModifyRowHeight',\n value: function onModifyRowHeight(height, row) {\n if (this.enabled) {\n var autoRowSizePlugin = this.hot.getPlugin('autoRowSize');\n var autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null;\n\n row = this.hot.runHooks('modifyRow', row);\n\n var manualRowHeight = this.manualRowHeights[row];\n\n if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) {\n return manualRowHeight;\n }\n }\n\n return height;\n }\n }]);\n\n return ManualRowResize;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('manualRowResize', ManualRowResize);\n\nexports.default = ManualRowResize;\n\n/***/ }),\n/* 251 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction CellInfoCollection() {\n var collection = [];\n\n collection.getInfo = function (row, col) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n if (this[i].row <= row && this[i].row + this[i].rowspan - 1 >= row && this[i].col <= col && this[i].col + this[i].colspan - 1 >= col) {\n return this[i];\n }\n }\n };\n\n collection.setInfo = function (info) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n if (this[i].row === info.row && this[i].col === info.col) {\n this[i] = info;\n return;\n }\n }\n this.push(info);\n };\n\n collection.removeInfo = function (row, col) {\n for (var i = 0, ilen = this.length; i < ilen; i++) {\n if (this[i].row === row && this[i].col === col) {\n this.splice(i, 1);\n break;\n }\n }\n };\n\n return collection;\n}\n\n/**\n * Plugin used to merge cells in Handsontable.\n *\n * @private\n * @plugin MergeCells\n * @class MergeCells\n */\nfunction MergeCells(mergeCellsSetting) {\n this.mergedCellInfoCollection = new CellInfoCollection();\n\n if (Array.isArray(mergeCellsSetting)) {\n for (var i = 0, ilen = mergeCellsSetting.length; i < ilen; i++) {\n this.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);\n }\n }\n}\n\n/**\n * @param cellRange (CellRange)\n */\nMergeCells.prototype.canMergeRange = function (cellRange) {\n // is more than one cell selected\n return !cellRange.isSingle();\n};\n\nMergeCells.prototype.mergeRange = function (cellRange) {\n if (!this.canMergeRange(cellRange)) {\n return;\n }\n\n // normalize top left corner\n var topLeft = cellRange.getTopLeftCorner();\n var bottomRight = cellRange.getBottomRightCorner();\n\n var mergeParent = {};\n mergeParent.row = topLeft.row;\n mergeParent.col = topLeft.col;\n // TD has rowspan == 1 by default. rowspan == 2 means spread over 2 cells\n mergeParent.rowspan = bottomRight.row - topLeft.row + 1;\n mergeParent.colspan = bottomRight.col - topLeft.col + 1;\n this.mergedCellInfoCollection.setInfo(mergeParent);\n};\n\nMergeCells.prototype.mergeOrUnmergeSelection = function (cellRange) {\n var info = this.mergedCellInfoCollection.getInfo(cellRange.from.row, cellRange.from.col);\n if (info) {\n // unmerge\n this.unmergeSelection(cellRange.from);\n } else {\n // merge\n this.mergeSelection(cellRange);\n }\n};\n\nMergeCells.prototype.mergeSelection = function (cellRange) {\n this.mergeRange(cellRange);\n};\n\nMergeCells.prototype.unmergeSelection = function (cellRange) {\n var info = this.mergedCellInfoCollection.getInfo(cellRange.row, cellRange.col);\n this.mergedCellInfoCollection.removeInfo(info.row, info.col);\n};\n\nMergeCells.prototype.applySpanProperties = function (TD, row, col) {\n var info = this.mergedCellInfoCollection.getInfo(row, col);\n\n if (info) {\n if (info.row === row && info.col === col) {\n TD.setAttribute('rowspan', info.rowspan);\n TD.setAttribute('colspan', info.colspan);\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n\n TD.style.display = 'none';\n }\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n }\n};\n\nMergeCells.prototype.modifyTransform = function (hook, currentSelectedRange, delta) {\n var sameRowspan = function sameRowspan(merged, coords) {\n if (coords.row >= merged.row && coords.row <= merged.row + merged.rowspan - 1) {\n return true;\n }\n return false;\n },\n sameColspan = function sameColspan(merged, coords) {\n if (coords.col >= merged.col && coords.col <= merged.col + merged.colspan - 1) {\n return true;\n }\n return false;\n },\n getNextPosition = function getNextPosition(newDelta) {\n return new _src.CellCoords(currentSelectedRange.to.row + newDelta.row, currentSelectedRange.to.col + newDelta.col);\n };\n\n var newDelta = {\n row: delta.row,\n col: delta.col\n };\n\n if (hook == 'modifyTransformStart') {\n /* eslint-disable block-scoped-var */\n var nextPosition;\n\n if (!this.lastDesiredCoords) {\n this.lastDesiredCoords = new _src.CellCoords(null, null);\n }\n var currentPosition = new _src.CellCoords(currentSelectedRange.highlight.row, currentSelectedRange.highlight.col),\n\n // if current position's parent is a merged range, returns it\n mergedParent = this.mergedCellInfoCollection.getInfo(currentPosition.row, currentPosition.col),\n currentRangeContainsMerge; // if current range contains a merged range\n\n for (var i = 0, mergesLength = this.mergedCellInfoCollection.length; i < mergesLength; i++) {\n var range = this.mergedCellInfoCollection[i];\n range = new _src.CellCoords(range.row + range.rowspan - 1, range.col + range.colspan - 1);\n if (currentSelectedRange.includes(range)) {\n currentRangeContainsMerge = true;\n break;\n }\n }\n\n if (mergedParent) {\n // only merge selected\n var mergeTopLeft = new _src.CellCoords(mergedParent.row, mergedParent.col);\n var mergeBottomRight = new _src.CellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1);\n var mergeRange = new _src.CellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight);\n\n if (!mergeRange.includes(this.lastDesiredCoords)) {\n this.lastDesiredCoords = new _src.CellCoords(null, null); // reset outdated version of lastDesiredCoords\n }\n\n newDelta.row = this.lastDesiredCoords.row ? this.lastDesiredCoords.row - currentPosition.row : newDelta.row;\n newDelta.col = this.lastDesiredCoords.col ? this.lastDesiredCoords.col - currentPosition.col : newDelta.col;\n\n if (delta.row > 0) {\n // moving down\n newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row;\n } else if (delta.row < 0) {\n // moving up\n newDelta.row = currentPosition.row - mergedParent.row + delta.row;\n }\n if (delta.col > 0) {\n // moving right\n newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col;\n } else if (delta.col < 0) {\n // moving left\n newDelta.col = currentPosition.col - mergedParent.col + delta.col;\n }\n }\n\n nextPosition = new _src.CellCoords(currentSelectedRange.highlight.row + newDelta.row, currentSelectedRange.highlight.col + newDelta.col);\n\n var nextParentIsMerged = this.mergedCellInfoCollection.getInfo(nextPosition.row, nextPosition.col);\n\n if (nextParentIsMerged) {\n // skipping the invisible cells in the merge range\n this.lastDesiredCoords = nextPosition;\n newDelta = {\n row: nextParentIsMerged.row - currentPosition.row,\n col: nextParentIsMerged.col - currentPosition.col\n };\n }\n } else if (hook == 'modifyTransformEnd') {\n for (var _i = 0, _mergesLength = this.mergedCellInfoCollection.length; _i < _mergesLength; _i++) {\n var currentMerge = this.mergedCellInfoCollection[_i];\n var _mergeTopLeft = new _src.CellCoords(currentMerge.row, currentMerge.col);\n var _mergeBottomRight = new _src.CellCoords(currentMerge.row + currentMerge.rowspan - 1, currentMerge.col + currentMerge.colspan - 1);\n var mergedRange = new _src.CellRange(_mergeTopLeft, _mergeTopLeft, _mergeBottomRight);\n var sharedBorders = currentSelectedRange.getBordersSharedWith(mergedRange);\n\n if (mergedRange.isEqual(currentSelectedRange)) {\n // only the merged range is selected\n currentSelectedRange.setDirection('NW-SE');\n } else if (sharedBorders.length > 0) {\n var mergeHighlighted = currentSelectedRange.highlight.isEqual(mergedRange.from);\n\n if (sharedBorders.indexOf('top') > -1) {\n // if range shares a border with the merged section, change range direction accordingly\n if (currentSelectedRange.to.isSouthEastOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('NW-SE');\n } else if (currentSelectedRange.to.isSouthWestOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('NE-SW');\n }\n } else if (sharedBorders.indexOf('bottom') > -1) {\n if (currentSelectedRange.to.isNorthEastOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('SW-NE');\n } else if (currentSelectedRange.to.isNorthWestOf(mergedRange.from) && mergeHighlighted) {\n currentSelectedRange.setDirection('SE-NW');\n }\n }\n }\n\n nextPosition = getNextPosition(newDelta);\n var withinRowspan = sameRowspan(currentMerge, nextPosition),\n withinColspan = sameColspan(currentMerge, nextPosition);\n\n if (currentSelectedRange.includesRange(mergedRange) && (mergedRange.includes(nextPosition) || withinRowspan || withinColspan)) {\n // if next step overlaps a merged range, jump past it\n if (withinRowspan) {\n if (newDelta.row < 0) {\n newDelta.row -= currentMerge.rowspan - 1;\n } else if (newDelta.row > 0) {\n newDelta.row += currentMerge.rowspan - 1;\n }\n }\n if (withinColspan) {\n if (newDelta.col < 0) {\n newDelta.col -= currentMerge.colspan - 1;\n } else if (newDelta.col > 0) {\n newDelta.col += currentMerge.colspan - 1;\n }\n }\n }\n }\n }\n\n if (newDelta.row !== 0) {\n delta.row = newDelta.row;\n }\n if (newDelta.col !== 0) {\n delta.col = newDelta.col;\n }\n};\n\nMergeCells.prototype.shiftCollection = function (direction, index, count) {\n var shiftVector = [0, 0];\n\n switch (direction) {\n case 'right':\n shiftVector[0] += 1;\n\n break;\n case 'left':\n shiftVector[0] -= 1;\n\n break;\n case 'down':\n shiftVector[1] += 1;\n\n break;\n case 'up':\n shiftVector[1] -= 1;\n\n break;\n default:\n break;\n }\n\n for (var i = 0; i < this.mergedCellInfoCollection.length; i++) {\n var currentMerge = this.mergedCellInfoCollection[i];\n\n if (direction === 'right' || direction === 'left') {\n if (index <= currentMerge.col) {\n currentMerge.col += shiftVector[0];\n }\n } else if (index <= currentMerge.row) {\n currentMerge.row += shiftVector[1];\n }\n }\n};\n\nvar beforeInit = function beforeInit() {\n var instance = this;\n var mergeCellsSetting = instance.getSettings().mergeCells;\n\n if (mergeCellsSetting) {\n if (!instance.mergeCells) {\n instance.mergeCells = new MergeCells(mergeCellsSetting);\n }\n }\n};\n\nvar afterInit = function afterInit() {\n var instance = this;\n if (instance.mergeCells) {\n /**\n * Monkey patch Table.prototype.getCell to return TD for merged cell parent if asked for TD of a cell that is\n * invisible due to the merge. This is not the cleanest solution but there is a test case for it (merged cells scroll) so feel free to refactor it!\n */\n instance.view.wt.wtTable.getCell = function (coords) {\n if (instance.getSettings().mergeCells) {\n var mergeParent = instance.mergeCells.mergedCellInfoCollection.getInfo(coords.row, coords.col);\n if (mergeParent) {\n coords = mergeParent;\n }\n }\n return _src.Table.prototype.getCell.call(this, coords);\n };\n }\n};\n\nvar afterUpdateSettings = function afterUpdateSettings() {\n var instance = this;\n var mergeCellsSetting = instance.getSettings().mergeCells;\n\n if (mergeCellsSetting) {\n if (instance.mergeCells) {\n instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();\n\n if (Array.isArray(mergeCellsSetting)) {\n for (var i = 0, ilen = mergeCellsSetting.length; i < ilen; i++) {\n instance.mergeCells.mergedCellInfoCollection.setInfo(mergeCellsSetting[i]);\n }\n }\n } else {\n instance.mergeCells = new MergeCells(mergeCellsSetting);\n }\n } else if (instance.mergeCells) {\n // it doesn't actually turn off the plugin, just resets the settings. Need to refactor.\n instance.mergeCells.mergedCellInfoCollection = new CellInfoCollection();\n }\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n if (!this.mergeCells) {\n return;\n }\n\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode === 77) {\n // CTRL + M\n this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());\n this.render();\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n};\n\nvar addMergeActionsToContextMenu = function addMergeActionsToContextMenu(defaultOptions) {\n if (!this.getSettings().mergeCells) {\n return;\n }\n\n defaultOptions.items.push({ name: '---------' });\n defaultOptions.items.push({\n key: 'mergeCells',\n name: function name() {\n var sel = this.getSelected();\n var info = this.mergeCells.mergedCellInfoCollection.getInfo(sel[0], sel[1]);\n if (info) {\n return 'Unmerge cells';\n }\n return 'Merge cells';\n },\n callback: function callback() {\n this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange());\n this.render();\n },\n disabled: function disabled() {\n return this.selection.selectedHeader.corner;\n }\n });\n};\n\nvar afterRenderer = function afterRenderer(TD, row, col, prop, value, cellProperties) {\n if (this.mergeCells) {\n this.mergeCells.applySpanProperties(TD, row, col);\n }\n};\n\nvar modifyTransformFactory = function modifyTransformFactory(hook) {\n return function (delta) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var currentSelectedRange = this.getSelectedRange();\n this.mergeCells.modifyTransform(hook, currentSelectedRange, delta);\n\n if (hook === 'modifyTransformEnd') {\n // sanitize \"from\" (core.js will sanitize to)\n var totalRows = this.countRows();\n var totalCols = this.countCols();\n if (currentSelectedRange.from.row < 0) {\n currentSelectedRange.from.row = 0;\n } else if (currentSelectedRange.from.row > 0 && currentSelectedRange.from.row >= totalRows) {\n currentSelectedRange.from.row = currentSelectedRange.from - 1;\n }\n\n if (currentSelectedRange.from.col < 0) {\n currentSelectedRange.from.col = 0;\n } else if (currentSelectedRange.from.col > 0 && currentSelectedRange.from.col >= totalCols) {\n currentSelectedRange.from.col = totalCols - 1;\n }\n }\n }\n };\n};\n\n/**\n * While selecting cells with keyboard or mouse, make sure that rectangular area is expanded to the extent of the merged cell\n * @param coords\n */\nvar beforeSetRangeEnd = function beforeSetRangeEnd(coords) {\n\n this.lastDesiredCoords = null; // unset lastDesiredCoords when selection is changed with mouse\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var selRange = this.getSelectedRange();\n selRange.highlight = new _src.CellCoords(selRange.highlight.row, selRange.highlight.col); // clone in case we will modify its reference\n selRange.to = coords;\n\n var rangeExpanded = false;\n do {\n rangeExpanded = false;\n\n for (var i = 0, ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {\n var cellInfo = this.mergeCells.mergedCellInfoCollection[i];\n var mergedCellTopLeft = new _src.CellCoords(cellInfo.row, cellInfo.col);\n var mergedCellBottomRight = new _src.CellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);\n\n var mergedCellRange = new _src.CellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);\n if (selRange.expandByRange(mergedCellRange)) {\n coords.row = selRange.to.row;\n coords.col = selRange.to.col;\n\n rangeExpanded = true;\n }\n }\n } while (rangeExpanded);\n }\n};\n\n/**\n * Returns correct coordinates for merged start / end cells in selection for area borders\n * @param corners\n * @param className\n */\nvar beforeDrawAreaBorders = function beforeDrawAreaBorders(corners, className) {\n if (className && className == 'area') {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var selRange = this.getSelectedRange();\n var startRange = new _src.CellRange(selRange.from, selRange.from, selRange.from);\n var stopRange = new _src.CellRange(selRange.to, selRange.to, selRange.to);\n\n for (var i = 0, ilen = this.mergeCells.mergedCellInfoCollection.length; i < ilen; i++) {\n var cellInfo = this.mergeCells.mergedCellInfoCollection[i];\n var mergedCellTopLeft = new _src.CellCoords(cellInfo.row, cellInfo.col);\n var mergedCellBottomRight = new _src.CellCoords(cellInfo.row + cellInfo.rowspan - 1, cellInfo.col + cellInfo.colspan - 1);\n var mergedCellRange = new _src.CellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);\n\n if (startRange.expandByRange(mergedCellRange)) {\n corners[0] = startRange.from.row;\n corners[1] = startRange.from.col;\n }\n\n if (stopRange.expandByRange(mergedCellRange)) {\n corners[2] = stopRange.from.row;\n corners[3] = stopRange.from.col;\n }\n }\n }\n }\n};\n\nvar afterGetCellMeta = function afterGetCellMeta(row, col, cellProperties) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(row, col);\n if (mergeParent && (mergeParent.row != row || mergeParent.col != col)) {\n cellProperties.copyable = false;\n }\n }\n};\n\nvar afterViewportRowCalculatorOverride = function afterViewportRowCalculatorOverride(calc) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var colCount = this.countCols();\n var mergeParent;\n for (var c = 0; c < colCount; c++) {\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.startRow, c);\n if (mergeParent) {\n if (mergeParent.row < calc.startRow) {\n calc.startRow = mergeParent.row;\n return afterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(calc.endRow, c);\n if (mergeParent) {\n var mergeEnd = mergeParent.row + mergeParent.rowspan - 1;\n if (mergeEnd > calc.endRow) {\n calc.endRow = mergeEnd;\n return afterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n }\n }\n};\n\nvar afterViewportColumnCalculatorOverride = function afterViewportColumnCalculatorOverride(calc) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n if (mergeCellsSetting) {\n var rowCount = this.countRows();\n var mergeParent;\n for (var r = 0; r < rowCount; r++) {\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.startColumn);\n\n if (mergeParent) {\n if (mergeParent.col < calc.startColumn) {\n calc.startColumn = mergeParent.col;\n return afterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n mergeParent = this.mergeCells.mergedCellInfoCollection.getInfo(r, calc.endColumn);\n if (mergeParent) {\n var mergeEnd = mergeParent.col + mergeParent.colspan - 1;\n if (mergeEnd > calc.endColumn) {\n calc.endColumn = mergeEnd;\n return afterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n }\n }\n};\n\nvar isMultipleSelection = function isMultipleSelection(isMultiple) {\n if (isMultiple && this.mergeCells) {\n var mergedCells = this.mergeCells.mergedCellInfoCollection,\n selectionRange = this.getSelectedRange();\n\n for (var group in mergedCells) {\n if (selectionRange.highlight.row == mergedCells[group].row && selectionRange.highlight.col == mergedCells[group].col && selectionRange.to.row == mergedCells[group].row + mergedCells[group].rowspan - 1 && selectionRange.to.col == mergedCells[group].col + mergedCells[group].colspan - 1) {\n return false;\n }\n }\n }\n return isMultiple;\n};\n\nfunction modifyAutofillRange(select, drag) {\n var mergeCellsSetting = this.getSettings().mergeCells;\n\n if (!mergeCellsSetting || this.selection.isMultiple()) {\n return;\n }\n var info = this.mergeCells.mergedCellInfoCollection.getInfo(select[0], select[1]);\n\n if (info) {\n select[0] = info.row;\n select[1] = info.col;\n select[2] = info.row + info.rowspan - 1;\n select[3] = info.col + info.colspan - 1;\n }\n}\n\nfunction onAfterCreateCol(col, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('right', col, count);\n }\n}\n\nfunction onAfterRemoveCol(col, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('left', col, count);\n }\n}\n\nfunction onAfterCreateRow(row, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('down', row, count);\n }\n}\n\nfunction onAfterRemoveRow(row, count) {\n if (this.mergeCells) {\n this.mergeCells.shiftCollection('up', row, count);\n }\n}\n\nvar hook = _pluginHooks2.default.getSingleton();\n\nhook.add('beforeInit', beforeInit);\nhook.add('afterInit', afterInit);\nhook.add('afterUpdateSettings', afterUpdateSettings);\nhook.add('beforeKeyDown', onBeforeKeyDown);\nhook.add('modifyTransformStart', modifyTransformFactory('modifyTransformStart'));\nhook.add('modifyTransformEnd', modifyTransformFactory('modifyTransformEnd'));\nhook.add('beforeSetRangeEnd', beforeSetRangeEnd);\nhook.add('beforeDrawBorders', beforeDrawAreaBorders);\nhook.add('afterIsMultipleSelection', isMultipleSelection);\nhook.add('afterRenderer', afterRenderer);\nhook.add('afterContextMenuDefaultOptions', addMergeActionsToContextMenu);\nhook.add('afterGetCellMeta', afterGetCellMeta);\nhook.add('afterViewportRowCalculatorOverride', afterViewportRowCalculatorOverride);\nhook.add('afterViewportColumnCalculatorOverride', afterViewportColumnCalculatorOverride);\nhook.add('modifyAutofillRange', modifyAutofillRange);\nhook.add('afterCreateCol', onAfterCreateCol);\nhook.add('afterRemoveCol', onAfterRemoveCol);\nhook.add('afterCreateRow', onAfterCreateRow);\nhook.add('afterRemoveRow', onAfterRemoveRow);\n\nexports.default = MergeCells;\n\n/***/ }),\n/* 252 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _browser = __webpack_require__(25);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _plugins = __webpack_require__(5);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @plugin MultipleSelectionHandles\n */\nvar MultipleSelectionHandles = function (_BasePlugin) {\n _inherits(MultipleSelectionHandles, _BasePlugin);\n\n /**\n * @param {Object} hotInstance\n */\n function MultipleSelectionHandles(hotInstance) {\n _classCallCheck(this, MultipleSelectionHandles);\n\n /**\n * @type {Array}\n */\n var _this2 = _possibleConstructorReturn(this, (MultipleSelectionHandles.__proto__ || Object.getPrototypeOf(MultipleSelectionHandles)).call(this, hotInstance));\n\n _this2.dragged = [];\n /**\n * Instance of EventManager.\n *\n * @type {EventManager}\n */\n _this2.eventManager = null;\n /**\n * @type {null}\n */\n _this2.lastSetCell = null;\n return _this2;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(MultipleSelectionHandles, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return (0, _browser.isMobileBrowser)();\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n if (this.enabled) {\n return;\n }\n if (!this.eventManager) {\n this.eventManager = new _eventManager2.default(this);\n }\n this.registerListeners();\n _get(MultipleSelectionHandles.prototype.__proto__ || Object.getPrototypeOf(MultipleSelectionHandles.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Bind the touch events\n * @private\n */\n\n }, {\n key: 'registerListeners',\n value: function registerListeners() {\n var _this = this;\n\n function removeFromDragged(query) {\n\n if (_this.dragged.length === 1) {\n // clear array\n _this.dragged.splice(0, _this.dragged.length);\n\n return true;\n }\n\n var entryPosition = _this.dragged.indexOf(query);\n\n if (entryPosition == -1) {\n return false;\n } else if (entryPosition === 0) {\n _this.dragged = _this.dragged.slice(0, 1);\n } else if (entryPosition == 1) {\n _this.dragged = _this.dragged.slice(-1);\n }\n }\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', function (event) {\n var selectedRange = void 0;\n\n if ((0, _element.hasClass)(event.target, 'topLeftSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRange();\n\n _this.dragged.push('topLeft');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n } else if ((0, _element.hasClass)(event.target, 'bottomRightSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRange();\n\n _this.dragged.push('bottomRight');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchend', function (event) {\n if ((0, _element.hasClass)(event.target, 'topLeftSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'topLeft');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n } else if ((0, _element.hasClass)(event.target, 'bottomRightSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'bottomRight');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', function (event) {\n var scrollTop = (0, _element.getWindowScrollTop)(),\n scrollLeft = (0, _element.getWindowScrollLeft)(),\n endTarget = void 0,\n targetCoords = void 0,\n selectedRange = void 0,\n rangeWidth = void 0,\n rangeHeight = void 0,\n rangeDirection = void 0,\n newRangeCoords = void 0;\n\n if (_this.dragged.length === 0) {\n return;\n }\n\n endTarget = document.elementFromPoint(event.touches[0].screenX - scrollLeft, event.touches[0].screenY - scrollTop);\n\n if (!endTarget || endTarget === _this.lastSetCell) {\n return;\n }\n\n if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') {\n targetCoords = _this.hot.getCoords(endTarget);\n\n if (targetCoords.col == -1) {\n targetCoords.col = 0;\n }\n\n selectedRange = _this.hot.getSelectedRange();\n rangeWidth = selectedRange.getWidth();\n rangeHeight = selectedRange.getHeight();\n rangeDirection = selectedRange.getDirection();\n\n if (rangeWidth == 1 && rangeHeight == 1) {\n _this.hot.selection.setRangeEnd(targetCoords);\n }\n\n newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]);\n\n if (newRangeCoords.start !== null) {\n _this.hot.selection.setRangeStart(newRangeCoords.start);\n }\n\n _this.hot.selection.setRangeEnd(newRangeCoords.end);\n\n _this.lastSetCell = endTarget;\n }\n\n event.preventDefault();\n });\n }\n }, {\n key: 'getCurrentRangeCoords',\n value: function getCurrentRangeCoords(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) {\n var topLeftCorner = selectedRange.getTopLeftCorner(),\n bottomRightCorner = selectedRange.getBottomRightCorner(),\n bottomLeftCorner = selectedRange.getBottomLeftCorner(),\n topRightCorner = selectedRange.getTopRightCorner();\n\n var newCoords = {\n start: null,\n end: null\n };\n\n switch (touchStartDirection) {\n case 'NE-SW':\n switch (currentDirection) {\n case 'NE-SW':\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, selectedRange.highlight.col),\n end: new _src.CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(bottomRightCorner.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'NW-SE':\n switch (currentDirection) {\n case 'NE-SW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n default:\n break;\n }\n break;\n case 'SW-NE':\n switch (currentDirection) {\n case 'NW-SE':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topLeftCorner.col),\n end: new _src.CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(topLeftCorner.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n }\n break;\n // case 'NE-SW':\n //\n // break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new _src.CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new _src.CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n } else {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topLeftCorner.col),\n end: new _src.CellCoords(topLeftCorner.row, currentTouch.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new _src.CellCoords(currentTouch.row, topRightCorner.col),\n end: new _src.CellCoords(topLeftCorner.row, currentTouch.col)\n };\n } else if (draggedHandle == 'topLeft') {\n newCoords = {\n start: bottomLeftCorner,\n end: currentTouch\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'SE-NW':\n switch (currentDirection) {\n case 'NW-SE':\n case 'NE-SW':\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n } else {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return newCoords;\n }\n\n /**\n * Check if user is currently dragging the handle.\n *\n * @returns {boolean} Dragging state\n */\n\n }, {\n key: 'isDragged',\n value: function isDragged() {\n return this.dragged.length > 0;\n }\n }]);\n\n return MultipleSelectionHandles;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('multipleSelectionHandles', MultipleSelectionHandles);\n\nexports.default = MultipleSelectionHandles;\n\n/***/ }),\n/* 253 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _jsonPatchDuplex = __webpack_require__(133);\n\nvar _jsonPatchDuplex2 = _interopRequireDefault(_jsonPatchDuplex);\n\nvar _localHooks = __webpack_require__(150);\n\nvar _localHooks2 = _interopRequireDefault(_localHooks);\n\nvar _object = __webpack_require__(2);\n\nvar _utils = __webpack_require__(255);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class DataObserver\n * @plugin ObserveChanges\n */\nvar DataObserver = function () {\n function DataObserver(observedData) {\n _classCallCheck(this, DataObserver);\n\n /**\n * Observed source data.\n *\n * @type {Array}\n */\n this.observedData = null;\n /**\n * JsonPatch observer.\n *\n * @type {Object}\n */\n this.observer = null;\n /**\n * Flag which determines if observer is paused or not. Paused observer doesn't emit `change` hooks.\n *\n * @type {Boolean}\n * @default false\n */\n this.paused = false;\n\n this.setObservedData(observedData);\n }\n\n /**\n * Set data to observe.\n *\n * @param {*} observedData\n */\n\n\n _createClass(DataObserver, [{\n key: 'setObservedData',\n value: function setObservedData(observedData) {\n var _this = this;\n\n if (this.observer) {\n _jsonPatchDuplex2.default.unobserve(this.observedData, this.observer);\n }\n this.observedData = observedData;\n this.observer = _jsonPatchDuplex2.default.observe(this.observedData, function (patches) {\n return _this.onChange(patches);\n });\n }\n\n /**\n * Check if observer was paused.\n *\n * @returns {Boolean}\n */\n\n }, {\n key: 'isPaused',\n value: function isPaused() {\n return this.paused;\n }\n\n /**\n * Pause observer (stop emitting all detected changes).\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n\n /**\n * Resume observer (emit all detected changes).\n */\n\n }, {\n key: 'resume',\n value: function resume() {\n this.paused = false;\n }\n\n /**\n * JsonPatch on change listener.\n *\n * @private\n * @param {Array} patches An array of object passed from jsonpatch.\n */\n\n }, {\n key: 'onChange',\n value: function onChange(patches) {\n this.runLocalHooks('change', (0, _utils.cleanPatches)(patches));\n }\n\n /**\n * Destroy observer instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n _jsonPatchDuplex2.default.unobserve(this.observedData, this.observer);\n this.observedData = null;\n this.observer = null;\n }\n }]);\n\n return DataObserver;\n}();\n\n(0, _object.mixin)(DataObserver, _localHooks2.default);\n\nexports.default = DataObserver;\n\n/***/ }),\n/* 254 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _jsonPatchDuplex = __webpack_require__(133);\n\nvar _jsonPatchDuplex2 = _interopRequireDefault(_jsonPatchDuplex);\n\nvar _dataObserver = __webpack_require__(253);\n\nvar _dataObserver2 = _interopRequireDefault(_dataObserver);\n\nvar _array = __webpack_require__(1);\n\nvar _plugins = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Handsontable.hooks.register('afterChangesObserved');\n\n/**\n * @plugin ObserveChanges\n *\n * @description\n * This plugin allows to observe data source changes.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled.\n * Enabling this plugin switches the table into one-way data binding where changes are applied into the data source (outside from the table)\n * will be automatically reflected in the table.\n *\n * ```js\n * ...\n * // as a boolean\n * observeChanges: true,\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#observeChanges}.\n */\nvar ObserveChanges = function (_BasePlugin) {\n _inherits(ObserveChanges, _BasePlugin);\n\n function ObserveChanges(hotInstance) {\n _classCallCheck(this, ObserveChanges);\n\n /**\n * Instance of {@link DataObserver}.\n *\n * @type {DataObserver}\n */\n var _this = _possibleConstructorReturn(this, (ObserveChanges.__proto__ || Object.getPrototypeOf(ObserveChanges)).call(this, hotInstance));\n\n _this.observer = null;\n return _this;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(ObserveChanges, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return this.hot.getSettings().observeChanges;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n if (!this.observer) {\n this.observer = new _dataObserver2.default(this.hot.getSourceData());\n this._exposePublicApi();\n }\n\n this.observer.addLocalHook('change', function (patches) {\n return _this2.onDataChange(patches);\n });\n this.addHook('afterCreateRow', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterRemoveRow', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterCreateCol', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterRemoveCol', function () {\n return _this2.onAfterTableAlter();\n });\n this.addHook('afterChange', function (changes, source) {\n return _this2.onAfterTableAlter(source);\n });\n this.addHook('afterLoadData', function (firstRun) {\n return _this2.onAfterLoadData(firstRun);\n });\n\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n if (this.observer) {\n this.observer.destroy();\n this.observer = null;\n this._deletePublicApi();\n }\n\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Data change observer.\n *\n * @private\n * @param {Array} patches An array of objects which every item defines coordinates where data was changed.\n */\n\n }, {\n key: 'onDataChange',\n value: function onDataChange(patches) {\n var _this3 = this;\n\n if (!this.observer.isPaused()) {\n var sourceName = this.pluginName + '.change';\n var actions = {\n add: function add(patch) {\n if (isNaN(patch.col)) {\n _this3.hot.runHooks('afterCreateRow', patch.row, 1, sourceName);\n } else {\n _this3.hot.runHooks('afterCreateCol', patch.col, 1, sourceName);\n }\n },\n remove: function remove(patch) {\n if (isNaN(patch.col)) {\n _this3.hot.runHooks('afterRemoveRow', patch.row, 1, sourceName);\n } else {\n _this3.hot.runHooks('afterRemoveCol', patch.col, 1, sourceName);\n }\n },\n replace: function replace(patch) {\n _this3.hot.runHooks('afterChange', [patch.row, patch.col, null, patch.value], sourceName);\n }\n };\n\n (0, _array.arrayEach)(patches, function (patch) {\n if (actions[patch.op]) {\n actions[patch.op](patch);\n }\n });\n this.hot.render();\n }\n\n this.hot.runHooks('afterChangesObserved');\n }\n\n /**\n * On after table alter listener. Prevents infinity loop between internal and external data changing.\n *\n * @private\n * @param source\n */\n\n }, {\n key: 'onAfterTableAlter',\n value: function onAfterTableAlter(source) {\n var _this4 = this;\n\n if (source !== 'loadData') {\n this.observer.pause();\n this.hot.addHookOnce('afterChangesObserved', function () {\n return _this4.observer.resume();\n });\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n * @param {Boolean} firstRun `true` if event was fired first time.\n */\n\n }, {\n key: 'onAfterLoadData',\n value: function onAfterLoadData(firstRun) {\n if (!firstRun) {\n this.observer.setObservedData(this.hot.getSourceData());\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this.observer) {\n this.observer.destroy();\n this._deletePublicApi();\n }\n _get(ObserveChanges.prototype.__proto__ || Object.getPrototypeOf(ObserveChanges.prototype), 'destroy', this).call(this);\n }\n\n /**\n * Expose plugins methods to the core.\n *\n * @private\n */\n\n }, {\n key: '_exposePublicApi',\n value: function _exposePublicApi() {\n var _this5 = this;\n\n var hot = this.hot;\n\n hot.pauseObservingChanges = function () {\n return _this5.observer.pause();\n };\n hot.resumeObservingChanges = function () {\n return _this5.observer.resume();\n };\n hot.isPausedObservingChanges = function () {\n return _this5.observer.isPaused();\n };\n }\n\n /**\n * Delete all previously exposed methods.\n *\n * @private\n */\n\n }, {\n key: '_deletePublicApi',\n value: function _deletePublicApi() {\n var hot = this.hot;\n\n delete hot.pauseObservingChanges;\n delete hot.resumeObservingChanges;\n delete hot.isPausedObservingChanges;\n }\n }]);\n\n return ObserveChanges;\n}(_base2.default);\n\nexports.default = ObserveChanges;\n\n\n(0, _plugins.registerPlugin)('observeChanges', ObserveChanges);\n\n/***/ }),\n/* 255 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.cleanPatches = cleanPatches;\nexports.parsePath = parsePath;\n\nvar _array = __webpack_require__(1);\n\n/**\n * Clean and extend patches from jsonpatch observer.\n *\n * @param {Array} patches\n * @returns {Array}\n */\nfunction cleanPatches(patches) {\n var newOrRemovedColumns = [];\n\n /**\n * If observeChanges uses native Object.observe method, then it produces patches for length property. Filter them.\n * If path can't be parsed. Filter it.\n */\n patches = (0, _array.arrayFilter)(patches, function (patch) {\n if (/[/]length/ig.test(patch.path)) {\n return false;\n }\n if (!parsePath(patch.path)) {\n return false;\n }\n\n return true;\n });\n /**\n * Extend patches with changed cells coords\n */\n patches = (0, _array.arrayMap)(patches, function (patch) {\n var coords = parsePath(patch.path);\n\n patch.row = coords.row;\n patch.col = coords.col;\n\n return patch;\n });\n /**\n * Removing or adding column will produce one patch for each table row.\n * Leaves only one patch for each column add/remove operation.\n */\n patches = (0, _array.arrayFilter)(patches, function (patch) {\n if (['add', 'remove'].indexOf(patch.op) !== -1 && !isNaN(patch.col)) {\n if (newOrRemovedColumns.indexOf(patch.col) !== -1) {\n return false;\n }\n newOrRemovedColumns.push(patch.col);\n }\n\n return true;\n });\n newOrRemovedColumns.length = 0;\n\n return patches;\n}\n\n/**\n * Extract coordinates from path where data was changed.\n *\n * @param {String} path Path describing where data was changed.\n * @returns {Object|null} Returns an object with `row` and `col` properties or `null` if path doesn't have necessary information.\n */\nfunction parsePath(path) {\n var match = path.match(/^\\/(\\d+)\\/?(.*)?$/);\n\n if (!match) {\n return null;\n }\n\n var _match = _slicedToArray(match, 3),\n row = _match[1],\n column = _match[2];\n\n return {\n row: parseInt(row, 10),\n col: /^\\d*$/.test(column) ? parseInt(column, 10) : column\n };\n}\n\n/***/ }),\n/* 256 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _plugins = __webpack_require__(5);\n\nvar _object = __webpack_require__(2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Storage(prefix) {\n var savedKeys;\n\n var saveSavedKeys = function saveSavedKeys() {\n window.localStorage[prefix + '__persistentStateKeys'] = JSON.stringify(savedKeys);\n };\n\n var loadSavedKeys = function loadSavedKeys() {\n var keysJSON = window.localStorage[prefix + '__persistentStateKeys'];\n var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0;\n savedKeys = keys ? keys : [];\n };\n\n var clearSavedKeys = function clearSavedKeys() {\n savedKeys = [];\n saveSavedKeys();\n };\n\n loadSavedKeys();\n\n this.saveValue = function (key, value) {\n window.localStorage[prefix + '_' + key] = JSON.stringify(value);\n if (savedKeys.indexOf(key) == -1) {\n savedKeys.push(key);\n saveSavedKeys();\n }\n };\n\n this.loadValue = function (key, defaultValue) {\n\n key = typeof key === 'undefined' ? defaultValue : key;\n\n var value = window.localStorage[prefix + '_' + key];\n\n return typeof value == 'undefined' ? void 0 : JSON.parse(value);\n };\n\n this.reset = function (key) {\n window.localStorage.removeItem(prefix + '_' + key);\n };\n\n this.resetAll = function () {\n for (var index = 0; index < savedKeys.length; index++) {\n window.localStorage.removeItem(prefix + '_' + savedKeys[index]);\n }\n\n clearSavedKeys();\n };\n}\n\n/**\n * @private\n * @class PersistentState\n * @plugin PersistentState\n */\nfunction HandsontablePersistentState() {\n var plugin = this;\n\n this.init = function () {\n var instance = this,\n pluginSettings = instance.getSettings().persistentState;\n\n plugin.enabled = !!pluginSettings;\n\n if (!plugin.enabled) {\n removeHooks.call(instance);\n return;\n }\n\n if (!instance.storage) {\n instance.storage = new Storage(instance.rootElement.id);\n }\n\n instance.resetState = plugin.resetValue;\n\n addHooks.call(instance);\n };\n\n this.saveValue = function (key, value) {\n var instance = this;\n\n instance.storage.saveValue(key, value);\n };\n\n this.loadValue = function (key, saveTo) {\n var instance = this;\n\n saveTo.value = instance.storage.loadValue(key);\n };\n\n this.resetValue = function (key) {\n var instance = this;\n\n if (typeof key === 'undefined') {\n instance.storage.resetAll();\n } else {\n instance.storage.reset(key);\n }\n };\n\n var hooks = {\n persistentStateSave: plugin.saveValue,\n persistentStateLoad: plugin.loadValue,\n persistentStateReset: plugin.resetValue\n };\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n _pluginHooks2.default.getSingleton().register(hookName);\n }\n }\n\n function addHooks() {\n var instance = this;\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n instance.addHook(hookName, hooks[hookName]);\n }\n }\n }\n\n function removeHooks() {\n var instance = this;\n\n for (var hookName in hooks) {\n if ((0, _object.hasOwnProperty)(hooks, hookName)) {\n instance.removeHook(hookName, hooks[hookName]);\n }\n }\n }\n}\n\nvar htPersistentState = new HandsontablePersistentState();\n\n_pluginHooks2.default.getSingleton().add('beforeInit', htPersistentState.init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', htPersistentState.init);\n\nexports.default = HandsontablePersistentState;\n\n/***/ }),\n/* 257 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _element = __webpack_require__(0);\n\nvar _renderers = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @private\n * @plugin Search\n */\nfunction Search(instance) {\n this.query = function (queryStr, callback, queryMethod) {\n var rowCount = instance.countRows();\n var colCount = instance.countCols();\n var queryResult = [];\n\n if (!callback) {\n callback = Search.global.getDefaultCallback();\n }\n\n if (!queryMethod) {\n queryMethod = Search.global.getDefaultQueryMethod();\n }\n\n for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n for (var colIndex = 0; colIndex < colCount; colIndex++) {\n var cellData = instance.getDataAtCell(rowIndex, colIndex);\n var cellProperties = instance.getCellMeta(rowIndex, colIndex);\n var cellCallback = cellProperties.search.callback || callback;\n var cellQueryMethod = cellProperties.search.queryMethod || queryMethod;\n var testResult = cellQueryMethod(queryStr, cellData);\n\n if (testResult) {\n var singleResult = {\n row: rowIndex,\n col: colIndex,\n data: cellData\n };\n\n queryResult.push(singleResult);\n }\n\n if (cellCallback) {\n cellCallback(instance, rowIndex, colIndex, cellData, testResult);\n }\n }\n }\n\n return queryResult;\n };\n};\n\nSearch.DEFAULT_CALLBACK = function (instance, row, col, data, testResult) {\n instance.getCellMeta(row, col).isSearchResult = testResult;\n};\n\nSearch.DEFAULT_QUERY_METHOD = function (query, value) {\n if (typeof query == 'undefined' || query == null || !query.toLowerCase || query.length === 0) {\n return false;\n }\n if (typeof value == 'undefined' || value == null) {\n return false;\n }\n\n return value.toString().toLowerCase().indexOf(query.toLowerCase()) != -1;\n};\n\nSearch.DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult';\n\nSearch.global = function () {\n\n var defaultCallback = Search.DEFAULT_CALLBACK;\n var defaultQueryMethod = Search.DEFAULT_QUERY_METHOD;\n var defaultSearchResultClass = Search.DEFAULT_SEARCH_RESULT_CLASS;\n\n return {\n getDefaultCallback: function getDefaultCallback() {\n return defaultCallback;\n },\n setDefaultCallback: function setDefaultCallback(newDefaultCallback) {\n defaultCallback = newDefaultCallback;\n },\n getDefaultQueryMethod: function getDefaultQueryMethod() {\n return defaultQueryMethod;\n },\n setDefaultQueryMethod: function setDefaultQueryMethod(newDefaultQueryMethod) {\n defaultQueryMethod = newDefaultQueryMethod;\n },\n getDefaultSearchResultClass: function getDefaultSearchResultClass() {\n return defaultSearchResultClass;\n },\n setDefaultSearchResultClass: function setDefaultSearchResultClass(newSearchResultClass) {\n defaultSearchResultClass = newSearchResultClass;\n }\n };\n}();\n\nfunction SearchCellDecorator(instance, TD, row, col, prop, value, cellProperties) {\n var searchResultClass = cellProperties.search !== null && _typeof(cellProperties.search) == 'object' && cellProperties.search.searchResultClass || Search.global.getDefaultSearchResultClass();\n\n if (cellProperties.isSearchResult) {\n (0, _element.addClass)(TD, searchResultClass);\n } else {\n (0, _element.removeClass)(TD, searchResultClass);\n }\n};\n\nvar originalBaseRenderer = (0, _renderers.getRenderer)('base');\n\n(0, _renderers.registerRenderer)('base', function (instance, TD, row, col, prop, value, cellProperties) {\n originalBaseRenderer.apply(this, arguments);\n SearchCellDecorator.apply(this, arguments);\n});\n\nfunction init() {\n var instance = this;\n\n var pluginEnabled = !!instance.getSettings().search;\n\n if (pluginEnabled) {\n instance.search = new Search(instance);\n } else {\n delete instance.search;\n }\n}\n\n_pluginHooks2.default.getSingleton().add('afterInit', init);\n_pluginHooks2.default.getSingleton().add('afterUpdateSettings', init);\n\nexports.default = Search;\n\n/***/ }),\n/* 258 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _element = __webpack_require__(0);\n\nvar _array = __webpack_require__(1);\n\nvar _base = __webpack_require__(12);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _plugins = __webpack_require__(5);\n\nvar _feature = __webpack_require__(34);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @private\n * @plugin TouchScroll\n * @class TouchScroll\n */\nvar TouchScroll = function (_BasePlugin) {\n _inherits(TouchScroll, _BasePlugin);\n\n function TouchScroll(hotInstance) {\n _classCallCheck(this, TouchScroll);\n\n /**\n * Collection of scrollbars to update.\n *\n * @type {Array}\n */\n var _this = _possibleConstructorReturn(this, (TouchScroll.__proto__ || Object.getPrototypeOf(TouchScroll)).call(this, hotInstance));\n\n _this.scrollbars = [];\n /**\n * Collection of overlays to update.\n *\n * @type {Array}\n */\n _this.clones = [];\n /**\n * Flag which determines if collection of overlays should be refilled on every table render.\n *\n * @type {Boolean}\n * @default false\n */\n _this.lockedCollection = false;\n /**\n * Flag which determines if walkontable should freeze overlays while scrolling.\n *\n * @type {Boolean}\n * @default false\n */\n _this.freezeOverlays = false;\n return _this;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n\n\n _createClass(TouchScroll, [{\n key: 'isEnabled',\n value: function isEnabled() {\n return (0, _feature.isTouchSupported)();\n }\n\n /**\n * Enable the plugin.\n */\n\n }, {\n key: 'enablePlugin',\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterRender', function () {\n return _this2.onAfterRender();\n });\n this.registerEvents();\n\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'enablePlugin', this).call(this);\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n\n }, {\n key: 'updatePlugin',\n value: function updatePlugin() {\n this.lockedCollection = false;\n\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'updatePlugin', this).call(this);\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: 'disablePlugin',\n value: function disablePlugin() {\n _get(TouchScroll.prototype.__proto__ || Object.getPrototypeOf(TouchScroll.prototype), 'disablePlugin', this).call(this);\n }\n\n /**\n * Register all necessary events.\n *\n * @private\n */\n\n }, {\n key: 'registerEvents',\n value: function registerEvents() {\n var _this3 = this;\n\n this.addHook('beforeTouchScroll', function () {\n return _this3.onBeforeTouchScroll();\n });\n this.addHook('afterMomentumScroll', function () {\n return _this3.onAfterMomentumScroll();\n });\n }\n\n /**\n * After render listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterRender',\n value: function onAfterRender() {\n if (this.lockedCollection) {\n return;\n }\n\n var _hot$view$wt$wtOverla = this.hot.view.wt.wtOverlays,\n topOverlay = _hot$view$wt$wtOverla.topOverlay,\n bottomOverlay = _hot$view$wt$wtOverla.bottomOverlay,\n leftOverlay = _hot$view$wt$wtOverla.leftOverlay,\n topLeftCornerOverlay = _hot$view$wt$wtOverla.topLeftCornerOverlay,\n bottomLeftCornerOverlay = _hot$view$wt$wtOverla.bottomLeftCornerOverlay;\n\n\n this.lockedCollection = true;\n this.scrollbars.length = 0;\n this.scrollbars.push(topOverlay);\n\n if (bottomOverlay.clone) {\n this.scrollbars.push(bottomOverlay);\n }\n this.scrollbars.push(leftOverlay);\n\n if (topLeftCornerOverlay) {\n this.scrollbars.push(topLeftCornerOverlay);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.scrollbars.push(bottomLeftCornerOverlay);\n }\n\n this.clones.length = 0;\n\n if (topOverlay.needFullRender) {\n this.clones.push(topOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomOverlay.needFullRender) {\n this.clones.push(bottomOverlay.clone.wtTable.holder.parentNode);\n }\n if (leftOverlay.needFullRender) {\n this.clones.push(leftOverlay.clone.wtTable.holder.parentNode);\n }\n if (topLeftCornerOverlay) {\n this.clones.push(topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.clones.push(bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n }\n\n /**\n * Touch scroll listener.\n *\n * @private\n */\n\n }, {\n key: 'onBeforeTouchScroll',\n value: function onBeforeTouchScroll() {\n this.freezeOverlays = true;\n\n (0, _array.arrayEach)(this.clones, function (clone) {\n (0, _element.addClass)(clone, 'hide-tween');\n });\n }\n\n /**\n * After momentum scroll listener.\n *\n * @private\n */\n\n }, {\n key: 'onAfterMomentumScroll',\n value: function onAfterMomentumScroll() {\n var _this4 = this;\n\n this.freezeOverlays = false;\n\n (0, _array.arrayEach)(this.clones, function (clone) {\n (0, _element.removeClass)(clone, 'hide-tween');\n (0, _element.addClass)(clone, 'show-tween');\n });\n\n setTimeout(function () {\n (0, _array.arrayEach)(_this4.clones, function (clone) {\n (0, _element.removeClass)(clone, 'show-tween');\n });\n }, 400);\n\n (0, _array.arrayEach)(this.scrollbars, function (scrollbar) {\n scrollbar.refresh();\n scrollbar.resetFixedPosition();\n });\n\n this.hot.view.wt.wtOverlays.syncScrollWithMaster();\n }\n }]);\n\n return TouchScroll;\n}(_base2.default);\n\n(0, _plugins.registerPlugin)('touchScroll', TouchScroll);\n\nexports.default = TouchScroll;\n\n/***/ }),\n/* 259 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _pluginHooks = __webpack_require__(8);\n\nvar _pluginHooks2 = _interopRequireDefault(_pluginHooks);\n\nvar _array = __webpack_require__(1);\n\nvar _number = __webpack_require__(6);\n\nvar _object = __webpack_require__(2);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @description\n * Handsontable UndoRedo plugin. It allows to undo and redo certain actions done in the table.\n * Please note, that not all actions are currently undo-able.\n *\n * @example\n * ```js\n * ...\n * undo: true\n * ...\n * ```\n * @class UndoRedo\n * @plugin UndoRedo\n */\n/**\n * Handsontable UndoRedo class\n */\nfunction UndoRedo(instance) {\n var plugin = this;\n this.instance = instance;\n this.doneActions = [];\n this.undoneActions = [];\n this.ignoreNewActions = false;\n\n instance.addHook('afterChange', function (changes, source) {\n if (changes && source !== 'UndoRedo.undo' && source !== 'UndoRedo.redo') {\n plugin.done(new UndoRedo.ChangeAction(changes));\n }\n });\n\n instance.addHook('afterCreateRow', function (index, amount, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.undo' || source === 'auto') {\n return;\n }\n\n var action = new UndoRedo.CreateRowAction(index, amount);\n plugin.done(action);\n });\n\n instance.addHook('beforeRemoveRow', function (index, amount, logicRows, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n var originalData = plugin.instance.getSourceDataArray();\n\n index = (originalData.length + index) % originalData.length;\n\n var removedData = (0, _object.deepClone)(originalData.slice(index, index + amount));\n\n plugin.done(new UndoRedo.RemoveRowAction(index, removedData));\n });\n\n instance.addHook('afterCreateCol', function (index, amount, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n plugin.done(new UndoRedo.CreateColumnAction(index, amount));\n });\n\n instance.addHook('beforeRemoveCol', function (index, amount, logicColumns, source) {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n var originalData = plugin.instance.getSourceDataArray();\n\n index = (plugin.instance.countCols() + index) % plugin.instance.countCols();\n\n var removedData = [];\n var headers = [];\n var indexes = [];\n\n (0, _number.rangeEach)(originalData.length - 1, function (i) {\n var column = [];\n var origRow = originalData[i];\n\n (0, _number.rangeEach)(index, index + (amount - 1), function (j) {\n column.push(origRow[instance.runHooks('modifyCol', j)]);\n });\n removedData.push(column);\n });\n\n (0, _number.rangeEach)(amount - 1, function (i) {\n indexes.push(instance.runHooks('modifyCol', index + i));\n });\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n (0, _number.rangeEach)(amount - 1, function (i) {\n headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null);\n });\n }\n\n var manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove');\n\n var columnsMap = manualColumnMovePlugin.isEnabled() ? manualColumnMovePlugin.columnsMapper.__arrayMap : [];\n var action = new UndoRedo.RemoveColumnAction(index, indexes, removedData, headers, columnsMap);\n\n plugin.done(action);\n });\n\n instance.addHook('beforeCellAlignment', function (stateBefore, range, type, alignment) {\n var action = new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment);\n plugin.done(action);\n });\n\n instance.addHook('beforeFilter', function (formulaStacks) {\n plugin.done(new UndoRedo.FiltersAction(formulaStacks));\n });\n\n instance.addHook('beforeRowMove', function (movedRows, target) {\n if (movedRows === false) {\n return;\n }\n\n plugin.done(new UndoRedo.RowMoveAction(movedRows, target));\n });\n};\n\nUndoRedo.prototype.done = function (action) {\n if (!this.ignoreNewActions) {\n this.doneActions.push(action);\n this.undoneActions.length = 0;\n }\n};\n\n/**\n * Undo last edit.\n *\n * @function undo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.undo = function () {\n if (this.isUndoAvailable()) {\n var action = this.doneActions.pop();\n var actionClone = (0, _object.deepClone)(action);\n var instance = this.instance;\n\n var continueAction = instance.runHooks('beforeUndo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n var that = this;\n action.undo(this.instance, function () {\n that.ignoreNewActions = false;\n that.undoneActions.push(action);\n });\n\n instance.runHooks('afterUndo', actionClone);\n }\n};\n\n/**\n * Redo edit (used to reverse an undo).\n *\n * @function redo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.redo = function () {\n if (this.isRedoAvailable()) {\n var action = this.undoneActions.pop();\n var actionClone = (0, _object.deepClone)(action);\n var instance = this.instance;\n\n var continueAction = instance.runHooks('beforeRedo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n var that = this;\n action.redo(this.instance, function () {\n that.ignoreNewActions = false;\n that.doneActions.push(action);\n });\n\n instance.runHooks('afterRedo', actionClone);\n }\n};\n\n/**\n * Check if undo action is available.\n *\n * @function isUndoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if undo can be performed, `false` otherwise\n */\nUndoRedo.prototype.isUndoAvailable = function () {\n return this.doneActions.length > 0;\n};\n\n/**\n * Check if redo action is available.\n *\n * @function isRedoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if redo can be performed, `false` otherwise.\n */\nUndoRedo.prototype.isRedoAvailable = function () {\n return this.undoneActions.length > 0;\n};\n\n/**\n * Clears undo history.\n *\n * @function clear\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.clear = function () {\n this.doneActions.length = 0;\n this.undoneActions.length = 0;\n};\n\nUndoRedo.Action = function () {};\nUndoRedo.Action.prototype.undo = function () {};\nUndoRedo.Action.prototype.redo = function () {};\n\n/**\n * Change action.\n */\nUndoRedo.ChangeAction = function (changes) {\n this.changes = changes;\n this.actionType = 'change';\n};\n(0, _object.inherit)(UndoRedo.ChangeAction, UndoRedo.Action);\n\nUndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {\n var data = (0, _object.deepClone)(this.changes),\n emptyRowsAtTheEnd = instance.countEmptyRows(true),\n emptyColsAtTheEnd = instance.countEmptyCols(true);\n\n for (var i = 0, len = data.length; i < len; i++) {\n data[i].splice(3, 1);\n }\n\n instance.addHookOnce('afterChange', undoneCallback);\n\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.undo');\n\n for (var _i = 0, _len = data.length; _i < _len; _i++) {\n if (instance.getSettings().minSpareRows && data[_i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() && emptyRowsAtTheEnd == instance.getSettings().minSpareRows) {\n\n instance.alter('remove_row', parseInt(data[_i][0] + 1, 10), instance.getSettings().minSpareRows);\n instance.undoRedo.doneActions.pop();\n }\n\n if (instance.getSettings().minSpareCols && data[_i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() && emptyColsAtTheEnd == instance.getSettings().minSpareCols) {\n\n instance.alter('remove_col', parseInt(data[_i][1] + 1, 10), instance.getSettings().minSpareCols);\n instance.undoRedo.doneActions.pop();\n }\n }\n};\nUndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {\n var data = (0, _object.deepClone)(this.changes);\n\n for (var i = 0, len = data.length; i < len; i++) {\n data[i].splice(2, 1);\n }\n\n instance.addHookOnce('afterChange', onFinishCallback);\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.redo');\n};\n\n/**\n * Create row action.\n */\nUndoRedo.CreateRowAction = function (index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_row';\n};\n(0, _object.inherit)(UndoRedo.CreateRowAction, UndoRedo.Action);\n\nUndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {\n var rowCount = instance.countRows(),\n minSpareRows = instance.getSettings().minSpareRows;\n\n if (this.index >= rowCount && this.index - minSpareRows < rowCount) {\n this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change\n }\n\n instance.addHookOnce('afterRemoveRow', undoneCallback);\n instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterCreateRow', redoneCallback);\n instance.alter('insert_row', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove row action.\n */\nUndoRedo.RemoveRowAction = function (index, data) {\n this.index = index;\n this.data = data;\n this.actionType = 'remove_row';\n};\n(0, _object.inherit)(UndoRedo.RemoveRowAction, UndoRedo.Action);\n\nUndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {\n instance.alter('insert_row', this.index, this.data.length, 'UndoRedo.undo');\n instance.addHookOnce('afterRender', undoneCallback);\n instance.populateFromArray(this.index, 0, this.data, void 0, void 0, 'UndoRedo.undo');\n};\nUndoRedo.RemoveRowAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterRemoveRow', redoneCallback);\n instance.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo');\n};\n\n/**\n * Create column action.\n */\nUndoRedo.CreateColumnAction = function (index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_col';\n};\n(0, _object.inherit)(UndoRedo.CreateColumnAction, UndoRedo.Action);\n\nUndoRedo.CreateColumnAction.prototype.undo = function (instance, undoneCallback) {\n instance.addHookOnce('afterRemoveCol', undoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterCreateCol', redoneCallback);\n instance.alter('insert_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove column action.\n */\nUndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions) {\n this.index = index;\n this.indexes = indexes;\n this.data = data;\n this.amount = this.data[0].length;\n this.headers = headers;\n this.columnPositions = columnPositions.slice(0);\n this.actionType = 'remove_col';\n};\n(0, _object.inherit)(UndoRedo.RemoveColumnAction, UndoRedo.Action);\n\nUndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {\n var _this = this;\n\n var row = void 0;\n var ascendingIndexes = this.indexes.slice(0).sort();\n var sortByIndexes = function sortByIndexes(elem, j, arr) {\n return arr[_this.indexes.indexOf(ascendingIndexes[j])];\n };\n\n var sortedData = [];\n (0, _number.rangeEach)(this.data.length - 1, function (i) {\n sortedData[i] = (0, _array.arrayMap)(_this.data[i], sortByIndexes);\n });\n\n var sortedHeaders = [];\n sortedHeaders = (0, _array.arrayMap)(this.headers, sortByIndexes);\n\n var changes = [];\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('beforeCreateCol', this.indexes[0], this.indexes[this.indexes.length - 1], 'UndoRedo.undo');\n\n (0, _number.rangeEach)(this.data.length - 1, function (i) {\n row = instance.getSourceDataAtRow(i);\n\n (0, _number.rangeEach)(ascendingIndexes.length - 1, function (j) {\n row.splice(ascendingIndexes[j], 0, sortedData[i][j]);\n changes.push([i, ascendingIndexes[j], null, sortedData[i][j]]);\n });\n });\n\n // TODO: Temporary hook for undo/redo mess\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').onAfterSetDataAtCell(changes);\n }\n\n if (typeof this.headers !== 'undefined') {\n (0, _number.rangeEach)(sortedHeaders.length - 1, function (j) {\n instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]);\n });\n }\n\n if (instance.getPlugin('manualColumnMove')) {\n instance.getPlugin('manualColumnMove').columnsMapper.__arrayMap = this.columnPositions;\n }\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('afterCreateCol', this.indexes[0], this.indexes[this.indexes.length - 1], 'UndoRedo.undo');\n\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').recalculateFull();\n }\n\n instance.render();\n};\n\nUndoRedo.RemoveColumnAction.prototype.redo = function (instance, redoneCallback) {\n instance.addHookOnce('afterRemoveCol', redoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Cell alignment action.\n */\nUndoRedo.CellAlignmentAction = function (stateBefore, range, type, alignment) {\n this.stateBefore = stateBefore;\n this.range = range;\n this.type = type;\n this.alignment = alignment;\n};\nUndoRedo.CellAlignmentAction.prototype.undo = function (instance, undoneCallback) {\n if (!instance.getPlugin('contextMenu').isEnabled()) {\n return;\n }\n for (var row = this.range.from.row; row <= this.range.to.row; row++) {\n for (var col = this.range.from.col; col <= this.range.to.col; col++) {\n instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft');\n }\n }\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\nUndoRedo.CellAlignmentAction.prototype.redo = function (instance, undoneCallback) {\n if (!instance.getPlugin('contextMenu').isEnabled()) {\n return;\n }\n instance.selectCell(this.range.from.row, this.range.from.col, this.range.to.row, this.range.to.col);\n instance.getPlugin('contextMenu').executeCommand('alignment:' + this.alignment.replace('ht', '').toLowerCase());\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\n\n/**\n * Filters action.\n */\nUndoRedo.FiltersAction = function (formulaStacks) {\n this.formulaStacks = formulaStacks;\n this.actionType = 'filter';\n};\n(0, _object.inherit)(UndoRedo.FiltersAction, UndoRedo.Action);\n\nUndoRedo.FiltersAction.prototype.undo = function (instance, undoneCallback) {\n var filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n filters.formulaCollection.importAllFormulas(this.formulaStacks.slice(0, this.formulaStacks.length - 1));\n filters.filter();\n};\nUndoRedo.FiltersAction.prototype.redo = function (instance, redoneCallback) {\n var filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', redoneCallback);\n\n filters.formulaCollection.importAllFormulas(this.formulaStacks);\n filters.filter();\n};\n\n/**\n * ManualRowMove action.\n * @TODO: removeRow undo should works on logical index\n */\nUndoRedo.RowMoveAction = function (movedRows, target) {\n this.rows = movedRows.slice();\n this.target = target;\n};\n(0, _object.inherit)(UndoRedo.RowMoveAction, UndoRedo.Action);\n\nUndoRedo.RowMoveAction.prototype.undo = function (instance, undoneCallback) {\n var manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', undoneCallback);\n var mod = this.rows[0] < this.target ? -1 * this.rows.length : 0;\n var newTarget = this.rows[0] > this.target ? this.rows[0] + this.rows.length : this.rows[0];\n var newRows = [];\n var rowsLen = this.rows.length + mod;\n\n for (var i = mod; i < rowsLen; i++) {\n newRows.push(this.target + i);\n }\n manualRowMove.moveRows(newRows.slice(), newTarget);\n instance.render();\n\n instance.selection.setRangeStartOnly(new _src.CellCoords(this.rows[0], 0));\n instance.selection.setRangeEnd(new _src.CellCoords(this.rows[this.rows.length - 1], instance.countCols() - 1));\n};\nUndoRedo.RowMoveAction.prototype.redo = function (instance, redoneCallback) {\n var manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', redoneCallback);\n manualRowMove.moveRows(this.rows.slice(), this.target);\n instance.render();\n var startSelection = this.rows[0] < this.target ? this.target - this.rows.length : this.target;\n instance.selection.setRangeStartOnly(new _src.CellCoords(startSelection, 0));\n instance.selection.setRangeEnd(new _src.CellCoords(startSelection + this.rows.length - 1, instance.countCols() - 1));\n};\n\nfunction init() {\n var instance = this;\n var pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo;\n\n if (pluginEnabled) {\n if (!instance.undoRedo) {\n /**\n * Instance of Handsontable.UndoRedo Plugin {@link Handsontable.UndoRedo}\n *\n * @alias undoRedo\n * @memberof! Handsontable.Core#\n * @type {UndoRedo}\n */\n instance.undoRedo = new UndoRedo(instance);\n\n exposeUndoRedoMethods(instance);\n\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n instance.addHook('afterChange', onAfterChange);\n }\n } else if (instance.undoRedo) {\n delete instance.undoRedo;\n\n removeExposedUndoRedoMethods(instance);\n\n instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n instance.removeHook('afterChange', onAfterChange);\n }\n}\n\nfunction onBeforeKeyDown(event) {\n var instance = this;\n\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode === 89 || event.shiftKey && event.keyCode === 90) {\n // CTRL + Y or CTRL + SHIFT + Z\n instance.undoRedo.redo();\n (0, _event.stopImmediatePropagation)(event);\n } else if (event.keyCode === 90) {\n // CTRL + Z\n instance.undoRedo.undo();\n (0, _event.stopImmediatePropagation)(event);\n }\n }\n}\n\nfunction onAfterChange(changes, source) {\n var instance = this;\n if (source === 'loadData') {\n return instance.undoRedo.clear();\n }\n}\n\nfunction exposeUndoRedoMethods(instance) {\n /**\n * {@link UndoRedo#undo}\n * @alias undo\n * @memberof! Handsontable.Core#\n */\n instance.undo = function () {\n return instance.undoRedo.undo();\n };\n\n /**\n * {@link UndoRedo#redo}\n * @alias redo\n * @memberof! Handsontable.Core#\n */\n instance.redo = function () {\n return instance.undoRedo.redo();\n };\n\n /**\n * {@link UndoRedo#isUndoAvailable}\n * @alias isUndoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isUndoAvailable = function () {\n return instance.undoRedo.isUndoAvailable();\n };\n\n /**\n * {@link UndoRedo#isRedoAvailable}\n * @alias isRedoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isRedoAvailable = function () {\n return instance.undoRedo.isRedoAvailable();\n };\n\n /**\n * {@link UndoRedo#clear}\n * @alias clearUndo\n * @memberof! Handsontable.Core#\n */\n instance.clearUndo = function () {\n return instance.undoRedo.clear();\n };\n}\n\nfunction removeExposedUndoRedoMethods(instance) {\n delete instance.undo;\n delete instance.redo;\n delete instance.isUndoAvailable;\n delete instance.isRedoAvailable;\n delete instance.clearUndo;\n}\n\nvar hook = _pluginHooks2.default.getSingleton();\n\nhook.add('afterInit', init);\nhook.add('afterUpdateSettings', init);\n\nhook.register('beforeUndo');\nhook.register('afterUndo');\nhook.register('beforeRedo');\nhook.register('afterRedo');\n\n/***/ }),\n/* 260 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nfunction cellDecorator(instance, TD, row, col, prop, value, cellProperties) {\n if (cellProperties.className) {\n if (TD.className) {\n TD.className = TD.className + ' ' + cellProperties.className;\n } else {\n TD.className = cellProperties.className;\n }\n }\n\n if (cellProperties.readOnly) {\n (0, _element.addClass)(TD, cellProperties.readOnlyCellClassName);\n }\n\n if (cellProperties.valid === false && cellProperties.invalidCellClassName) {\n (0, _element.addClass)(TD, cellProperties.invalidCellClassName);\n } else {\n (0, _element.removeClass)(TD, cellProperties.invalidCellClassName);\n }\n\n if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) {\n (0, _element.addClass)(TD, cellProperties.noWordWrapClassName);\n }\n\n if (!value && cellProperties.placeholder) {\n (0, _element.addClass)(TD, cellProperties.placeholderCellClassName);\n }\n} /**\n * Adds appropriate CSS class to table cell, based on cellProperties\n */\nexports.default = cellDecorator;\n\n/***/ }),\n/* 261 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _src = __webpack_require__(11);\n\nvar _index = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar clonableWRAPPER = document.createElement('DIV');\nclonableWRAPPER.className = 'htAutocompleteWrapper';\n\nvar clonableARROW = document.createElement('DIV');\nclonableARROW.className = 'htAutocompleteArrow';\n// workaround for https://github.com/handsontable/handsontable/issues/1946\n// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\nclonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660)));\n\nvar wrapTdContentWithWrapper = function wrapTdContentWithWrapper(TD, WRAPPER) {\n WRAPPER.innerHTML = TD.innerHTML;\n (0, _element.empty)(TD);\n TD.appendChild(WRAPPER);\n};\n\n/**\n * Autocomplete renderer\n *\n * @private\n * @renderer AutocompleteRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properites (shared by cell renderer and editor)\n */\nfunction autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var WRAPPER = clonableWRAPPER.cloneNode(true); // this is faster than createElement\n var ARROW = clonableARROW.cloneNode(true); // this is faster than createElement\n\n if (cellProperties.allowHtml) {\n (0, _index.getRenderer)('html').apply(this, arguments);\n } else {\n (0, _index.getRenderer)('text').apply(this, arguments);\n }\n\n TD.appendChild(ARROW);\n (0, _element.addClass)(TD, 'htAutocomplete');\n\n if (!TD.firstChild) {\n // http://jsperf.com/empty-node-if-needed\n // otherwise empty fields appear borderless in demo/renderers.html (IE)\n TD.appendChild(document.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n }\n\n if (!instance.acArrowListener) {\n var eventManager = new _eventManager2.default(instance);\n\n // not very elegant but easy and fast\n instance.acArrowListener = function (event) {\n if ((0, _element.hasClass)(event.target, 'htAutocompleteArrow')) {\n instance.view.wt.getSetting('onCellDblClick', null, new _src.CellCoords(row, col), TD);\n }\n };\n\n eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener);\n\n // We need to unbind the listener after the table has been destroyed\n instance.addHookOnce('afterDestroy', function () {\n eventManager.destroy();\n });\n }\n}\n\nexports.default = autocompleteRenderer;\n\n/***/ }),\n/* 262 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _string = __webpack_require__(27);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _unicode = __webpack_require__(16);\n\nvar _function = __webpack_require__(35);\n\nvar _event = __webpack_require__(7);\n\nvar _index = __webpack_require__(9);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar isListeningKeyDownEvent = new WeakMap();\nvar isCheckboxListenerAdded = new WeakMap();\nvar BAD_VALUE_CLASS = 'htBadValue';\n\n/**\n * Checkbox renderer\n *\n * @private\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n var eventManager = registerEvents(instance);\n var input = createInput();\n var labelOptions = cellProperties.label;\n var badValue = false;\n\n if (typeof cellProperties.checkedTemplate === 'undefined') {\n cellProperties.checkedTemplate = true;\n }\n if (typeof cellProperties.uncheckedTemplate === 'undefined') {\n cellProperties.uncheckedTemplate = false;\n }\n\n (0, _element.empty)(TD); // TODO identify under what circumstances this line can be removed\n\n if (value === cellProperties.checkedTemplate || (0, _string.equalsIgnoreCase)(value, cellProperties.checkedTemplate)) {\n input.checked = true;\n } else if (value === cellProperties.uncheckedTemplate || (0, _string.equalsIgnoreCase)(value, cellProperties.uncheckedTemplate)) {\n input.checked = false;\n } else if (value === null) {\n // default value\n (0, _element.addClass)(input, 'noValue');\n } else {\n input.style.display = 'none';\n (0, _element.addClass)(input, BAD_VALUE_CLASS);\n badValue = true;\n }\n\n input.setAttribute('data-row', row);\n input.setAttribute('data-col', col);\n\n if (!badValue && labelOptions) {\n var labelText = '';\n\n if (labelOptions.value) {\n labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;\n } else if (labelOptions.property) {\n labelText = instance.getDataAtRowProp(row, labelOptions.property);\n }\n var label = createLabel(labelText);\n\n if (labelOptions.position === 'before') {\n label.appendChild(input);\n } else {\n label.insertBefore(input, label.firstChild);\n }\n input = label;\n }\n\n TD.appendChild(input);\n\n if (badValue) {\n TD.appendChild(document.createTextNode('#bad-value#'));\n }\n\n if (!isListeningKeyDownEvent.has(instance)) {\n isListeningKeyDownEvent.set(instance, true);\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n }\n\n /**\n * On before key down DOM listener.\n *\n * @private\n * @param {Event} event\n */\n function onBeforeKeyDown(event) {\n var toggleKeys = 'SPACE|ENTER';\n var switchOffKeys = 'DELETE|BACKSPACE';\n var isKeyCode = (0, _function.partial)(_unicode.isKey, event.keyCode);\n\n if (isKeyCode(toggleKeys + '|' + switchOffKeys) && !(0, _event.isImmediatePropagationStopped)(event)) {\n eachSelectedCheckboxCell(function () {\n (0, _event.stopImmediatePropagation)(event);\n event.preventDefault();\n });\n }\n if (isKeyCode(toggleKeys)) {\n changeSelectedCheckboxesState();\n }\n if (isKeyCode(switchOffKeys)) {\n changeSelectedCheckboxesState(true);\n }\n }\n\n /**\n * Change checkbox checked property\n *\n * @private\n * @param {Boolean} [uncheckCheckbox=false]\n */\n function changeSelectedCheckboxesState() {\n var uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n var changes = [];\n\n for (var _row = topLeft.row; _row <= bottomRight.row; _row += 1) {\n for (var _col = topLeft.col; _col <= bottomRight.col; _col += 1) {\n var _cellProperties = instance.getCellMeta(_row, _col);\n\n if (_cellProperties.type !== 'checkbox') {\n return;\n }\n\n /* eslint-disable no-continue */\n if (_cellProperties.readOnly === true) {\n continue;\n }\n\n if (typeof _cellProperties.checkedTemplate === 'undefined') {\n _cellProperties.checkedTemplate = true;\n }\n if (typeof _cellProperties.uncheckedTemplate === 'undefined') {\n _cellProperties.uncheckedTemplate = false;\n }\n\n var dataAtCell = instance.getDataAtCell(_row, _col);\n\n if (uncheckCheckbox === false) {\n if (dataAtCell === _cellProperties.checkedTemplate) {\n changes.push([_row, _col, _cellProperties.uncheckedTemplate]);\n } else if ([_cellProperties.uncheckedTemplate, null, void 0].indexOf(dataAtCell) !== -1) {\n changes.push([_row, _col, _cellProperties.checkedTemplate]);\n }\n } else {\n changes.push([_row, _col, _cellProperties.uncheckedTemplate]);\n }\n }\n }\n\n if (changes.length > 0) {\n instance.setDataAtCell(changes);\n }\n }\n\n /**\n * Call callback for each found selected cell with checkbox type.\n *\n * @private\n * @param {Function} callback\n */\n function eachSelectedCheckboxCell(callback) {\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n var topLeft = selRange.getTopLeftCorner();\n var bottomRight = selRange.getBottomRightCorner();\n\n for (var _row2 = topLeft.row; _row2 <= bottomRight.row; _row2++) {\n for (var _col2 = topLeft.col; _col2 <= bottomRight.col; _col2++) {\n var _cellProperties2 = instance.getCellMeta(_row2, _col2);\n\n if (_cellProperties2.type !== 'checkbox') {\n return;\n }\n\n var cell = instance.getCell(_row2, _col2);\n\n if (cell == null) {\n\n callback(_row2, _col2, _cellProperties2);\n } else {\n var checkboxes = cell.querySelectorAll('input[type=checkbox]');\n\n if (checkboxes.length > 0 && !_cellProperties2.readOnly) {\n callback(checkboxes);\n }\n }\n }\n }\n }\n}\n\n/**\n * Register checkbox listeners.\n *\n * @param {Handsontable} instance Handsontable instance.\n * @returns {EventManager}\n */\nfunction registerEvents(instance) {\n var eventManager = isCheckboxListenerAdded.get(instance);\n\n if (!eventManager) {\n eventManager = new _eventManager2.default(instance);\n eventManager.addEventListener(instance.rootElement, 'click', function (event) {\n return onClick(event, instance);\n });\n eventManager.addEventListener(instance.rootElement, 'mouseup', function (event) {\n return onMouseUp(event, instance);\n });\n eventManager.addEventListener(instance.rootElement, 'change', function (event) {\n return onChange(event, instance);\n });\n\n isCheckboxListenerAdded.set(instance, eventManager);\n }\n\n return eventManager;\n}\n\n/**\n * Create input element.\n *\n * @returns {Node}\n */\nfunction createInput() {\n var input = document.createElement('input');\n\n input.className = 'htCheckboxRendererInput';\n input.type = 'checkbox';\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('tabindex', '-1');\n\n return input.cloneNode(false);\n}\n\n/**\n * Create label element.\n *\n * @returns {Node}\n */\nfunction createLabel(text) {\n var label = document.createElement('label');\n\n label.className = 'htCheckboxRendererLabel';\n label.appendChild(document.createTextNode(text));\n\n return label.cloneNode(true);\n}\n\n/**\n * `mouseup` callback.\n *\n * @private\n * @param {Event} event `mouseup` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onMouseUp(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return;\n }\n setTimeout(instance.listen, 10);\n}\n\n/**\n * `click` callback.\n *\n * @private\n * @param {Event} event `click` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onClick(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n var row = parseInt(event.target.getAttribute('data-row'), 10);\n var col = parseInt(event.target.getAttribute('data-col'), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.readOnly) {\n event.preventDefault();\n }\n}\n\n/**\n * `change` callback.\n *\n * @param {Event} event `change` event.\n * @param {Object} instance Handsontable instance.\n * @param {Object} cellProperties Reference to cell properties.\n * @returns {Boolean}\n */\nfunction onChange(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n var row = parseInt(event.target.getAttribute('data-row'), 10);\n var col = parseInt(event.target.getAttribute('data-col'), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (!cellProperties.readOnly) {\n var newCheckboxValue = null;\n\n if (event.target.checked) {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? true : cellProperties.checkedTemplate;\n } else {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? false : cellProperties.uncheckedTemplate;\n }\n\n instance.setDataAtCell(row, col, newCheckboxValue);\n }\n}\n\n/**\n * Check if the provided element is the checkbox input.\n *\n * @private\n * @param {HTMLElement} element The element in question.\n * @returns {Boolean}\n */\nfunction isCheckboxInput(element) {\n return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox';\n}\n\nexports.default = checkboxRenderer;\n\n/***/ }),\n/* 263 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _index = __webpack_require__(9);\n\n/**\n * @private\n * @renderer HtmlRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction htmlRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n if (value === null || value === void 0) {\n value = '';\n }\n\n (0, _element.fastInnerHTML)(TD, value);\n}\n\nexports.default = htmlRenderer;\n\n/***/ }),\n/* 264 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _numbro = __webpack_require__(86);\n\nvar _numbro2 = _interopRequireDefault(_numbro);\n\nvar _index = __webpack_require__(9);\n\nvar _number = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Numeric cell renderer\n *\n * @private\n * @renderer NumericRenderer\n * @dependencies numbro\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction numericRenderer(instance, TD, row, col, prop, value, cellProperties) {\n if ((0, _number.isNumeric)(value)) {\n if (typeof cellProperties.language !== 'undefined') {\n _numbro2.default.culture(cellProperties.language);\n }\n\n value = (0, _numbro2.default)(value).format(cellProperties.format || '0');\n\n var className = cellProperties.className || '';\n\n var classArr = className.length ? className.split(' ') : [];\n\n if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {\n classArr.push('htRight');\n }\n\n if (classArr.indexOf('htNumeric') < 0) {\n classArr.push('htNumeric');\n }\n\n cellProperties.className = classArr.join(' ');\n }\n\n (0, _index.getRenderer)('text')(instance, TD, row, col, prop, value, cellProperties);\n}\n\nexports.default = numericRenderer;\n\n/***/ }),\n/* 265 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _index = __webpack_require__(9);\n\nvar _number = __webpack_require__(6);\n\n/**\n * @private\n * @renderer PasswordRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction passwordRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('text').apply(this, arguments);\n\n value = TD.innerHTML;\n\n var hashLength = cellProperties.hashLength || value.length;\n var hashSymbol = cellProperties.hashSymbol || '*';\n\n var hash = '';\n\n (0, _number.rangeEach)(hashLength - 1, function () {\n hash += hashSymbol;\n });\n (0, _element.fastInnerHTML)(TD, hash);\n}\n\nexports.default = passwordRenderer;\n\n/***/ }),\n/* 266 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _element = __webpack_require__(0);\n\nvar _mixed = __webpack_require__(20);\n\nvar _index = __webpack_require__(9);\n\n/**\n * Default text renderer\n *\n * @private\n * @renderer TextRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction textRenderer(instance, TD, row, col, prop, value, cellProperties) {\n (0, _index.getRenderer)('base').apply(this, arguments);\n\n if (!value && cellProperties.placeholder) {\n value = cellProperties.placeholder;\n }\n\n var escaped = (0, _mixed.stringify)(value);\n\n if (!instance.getSettings().trimWhitespace) {\n escaped = escaped.replace(/ /g, String.fromCharCode(160));\n }\n\n if (cellProperties.rendererTemplate) {\n (0, _element.empty)(TD);\n var TEMPLATE = document.createElement('TEMPLATE');\n TEMPLATE.setAttribute('bind', '{{}}');\n TEMPLATE.innerHTML = cellProperties.rendererTemplate;\n HTMLTemplateElement.decorate(TEMPLATE);\n TEMPLATE.model = instance.getSourceDataAtRow(row);\n TD.appendChild(TEMPLATE);\n } else {\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n (0, _element.fastInnerText)(TD, escaped);\n }\n}\n\nexports.default = textRenderer;\n\n/***/ }),\n/* 267 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _element = __webpack_require__(0);\n\nvar _browser = __webpack_require__(25);\n\nvar _eventManager = __webpack_require__(4);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _event = __webpack_require__(7);\n\nvar _src = __webpack_require__(11);\n\nvar _src2 = _interopRequireDefault(_src);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Handsontable TableView constructor\n * @param {Object} instance\n */\nfunction TableView(instance) {\n var _this = this;\n\n var that = this;\n\n this.eventManager = new _eventManager2.default(instance);\n this.instance = instance;\n this.settings = instance.getSettings();\n this.selectionMouseDown = false;\n\n var originalStyle = instance.rootElement.getAttribute('style');\n\n if (originalStyle) {\n instance.rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions\n }\n\n (0, _element.addClass)(instance.rootElement, 'handsontable');\n\n var table = document.createElement('TABLE');\n (0, _element.addClass)(table, 'htCore');\n\n if (instance.getSettings().tableClassName) {\n (0, _element.addClass)(table, instance.getSettings().tableClassName);\n }\n this.THEAD = document.createElement('THEAD');\n table.appendChild(this.THEAD);\n this.TBODY = document.createElement('TBODY');\n table.appendChild(this.TBODY);\n\n instance.table = table;\n\n instance.container.insertBefore(table, instance.container.firstChild);\n\n this.eventManager.addEventListener(instance.rootElement, 'mousedown', function (event) {\n this.selectionMouseDown = true;\n\n if (!that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n window.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.\n }\n });\n this.eventManager.addEventListener(instance.rootElement, 'mouseup', function (event) {\n this.selectionMouseDown = false;\n });\n this.eventManager.addEventListener(instance.rootElement, 'mousemove', function (event) {\n if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'keyup', function (event) {\n if (instance.selection.isInProgress() && !event.shiftKey) {\n instance.selection.finish();\n }\n });\n\n var isMouseDown;\n this.isMouseDown = function () {\n return isMouseDown;\n };\n\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function (event) {\n if (instance.selection.isInProgress() && event.which === 1) {\n // is left mouse button\n instance.selection.finish();\n }\n\n isMouseDown = false;\n\n if ((0, _element.isOutsideInput)(document.activeElement)) {\n instance.unlisten();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'mousedown', function (event) {\n var originalTarget = event.target;\n var next = event.target;\n var eventX = event.x || event.clientX;\n var eventY = event.y || event.clientY;\n\n if (isMouseDown || !instance.rootElement) {\n return; // it must have been started in a cell\n }\n\n // immediate click on \"holder\" means click on the right side of vertical scrollbar\n if (next === instance.view.wt.wtTable.holder) {\n var scrollbarWidth = (0, _element.getScrollbarWidth)();\n\n if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder || document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) {\n return;\n }\n } else {\n while (next !== document.documentElement) {\n if (next === null) {\n if (event.isTargetWebComponent) {\n break;\n }\n // click on something that was a row but now is detached (possibly because your click triggered a rerender)\n return;\n }\n if (next === instance.rootElement) {\n // click inside container\n return;\n }\n next = next.parentNode;\n }\n }\n\n // function did not return until here, we have an outside click!\n\n var outsideClickDeselects = typeof that.settings.outsideClickDeselects === 'function' ? that.settings.outsideClickDeselects(originalTarget) : that.settings.outsideClickDeselects;\n\n if (outsideClickDeselects) {\n instance.deselectCell();\n } else {\n instance.destroyEditor();\n }\n });\n\n this.eventManager.addEventListener(table, 'selectstart', function (event) {\n if (that.settings.fragmentSelection || (0, _element.isInput)(event.target)) {\n return;\n }\n // https://github.com/handsontable/handsontable/issues/160\n // Prevent text from being selected when performing drag down.\n event.preventDefault();\n });\n\n var clearTextSelection = function clearTextSelection() {\n // http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript\n if (window.getSelection) {\n if (window.getSelection().empty) {\n // Chrome\n window.getSelection().empty();\n } else if (window.getSelection().removeAllRanges) {\n // Firefox\n window.getSelection().removeAllRanges();\n }\n } else if (document.selection) {\n // IE?\n document.selection.empty();\n }\n };\n\n var selections = [new _src.Selection({\n className: 'current',\n border: {\n width: 2,\n color: '#5292F7',\n // style: 'solid', // not used\n cornerVisible: function cornerVisible() {\n return that.settings.fillHandle && !that.isCellEdited() && !instance.selection.isMultiple();\n },\n multipleSelectionHandlesVisible: function multipleSelectionHandlesVisible() {\n return !that.isCellEdited() && !instance.selection.isMultiple();\n }\n }\n }), new _src.Selection({\n className: 'area',\n border: {\n width: 1,\n color: '#89AFF9',\n // style: 'solid', // not used\n cornerVisible: function cornerVisible() {\n return that.settings.fillHandle && !that.isCellEdited() && instance.selection.isMultiple();\n },\n multipleSelectionHandlesVisible: function multipleSelectionHandlesVisible() {\n return !that.isCellEdited() && instance.selection.isMultiple();\n }\n }\n }), new _src.Selection({\n className: 'highlight',\n highlightHeaderClassName: that.settings.currentHeaderClassName,\n highlightRowClassName: that.settings.currentRowClassName,\n highlightColumnClassName: that.settings.currentColClassName\n }), new _src.Selection({\n className: 'fill',\n border: {\n width: 1,\n color: 'red'\n }\n })];\n selections.current = selections[0];\n selections.area = selections[1];\n selections.highlight = selections[2];\n selections.fill = selections[3];\n\n var walkontableConfig = {\n debug: function debug() {\n return that.settings.debug;\n },\n externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(),\n table: table,\n preventOverflow: function preventOverflow() {\n return _this.settings.preventOverflow;\n },\n stretchH: function stretchH() {\n return that.settings.stretchH;\n },\n data: instance.getDataAtCell,\n totalRows: function totalRows() {\n return instance.countRows();\n },\n totalColumns: function totalColumns() {\n return instance.countCols();\n },\n fixedColumnsLeft: function fixedColumnsLeft() {\n return that.settings.fixedColumnsLeft;\n },\n fixedRowsTop: function fixedRowsTop() {\n return that.settings.fixedRowsTop;\n },\n fixedRowsBottom: function fixedRowsBottom() {\n return that.settings.fixedRowsBottom;\n },\n minSpareRows: function minSpareRows() {\n return that.settings.minSpareRows;\n },\n renderAllRows: that.settings.renderAllRows,\n rowHeaders: function rowHeaders() {\n var headerRenderers = [];\n\n if (instance.hasRowHeaders()) {\n headerRenderers.push(function (row, TH) {\n that.appendRowHeader(row, TH);\n });\n }\n instance.runHooks('afterGetRowHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnHeaders: function columnHeaders() {\n var headerRenderers = [];\n\n if (instance.hasColHeaders()) {\n headerRenderers.push(function (column, TH) {\n that.appendColHeader(column, TH);\n });\n }\n instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnWidth: instance.getColWidth,\n rowHeight: instance.getRowHeight,\n cellRenderer: function cellRenderer(row, col, TD) {\n var cellProperties = that.instance.getCellMeta(row, col);\n var prop = that.instance.colToProp(col);\n var value = that.instance.getDataAtRowProp(row, prop);\n\n if (that.instance.hasHook('beforeValueRender')) {\n value = that.instance.runHooks('beforeValueRender', value);\n }\n\n that.instance.runHooks('beforeRenderer', TD, row, col, prop, value, cellProperties);\n that.instance.getCellRenderer(cellProperties)(that.instance, TD, row, col, prop, value, cellProperties);\n that.instance.runHooks('afterRenderer', TD, row, col, prop, value, cellProperties);\n },\n selections: selections,\n hideBorderOnMouseDownOver: function hideBorderOnMouseDownOver() {\n return that.settings.fragmentSelection;\n },\n onCellMouseDown: function onCellMouseDown(event, coords, TD, wt) {\n var blockCalculations = {\n row: false,\n column: false,\n cells: false\n };\n\n instance.listen();\n\n that.activeWt = wt;\n isMouseDown = true;\n\n instance.runHooks('beforeOnCellMouseDown', event, coords, TD, blockCalculations);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n var actualSelection = instance.getSelectedRange();\n var selection = instance.selection;\n var selectedHeader = selection.selectedHeader;\n\n if (event.shiftKey && actualSelection) {\n if (coords.row >= 0 && coords.col >= 0 && !blockCalculations.cells) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeEnd(coords);\n } else if ((selectedHeader.cols || selectedHeader.rows) && coords.row >= 0 && coords.col >= 0 && !blockCalculations.cells) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeEnd(new _src.CellCoords(coords.row, coords.col));\n } else if (selectedHeader.cols && coords.row < 0 && !blockCalculations.column) {\n selection.setRangeEnd(new _src.CellCoords(actualSelection.to.row, coords.col));\n } else if (selectedHeader.rows && coords.col < 0 && !blockCalculations.row) {\n selection.setRangeEnd(new _src.CellCoords(coords.row, actualSelection.to.col));\n } else if ((!selectedHeader.cols && !selectedHeader.rows && coords.col < 0 || selectedHeader.cols && coords.col < 0) && !blockCalculations.row) {\n selection.setSelectedHeaders(true, false);\n selection.setRangeStartOnly(new _src.CellCoords(actualSelection.from.row, 0));\n selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1));\n } else if ((!selectedHeader.cols && !selectedHeader.rows && coords.row < 0 || selectedHeader.rows && coords.row < 0) && !blockCalculations.column) {\n selection.setSelectedHeaders(false, true);\n selection.setRangeStartOnly(new _src.CellCoords(0, actualSelection.from.col));\n selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col));\n }\n } else {\n var doNewSelection = true;\n\n if (actualSelection) {\n var from = actualSelection.from,\n to = actualSelection.to;\n\n var coordsNotInSelection = !selection.inInSelection(coords);\n\n if (coords.row < 0 && selectedHeader.cols) {\n var start = Math.min(from.col, to.col);\n var end = Math.max(from.col, to.col);\n\n doNewSelection = coords.col < start || coords.col > end;\n } else if (coords.col < 0 && selectedHeader.rows) {\n var _start = Math.min(from.row, to.row);\n var _end = Math.max(from.row, to.row);\n\n doNewSelection = coords.row < _start || coords.row > _end;\n } else {\n doNewSelection = coordsNotInSelection;\n }\n }\n\n var rightClick = (0, _event.isRightClick)(event);\n var leftClick = (0, _event.isLeftClick)(event) || event.type === 'touchstart';\n\n // clicked row header and when some column was selected\n if (coords.row < 0 && coords.col >= 0 && !blockCalculations.column) {\n selection.setSelectedHeaders(false, true);\n\n if (leftClick || rightClick && doNewSelection) {\n selection.setRangeStartOnly(new _src.CellCoords(0, coords.col));\n selection.setRangeEnd(new _src.CellCoords(Math.max(instance.countRows() - 1, 0), coords.col), false);\n }\n\n // clicked column header and when some row was selected\n } else if (coords.col < 0 && coords.row >= 0 && !blockCalculations.row) {\n selection.setSelectedHeaders(true, false);\n\n if (leftClick || rightClick && doNewSelection) {\n selection.setRangeStartOnly(new _src.CellCoords(coords.row, 0));\n selection.setRangeEnd(new _src.CellCoords(coords.row, Math.max(instance.countCols() - 1, 0)), false);\n }\n } else if (coords.col >= 0 && coords.row >= 0 && !blockCalculations.cells) {\n if (leftClick || rightClick && doNewSelection) {\n selection.setSelectedHeaders(false, false);\n selection.setRangeStart(coords);\n }\n } else if (coords.col < 0 && coords.row < 0) {\n coords.row = 0;\n coords.col = 0;\n\n selection.setSelectedHeaders(false, false, true);\n selection.setRangeStart(coords);\n }\n }\n\n instance.runHooks('afterOnCellMouseDown', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOut: function onCellMouseOut(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseOut', event, coords, TD);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n instance.runHooks('afterOnCellMouseOut', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOver: function onCellMouseOver(event, coords, TD, wt) {\n var blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseOver', event, coords, TD, blockCalculations);\n\n if ((0, _event.isImmediatePropagationStopped)(event)) {\n return;\n }\n\n if (event.button === 0 && isMouseDown) {\n if (coords.row >= 0 && coords.col >= 0) {\n // is not a header\n if (instance.selection.selectedHeader.cols && !blockCalculations.column) {\n instance.selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col), false);\n } else if (instance.selection.selectedHeader.rows && !blockCalculations.row) {\n instance.selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1), false);\n } else if (!blockCalculations.cell) {\n instance.selection.setRangeEnd(coords);\n }\n } else {\n /* eslint-disable no-lonely-if */\n if (instance.selection.selectedHeader.cols && !blockCalculations.column) {\n instance.selection.setRangeEnd(new _src.CellCoords(instance.countRows() - 1, coords.col), false);\n } else if (instance.selection.selectedHeader.rows && !blockCalculations.row) {\n instance.selection.setRangeEnd(new _src.CellCoords(coords.row, instance.countCols() - 1), false);\n } else if (!blockCalculations.cell) {\n instance.selection.setRangeEnd(coords);\n }\n }\n }\n\n instance.runHooks('afterOnCellMouseOver', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseUp: function onCellMouseUp(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseUp', event, coords, TD);\n\n instance.runHooks('afterOnCellMouseUp', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellCornerMouseDown: function onCellCornerMouseDown(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerMouseDown', event);\n },\n onCellCornerDblClick: function onCellCornerDblClick(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerDblClick', event);\n },\n beforeDraw: function beforeDraw(force, skipRender) {\n that.beforeRender(force, skipRender);\n },\n onDraw: function onDraw(force) {\n that.onDraw(force);\n },\n onScrollVertically: function onScrollVertically() {\n instance.runHooks('afterScrollVertically');\n },\n onScrollHorizontally: function onScrollHorizontally() {\n instance.runHooks('afterScrollHorizontally');\n },\n onBeforeDrawBorders: function onBeforeDrawBorders(corners, borderClassName) {\n instance.runHooks('beforeDrawBorders', corners, borderClassName);\n },\n onBeforeTouchScroll: function onBeforeTouchScroll() {\n instance.runHooks('beforeTouchScroll');\n },\n onAfterMomentumScroll: function onAfterMomentumScroll() {\n instance.runHooks('afterMomentumScroll');\n },\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(stretchedWidth, column) {\n return instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, column);\n },\n onModifyRowHeaderWidth: function onModifyRowHeaderWidth(rowHeaderWidth) {\n return instance.runHooks('modifyRowHeaderWidth', rowHeaderWidth);\n },\n viewportRowCalculatorOverride: function viewportRowCalculatorOverride(calc) {\n var rows = instance.countRows();\n var viewportOffset = that.settings.viewportRowRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedRowsTop) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startRow = Math.max(calc.startRow - viewportOffset, 0);\n calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1);\n }\n if (viewportOffset === 'auto') {\n var center = calc.startRow + calc.endRow - calc.startRow;\n var offset = Math.ceil(center / rows * 12);\n\n calc.startRow = Math.max(calc.startRow - offset, 0);\n calc.endRow = Math.min(calc.endRow + offset, rows - 1);\n }\n instance.runHooks('afterViewportRowCalculatorOverride', calc);\n },\n viewportColumnCalculatorOverride: function viewportColumnCalculatorOverride(calc) {\n var cols = instance.countCols();\n var viewportOffset = that.settings.viewportColumnRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0);\n calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1);\n }\n if (viewportOffset === 'auto') {\n var center = calc.startColumn + calc.endColumn - calc.startColumn;\n var offset = Math.ceil(center / cols * 12);\n\n calc.startRow = Math.max(calc.startColumn - offset, 0);\n calc.endColumn = Math.min(calc.endColumn + offset, cols - 1);\n }\n instance.runHooks('afterViewportColumnCalculatorOverride', calc);\n },\n rowHeaderWidth: function rowHeaderWidth() {\n return that.settings.rowHeaderWidth;\n },\n columnHeaderHeight: function columnHeaderHeight() {\n var columnHeaderHeight = instance.runHooks('modifyColumnHeaderHeight');\n return that.settings.columnHeaderHeight || columnHeaderHeight;\n }\n };\n\n instance.runHooks('beforeInitWalkontable', walkontableConfig);\n\n this.wt = new _src2.default(walkontableConfig);\n this.activeWt = this.wt;\n\n if (!(0, _browser.isChrome)() && !(0, _browser.isSafari)()) {\n this.eventManager.addEventListener(instance.rootElement, 'wheel', function (event) {\n event.preventDefault();\n\n var lineHeight = parseInt((0, _element.getComputedStyle)(document.body)['font-size'], 10);\n var holder = that.wt.wtOverlays.scrollableElement;\n\n var deltaY = event.wheelDeltaY || event.deltaY;\n var deltaX = event.wheelDeltaX || event.deltaX;\n\n switch (event.deltaMode) {\n case 0:\n holder.scrollLeft += deltaX;\n holder.scrollTop += deltaY;\n break;\n\n case 1:\n holder.scrollLeft += deltaX * lineHeight;\n holder.scrollTop += deltaY * lineHeight;\n break;\n\n default:\n break;\n }\n });\n }\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n (0, _event.stopPropagation)(event);\n }\n });\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n (0, _event.stopPropagation)(event);\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'click', function () {\n if (that.settings.observeDOMVisibility) {\n if (that.wt.drawInterrupted) {\n that.instance.forceFullRender = true;\n that.render();\n }\n }\n });\n}\n\nTableView.prototype.isTextSelectionAllowed = function (el) {\n if ((0, _element.isInput)(el)) {\n return true;\n }\n var isChildOfTableBody = (0, _element.isChildOf)(el, this.instance.view.wt.wtTable.spreader);\n\n if (this.settings.fragmentSelection === true && isChildOfTableBody) {\n return true;\n }\n if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {\n return true;\n }\n if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Check if selected only one cell.\n *\n * @returns {Boolean}\n */\nTableView.prototype.isSelectedOnlyCell = function () {\n var _ref = this.instance.getSelected() || [],\n _ref2 = _slicedToArray(_ref, 4),\n row = _ref2[0],\n col = _ref2[1],\n rowEnd = _ref2[2],\n colEnd = _ref2[3];\n\n return row !== void 0 && row === rowEnd && col === colEnd;\n};\n\nTableView.prototype.isCellEdited = function () {\n var activeEditor = this.instance.getActiveEditor();\n\n return activeEditor && activeEditor.isOpened();\n};\n\nTableView.prototype.beforeRender = function (force, skipRender) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('beforeRender', this.instance.forceFullRender, skipRender);\n }\n};\n\nTableView.prototype.onDraw = function (force) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('afterRender', this.instance.forceFullRender);\n }\n};\n\nTableView.prototype.render = function () {\n this.wt.draw(!this.instance.forceFullRender);\n this.instance.forceFullRender = false;\n this.instance.renderCall = false;\n};\n\n/**\n * Returns td object given coordinates\n *\n * @param {CellCoords} coords\n * @param {Boolean} topmost\n */\nTableView.prototype.getCellAtCoords = function (coords, topmost) {\n var td = this.wt.getCell(coords, topmost);\n\n if (td < 0) {\n // there was an exit code (cell is out of bounds)\n return null;\n }\n\n return td;\n};\n\n/**\n * Scroll viewport to selection.\n *\n * @param {CellCoords} coords\n */\nTableView.prototype.scrollViewport = function (coords) {\n this.wt.scrollViewport(coords);\n};\n\n/**\n * Append row header to a TH element\n * @param row\n * @param TH\n */\nTableView.prototype.appendRowHeader = function (row, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if (!(0, _element.hasClass)(container, 'relative')) {\n (0, _element.empty)(TH);\n this.appendRowHeader(row, TH);\n\n return;\n }\n this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader);\n } else {\n var div = document.createElement('div');\n var span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'rowHeader';\n this.updateCellHeader(span, row, this.instance.getRowHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetRowHeader', row, TH);\n};\n\n/**\n * Append column header to a TH element\n * @param col\n * @param TH\n */\nTableView.prototype.appendColHeader = function (col, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if ((0, _element.hasClass)(container, 'relative')) {\n this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader);\n } else {\n (0, _element.empty)(TH);\n this.appendColHeader(col, TH);\n }\n } else {\n var div = document.createElement('div');\n var span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'colHeader';\n this.updateCellHeader(span, col, this.instance.getColHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetColHeader', col, TH);\n};\n\n/**\n * Update header cell content\n *\n * @since 0.15.0-beta4\n * @param {HTMLElement} element Element to update\n * @param {Number} index Row index or column index\n * @param {Function} content Function which should be returns content for this cell\n */\nTableView.prototype.updateCellHeader = function (element, index, content) {\n var renderedIndex = index;\n var parentOverlay = this.wt.wtOverlays.getParentOverlay(element) || this.wt;\n\n // prevent wrong calculations from SampleGenerator\n if (element.parentNode) {\n if ((0, _element.hasClass)(element, 'colHeader')) {\n renderedIndex = parentOverlay.wtTable.columnFilter.sourceToRendered(index);\n } else if ((0, _element.hasClass)(element, 'rowHeader')) {\n renderedIndex = parentOverlay.wtTable.rowFilter.sourceToRendered(index);\n }\n }\n\n if (renderedIndex > -1) {\n (0, _element.fastInnerHTML)(element, content(index));\n } else {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n (0, _element.fastInnerText)(element, String.fromCharCode(160));\n (0, _element.addClass)(element, 'cornerHeader');\n }\n};\n\n/**\n * Given a element's left position relative to the viewport, returns maximum element width until the right\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} leftOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementWidth = function (leftOffset) {\n var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth();\n var maxWidth = workspaceWidth - leftOffset;\n return maxWidth > 0 ? maxWidth : 0;\n};\n\n/**\n * Given a element's top position relative to the viewport, returns maximum element height until the bottom\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} topOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementHeight = function (topOffset) {\n var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight();\n var maxHeight = workspaceHeight - topOffset;\n return maxHeight > 0 ? maxHeight : 0;\n};\n\nTableView.prototype.mainViewIsActive = function () {\n return this.wt === this.activeWt;\n};\n\nTableView.prototype.destroy = function () {\n this.wt.destroy();\n this.eventManager.destroy();\n};\n\nexports.default = TableView;\n\n/***/ }),\n/* 268 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Refactored implementation of LinkedList (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia, Microfed and Jakeh (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Linked list node.\n *\n * @class NodeStructure\n * @util\n */\nvar NodeStructure = function NodeStructure(data) {\n _classCallCheck(this, NodeStructure);\n\n /**\n * Data of the node.\n * @member {Object}\n */\n this.data = data;\n /**\n * Next node.\n * @member {NodeStructure}\n */\n this.next = null;\n /**\n * Previous node.\n * @member {NodeStructure}\n */\n this.prev = null;\n};\n\n/**\n * Linked list.\n *\n * @class LinkedList\n * @util\n */\n\n\nvar LinkedList = function () {\n function LinkedList() {\n _classCallCheck(this, LinkedList);\n\n this.first = null;\n this.last = null;\n }\n\n /**\n * Add data to the end of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n\n\n _createClass(LinkedList, [{\n key: \"push\",\n value: function push(data) {\n var node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n } else {\n var temp = this.last;\n\n this.last = node;\n node.prev = temp;\n temp.next = node;\n }\n }\n\n /**\n * Add data to the beginning of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n\n }, {\n key: \"unshift\",\n value: function unshift(data) {\n var node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n } else {\n var temp = this.first;\n\n this.first = node;\n node.next = temp;\n temp.prev = node;\n }\n }\n\n /**\n * In order traversal of the linked list.\n *\n * @param {Function} callback Callback which should be executed on each node.\n */\n\n }, {\n key: \"inorder\",\n value: function inorder(callback) {\n var temp = this.first;\n\n while (temp) {\n callback(temp);\n temp = temp.next;\n }\n }\n\n /**\n * Remove data from the linked list.\n *\n * @param {Object} data Data which should be removed.\n * @returns {Boolean} Returns true if data has been removed.\n */\n\n }, {\n key: \"remove\",\n value: function remove(data) {\n if (this.first === null) {\n return false;\n }\n\n var temp = this.first;\n var next = void 0;\n var prev = void 0;\n\n while (temp) {\n if (temp.data === data) {\n next = temp.next;\n prev = temp.prev;\n\n if (next) {\n next.prev = prev;\n }\n\n if (prev) {\n prev.next = next;\n }\n\n if (temp === this.first) {\n this.first = next;\n }\n\n if (temp === this.last) {\n this.last = prev;\n }\n\n return true;\n }\n\n temp = temp.next;\n }\n\n return false;\n }\n\n /**\n * Check if linked list contains cycle.\n *\n * @returns {Boolean} Returns true if linked list contains cycle.\n */\n\n }, {\n key: \"hasCycle\",\n value: function hasCycle() {\n var fast = this.first;\n var slow = this.first;\n\n while (true) {\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n slow = slow.next;\n\n if (fast === slow) {\n return true;\n }\n }\n }\n }, {\n key: \"pop\",\n\n\n /**\n * Return last node from the linked list.\n *\n * @returns {NodeStructure} Last node.\n */\n value: function pop() {\n if (this.last === null) {\n return null;\n }\n\n var temp = this.last;\n this.last = this.last.prev;\n\n return temp;\n }\n }, {\n key: \"shift\",\n\n\n /**\n * Return first node from the linked list.\n *\n * @returns {NodeStructure} First node.\n */\n value: function shift() {\n if (this.first === null) {\n return null;\n }\n\n var temp = this.first;\n this.first = this.first.next;\n\n return temp;\n }\n }, {\n key: \"recursiveReverse\",\n\n\n /**\n * Reverses the linked list recursively\n */\n value: function recursiveReverse() {\n function inverse(current, next) {\n if (!next) {\n return;\n }\n inverse(next, next.next);\n next.next = current;\n }\n\n if (!this.first) {\n return;\n }\n\n inverse(this.first, this.first.next);\n\n this.first.next = null;\n var temp = this.first;\n this.first = this.last;\n this.last = temp;\n }\n }, {\n key: \"reverse\",\n\n\n /**\n * Reverses the linked list iteratively\n */\n value: function reverse() {\n if (!this.first || !this.first.next) {\n return;\n }\n\n var current = this.first.next;\n var prev = this.first;\n var temp = void 0;\n\n while (current) {\n temp = current.next;\n current.next = prev;\n prev.prev = current;\n prev = current;\n current = temp;\n }\n\n this.first.next = null;\n this.last.prev = null;\n temp = this.first;\n this.first = prev;\n this.last = temp;\n }\n }]);\n\n return LinkedList;\n}();\n\n;\n\nexports.NodeStructure = NodeStructure;\nexports.default = LinkedList;\n\n/***/ }),\n/* 269 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports.parseDelay = parseDelay;\n\nvar _feature = __webpack_require__(34);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class Interval\n * @util\n */\nvar Interval = function () {\n _createClass(Interval, null, [{\n key: 'create',\n value: function create(func, delay) {\n return new Interval(func, delay);\n }\n }]);\n\n function Interval(func, delay) {\n var _this = this;\n\n _classCallCheck(this, Interval);\n\n /**\n * Animation frame request id.\n *\n * @type {Number}\n */\n this.timer = null;\n /**\n * Function to invoke repeatedly.\n *\n * @type {Function}\n */\n this.func = func;\n /**\n * Number of milliseconds that function should wait before next call.\n */\n this.delay = parseDelay(delay);\n /**\n * Flag which indicates if interval object was stopped.\n *\n * @type {Boolean}\n * @default true\n */\n this.stopped = true;\n /**\n * Interval time (in milliseconds) of the last callback call.\n *\n * @private\n * @type {Number}\n */\n this._then = null;\n /**\n * Bounded function `func`.\n *\n * @private\n * @type {Function}\n */\n this._callback = function () {\n return _this.__callback();\n };\n }\n\n /**\n * Start loop.\n *\n * @returns {Interval}\n */\n\n\n _createClass(Interval, [{\n key: 'start',\n value: function start() {\n if (this.stopped) {\n this._then = Date.now();\n this.stopped = false;\n this.timer = (0, _feature.requestAnimationFrame)(this._callback);\n }\n\n return this;\n }\n\n /**\n * Stop looping.\n *\n * @returns {Interval}\n */\n\n }, {\n key: 'stop',\n value: function stop() {\n if (!this.stopped) {\n this.stopped = true;\n (0, _feature.cancelAnimationFrame)(this.timer);\n this.timer = null;\n }\n\n return this;\n }\n\n /**\n * Loop callback, fired on every animation frame.\n *\n * @private\n */\n\n }, {\n key: '__callback',\n value: function __callback() {\n this.timer = (0, _feature.requestAnimationFrame)(this._callback);\n\n if (this.delay) {\n var now = Date.now();\n var elapsed = now - this._then;\n\n if (elapsed > this.delay) {\n this._then = now - elapsed % this.delay;\n this.func();\n }\n } else {\n this.func();\n }\n }\n }]);\n\n return Interval;\n}();\n\nexports.default = Interval;\nfunction parseDelay(delay) {\n if (typeof delay === 'string' && /fps$/.test(delay)) {\n delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10);\n }\n\n return delay;\n}\n\n/***/ }),\n/* 270 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = mergeSort;\nexports.merge = merge;\n\nvar _linkedList = __webpack_require__(268);\n\nvar _linkedList2 = _interopRequireDefault(_linkedList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Refactored implementation of mergeSort (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia and lekkas (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Specifies a function that defines the sort order. The array is sorted according to each\n * character's Unicode code point value, according to the string conversion of each element.\n *\n * @param a {*} first compared element.\n * @param b {*} second compared element.\n * @returns {Number}\n */\nvar defaultCompareFunction = function defaultCompareFunction(a, b) {\n // sort lexically\n\n var firstValue = a.toString();\n var secondValue = b.toString();\n\n if (firstValue === secondValue) {\n return 0;\n } else if (firstValue < secondValue) {\n return -1;\n }\n return 1;\n};\n\n/**\n * Mergesort method which is recursively called for sorting the input array.\n *\n * @param {Array} array The array which should be sorted.\n * @param {Function} compareFunction Compares two items in an array. If compareFunction is not supplied,\n * elements are sorted by converting them to strings and comparing strings in Unicode code point order.\n * @param {Number} startIndex Left side of the subarray.\n * @param {Number} endIndex Right side of the subarray.\n * @returns {Array} Array with sorted subarray.\n */\nfunction mergeSort(array) {\n var compareFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCompareFunction;\n var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length;\n\n if (Math.abs(endIndex - startIndex) <= 1) {\n return [];\n }\n\n var middleIndex = Math.ceil((startIndex + endIndex) / 2);\n\n mergeSort(array, compareFunction, startIndex, middleIndex);\n mergeSort(array, compareFunction, middleIndex, endIndex);\n\n return merge(array, compareFunction, startIndex, middleIndex, endIndex);\n}\n\n/**\n * Devides and sort merges two subarrays of given array\n *\n * @param {Array} array The array which subarrays should be sorted.\n * @param {Number} startIndex The start of the first subarray.\n * This subarray is with end middle - 1.\n * @param {Number} middleIndex The start of the second array.\n * @param {Number} endIndex end - 1 is the end of the second array.\n * @returns {Array} The array with sorted subarray.\n */\nfunction merge(array, compareFunction, startIndex, middleIndex, endIndex) {\n var leftElements = new _linkedList2.default();\n var rightElements = new _linkedList2.default();\n var leftSize = middleIndex - startIndex;\n var rightSize = endIndex - middleIndex;\n var maxSize = Math.max(leftSize, rightSize);\n var size = endIndex - startIndex;\n\n for (var _i = 0; _i < maxSize; _i += 1) {\n if (_i < leftSize) {\n leftElements.push(array[startIndex + _i]);\n }\n\n if (_i < rightSize) {\n rightElements.push(array[middleIndex + _i]);\n }\n }\n\n var i = 0;\n\n while (i < size) {\n if (leftElements.first && rightElements.first) {\n if (compareFunction(leftElements.first.data, rightElements.first.data) > 0) {\n array[startIndex + i] = rightElements.shift().data;\n } else {\n array[startIndex + i] = leftElements.shift().data;\n }\n } else if (leftElements.first) {\n\n array[startIndex + i] = leftElements.shift().data;\n } else {\n\n array[startIndex + i] = rightElements.shift().data;\n }\n\n i += 1;\n }\n\n return array;\n};\n\n/***/ }),\n/* 271 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = autocompleteValidator;\n/**\n * Autocomplete cell validator.\n *\n * @private\n * @validator AutocompleteValidator\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction autocompleteValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n\n if (this.allowEmpty && value === '') {\n callback(true);\n\n return;\n }\n\n if (this.strict && this.source) {\n if (typeof this.source === 'function') {\n this.source(value, process(value, callback));\n } else {\n process(value, callback)(this.source);\n }\n } else {\n callback(true);\n }\n};\n\n/**\n * Function responsible for validation of autocomplete value.\n *\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction process(value, callback) {\n var originalVal = value;\n\n return function (source) {\n var found = false;\n\n for (var s = 0, slen = source.length; s < slen; s++) {\n if (originalVal === source[s]) {\n found = true; // perfect match\n break;\n }\n }\n\n callback(found);\n };\n}\n\n/***/ }),\n/* 272 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = dateValidator;\nexports.correctFormat = correctFormat;\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _date = __webpack_require__(88);\n\nvar _editors = __webpack_require__(14);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Date cell validator\n *\n * @private\n * @validator DateValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction dateValidator(value, callback) {\n var valid = true;\n var dateEditor = (0, _editors.getEditorInstance)('date', this.instance);\n\n if (value == null) {\n value = '';\n }\n var isValidDate = (0, _moment2.default)(new Date(value)).isValid() || (0, _moment2.default)(value, dateEditor.defaultDateFormat).isValid();\n // is it in the specified format\n var isValidFormat = (0, _moment2.default)(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid();\n\n if (this.allowEmpty && value === '') {\n isValidDate = true;\n isValidFormat = true;\n }\n if (!isValidDate) {\n valid = false;\n }\n if (!isValidDate && isValidFormat) {\n valid = true;\n }\n\n if (isValidDate && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = correctFormat(value, this.dateFormat);\n var row = this.instance.runHooks('unmodifyRow', this.row);\n var column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'dateValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n/**\n * Format the given string using moment.js' format feature\n *\n * @param {String} value\n * @param {String} dateFormat\n * @returns {String}\n */\nfunction correctFormat(value, dateFormat) {\n var dateFromDate = (0, _moment2.default)((0, _date.getNormalizedDate)(value));\n var dateFromMoment = (0, _moment2.default)(value, dateFormat);\n var isAlphanumeric = value.search(/[A-z]/g) > -1;\n var date = void 0;\n\n if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {\n date = dateFromDate;\n } else {\n date = dateFromMoment;\n }\n\n return date.format(dateFormat);\n};\n\n/***/ }),\n/* 273 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = numericValidator;\n/**\n * Numeric cell validator\n *\n * @private\n * @validator NumericValidator\n * @param {*} value - Value of edited cell\n * @param {*} callback - Callback called with validation result\n */\nfunction numericValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n if (this.allowEmpty && value === '') {\n callback(true);\n } else if (value === '') {\n callback(false);\n } else {\n callback(/^-?\\d*(\\.|,)?\\d*$/.test(value));\n }\n};\n\n/***/ }),\n/* 274 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.__esModule = true;\nexports.default = timeValidator;\n\nvar _moment = __webpack_require__(62);\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Formats which are correctly parsed to time (supported by momentjs)\nvar STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ', 'X', // Unix timestamp\n'x' // Unix ms timestamp\n];\n\n/**\n * Time cell validator\n *\n * @private\n * @validator TimeValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction timeValidator(value, callback) {\n var valid = true;\n var timeFormat = this.timeFormat || 'h:mm:ss a';\n\n if (value === null) {\n value = '';\n }\n\n value = /^\\d{3,}$/.test(value) ? parseInt(value, 10) : value;\n\n var twoDigitValue = /^\\d{1,2}$/.test(value);\n\n if (twoDigitValue) {\n value += ':00';\n }\n\n var date = (0, _moment2.default)(value, STRICT_FORMATS, true).isValid() ? (0, _moment2.default)(value) : (0, _moment2.default)(value, timeFormat);\n var isValidTime = date.isValid();\n\n // is it in the specified format\n var isValidFormat = (0, _moment2.default)(value, timeFormat, true).isValid() && !twoDigitValue;\n\n if (this.allowEmpty && value === '') {\n isValidTime = true;\n isValidFormat = true;\n }\n if (!isValidTime) {\n valid = false;\n }\n if (!isValidTime && isValidFormat) {\n valid = true;\n }\n if (isValidTime && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = date.format(timeFormat);\n var row = this.instance.runHooks('unmodifyRow', this.row);\n var column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'timeValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n/***/ }),\n/* 275 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n\nvar toObject = __webpack_require__(41)\n , toIndex = __webpack_require__(60)\n , toLength = __webpack_require__(24);\n\nmodule.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){\n var O = toObject(this)\n , len = toLength(O.length)\n , to = toIndex(target, len)\n , from = toIndex(start, len)\n , end = arguments.length > 2 ? arguments[2] : undefined\n , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)\n , inc = 1;\n if(from < to && to < from + count){\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while(count-- > 0){\n if(from in O)O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n/***/ }),\n/* 276 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n\nvar toObject = __webpack_require__(41)\n , toIndex = __webpack_require__(60)\n , toLength = __webpack_require__(24);\nmodule.exports = function fill(value /*, start = 0, end = @length */){\n var O = toObject(this)\n , length = toLength(O.length)\n , aLen = arguments.length\n , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)\n , end = aLen > 2 ? arguments[2] : undefined\n , endPos = end === undefined ? length : toIndex(end, length);\n while(endPos > index)O[index++] = value;\n return O;\n};\n\n/***/ }),\n/* 277 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , isArray = __webpack_require__(162)\n , SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n/***/ }),\n/* 278 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(277);\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};\n\n/***/ }),\n/* 279 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(39)\n , gOPS = __webpack_require__(58)\n , pIE = __webpack_require__(47);\nmodule.exports = function(it){\n var result = getKeys(it)\n , getSymbols = gOPS.f;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = pIE.f\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);\n } return result;\n};\n\n/***/ }),\n/* 280 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(18);\nmodule.exports = function(){\n var that = anObject(this)\n , result = '';\n if(that.global) result += 'g';\n if(that.ignoreCase) result += 'i';\n if(that.multiline) result += 'm';\n if(that.unicode) result += 'u';\n if(that.sticky) result += 'y';\n return result;\n};\n\n/***/ }),\n/* 281 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(15)\n , setPrototypeOf = __webpack_require__(171).set;\nmodule.exports = function(that, target, C){\n var P, S = target.constructor;\n if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){\n setPrototypeOf(that, P);\n } return that;\n};\n\n/***/ }),\n/* 282 */\n/***/ (function(module, exports) {\n\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n/***/ }),\n/* 283 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar create = __webpack_require__(78)\n , descriptor = __webpack_require__(40)\n , setToStringTag = __webpack_require__(48)\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(32)(IteratorPrototype, __webpack_require__(10)('iterator'), function(){ return this; });\n\nmodule.exports = function(Constructor, NAME, next){\n Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n/***/ }),\n/* 284 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar getKeys = __webpack_require__(39)\n , toIObject = __webpack_require__(23);\nmodule.exports = function(object, el){\n var O = toIObject(object)\n , keys = getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n};\n\n/***/ }),\n/* 285 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , macrotask = __webpack_require__(84).set\n , Observer = global.MutationObserver || global.WebKitMutationObserver\n , process = global.process\n , Promise = global.Promise\n , isNode = __webpack_require__(38)(process) == 'process';\n\nmodule.exports = function(){\n var head, last, notify;\n\n var flush = function(){\n var parent, fn;\n if(isNode && (parent = process.domain))parent.exit();\n while(head){\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch(e){\n if(head)notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if(parent)parent.enter();\n };\n\n // Node.js\n if(isNode){\n notify = function(){\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if(Observer){\n var toggle = true\n , node = document.createTextNode('');\n new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new\n notify = function(){\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if(Promise && Promise.resolve){\n var promise = Promise.resolve();\n notify = function(){\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function(){\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function(fn){\n var task = {fn: fn, next: undefined};\n if(last)last.next = task;\n if(!head){\n head = task;\n notify();\n } last = task;\n };\n};\n\n/***/ }),\n/* 286 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(19)\n , anObject = __webpack_require__(18)\n , getKeys = __webpack_require__(39);\n\nmodule.exports = __webpack_require__(21) ? Object.defineProperties : function defineProperties(O, Properties){\n anObject(O);\n var keys = getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n/***/ }),\n/* 287 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(23)\n , gOPN = __webpack_require__(80).f\n , toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function(it){\n try {\n return gOPN(it);\n } catch(e){\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it){\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n/***/ }),\n/* 288 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(22)\n , toObject = __webpack_require__(41)\n , IE_PROTO = __webpack_require__(81)('IE_PROTO')\n , ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n/***/ }),\n/* 289 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all object keys, includes non-enumerable and symbols\nvar gOPN = __webpack_require__(80)\n , gOPS = __webpack_require__(58)\n , anObject = __webpack_require__(18)\n , Reflect = __webpack_require__(13).Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it){\n var keys = gOPN.f(anObject(it))\n , getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n/***/ }),\n/* 290 */\n/***/ (function(module, exports) {\n\n// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y){\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n/***/ }),\n/* 291 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(18)\n , aFunction = __webpack_require__(71)\n , SPECIES = __webpack_require__(10)('species');\nmodule.exports = function(O, D){\n var C = anObject(O).constructor, S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n/***/ }),\n/* 292 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(61)\n , defined = __webpack_require__(30);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n/***/ }),\n/* 293 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(13)\n , core = __webpack_require__(44)\n , LIBRARY = __webpack_require__(57)\n , wksExt = __webpack_require__(175)\n , defineProperty = __webpack_require__(19).f;\nmodule.exports = function(name){\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});\n};\n\n/***/ }),\n/* 294 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 295 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 296 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 297 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 298 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 299 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_299__;\n\n/***/ }),\n/* 300 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_300__;\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=handsontable.js.map\n\n//# sourceURL=webpack:///./node_modules/handsontable/dist/handsontable.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/af.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/af.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : afrikaans (af)\n//! author : Werner Mollentze : https://github.com/wernerm\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var af = moment.defineLocale('af', {\n months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),\n weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),\n weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),\n weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),\n meridiemParse: /vm|nm/i,\n isPM : function (input) {\n return /^nm$/i.test(input);\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 12) {\n return isLower ? 'vm' : 'VM';\n } else {\n return isLower ? 'nm' : 'NM';\n }\n },\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Vandag om] LT',\n nextDay : '[Môre om] LT',\n nextWeek : 'dddd [om] LT',\n lastDay : '[Gister om] LT',\n lastWeek : '[Laas] dddd [om] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'oor %s',\n past : '%s gelede',\n s : '\\'n paar sekondes',\n m : '\\'n minuut',\n mm : '%d minute',\n h : '\\'n uur',\n hh : '%d ure',\n d : '\\'n dag',\n dd : '%d dae',\n M : '\\'n maand',\n MM : '%d maande',\n y : '\\'n jaar',\n yy : '%d jaar'\n },\n ordinalParse: /\\d{1,2}(ste|de)/,\n ordinal : function (number) {\n return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter\n },\n week : {\n dow : 1, // Maandag is die eerste dag van die week.\n doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.\n }\n });\n\n return af;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/af.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ar-ma.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ar-ma.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Moroccan Arabic (ar-ma)\n//! author : ElFadili Yassine : https://github.com/ElFadiliY\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ar_ma = moment.defineLocale('ar-ma', {\n months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),\n weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[اليوم على الساعة] LT',\n nextDay: '[غدا على الساعة] LT',\n nextWeek: 'dddd [على الساعة] LT',\n lastDay: '[أمس على الساعة] LT',\n lastWeek: 'dddd [على الساعة] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'في %s',\n past : 'منذ %s',\n s : 'ثوان',\n m : 'دقيقة',\n mm : '%d دقائق',\n h : 'ساعة',\n hh : '%d ساعات',\n d : 'يوم',\n dd : '%d أيام',\n M : 'شهر',\n MM : '%d أشهر',\n y : 'سنة',\n yy : '%d سنوات'\n },\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ar_ma;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ar-ma.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ar-sa.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ar-sa.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Arabic Saudi Arabia (ar-sa)\n//! author : Suhail Alkowaileet : https://github.com/xsoh\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '١',\n '2': '٢',\n '3': '٣',\n '4': '٤',\n '5': '٥',\n '6': '٦',\n '7': '٧',\n '8': '٨',\n '9': '٩',\n '0': '٠'\n }, numberMap = {\n '١': '1',\n '٢': '2',\n '٣': '3',\n '٤': '4',\n '٥': '5',\n '٦': '6',\n '٧': '7',\n '٨': '8',\n '٩': '9',\n '٠': '0'\n };\n\n var ar_sa = moment.defineLocale('ar-sa', {\n months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n meridiemParse: /ص|م/,\n isPM : function (input) {\n return 'م' === input;\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'م';\n }\n },\n calendar : {\n sameDay: '[اليوم على الساعة] LT',\n nextDay: '[غدا على الساعة] LT',\n nextWeek: 'dddd [على الساعة] LT',\n lastDay: '[أمس على الساعة] LT',\n lastWeek: 'dddd [على الساعة] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'في %s',\n past : 'منذ %s',\n s : 'ثوان',\n m : 'دقيقة',\n mm : '%d دقائق',\n h : 'ساعة',\n hh : '%d ساعات',\n d : 'يوم',\n dd : '%d أيام',\n M : 'شهر',\n MM : '%d أشهر',\n y : 'سنة',\n yy : '%d سنوات'\n },\n preparse: function (string) {\n return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n return numberMap[match];\n }).replace(/،/g, ',');\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n }).replace(/,/g, '،');\n },\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ar_sa;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ar-sa.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ar-tn.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ar-tn.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Tunisian Arabic (ar-tn)\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ar_tn = moment.defineLocale('ar-tn', {\n months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),\n weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact : true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[اليوم على الساعة] LT',\n nextDay: '[غدا على الساعة] LT',\n nextWeek: 'dddd [على الساعة] LT',\n lastDay: '[أمس على الساعة] LT',\n lastWeek: 'dddd [على الساعة] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'في %s',\n past: 'منذ %s',\n s: 'ثوان',\n m: 'دقيقة',\n mm: '%d دقائق',\n h: 'ساعة',\n hh: '%d ساعات',\n d: 'يوم',\n dd: '%d أيام',\n M: 'شهر',\n MM: '%d أشهر',\n y: 'سنة',\n yy: '%d سنوات'\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return ar_tn;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ar-tn.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ar.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ar.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! Locale: Arabic (ar)\n//! Author: Abdel Said: https://github.com/abdelsaid\n//! Changes in months, weekdays: Ahmed Elkhatib\n//! Native plural forms: forabi https://github.com/forabi\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '١',\n '2': '٢',\n '3': '٣',\n '4': '٤',\n '5': '٥',\n '6': '٦',\n '7': '٧',\n '8': '٨',\n '9': '٩',\n '0': '٠'\n }, numberMap = {\n '١': '1',\n '٢': '2',\n '٣': '3',\n '٤': '4',\n '٥': '5',\n '٦': '6',\n '٧': '7',\n '٨': '8',\n '٩': '9',\n '٠': '0'\n }, pluralForm = function (n) {\n return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;\n }, plurals = {\n s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],\n m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],\n h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],\n d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],\n M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],\n y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']\n }, pluralize = function (u) {\n return function (number, withoutSuffix, string, isFuture) {\n var f = pluralForm(number),\n str = plurals[u][pluralForm(number)];\n if (f === 2) {\n str = str[withoutSuffix ? 0 : 1];\n }\n return str.replace(/%d/i, number);\n };\n }, months = [\n 'كانون الثاني يناير',\n 'شباط فبراير',\n 'آذار مارس',\n 'نيسان أبريل',\n 'أيار مايو',\n 'حزيران يونيو',\n 'تموز يوليو',\n 'آب أغسطس',\n 'أيلول سبتمبر',\n 'تشرين الأول أكتوبر',\n 'تشرين الثاني نوفمبر',\n 'كانون الأول ديسمبر'\n ];\n\n var ar = moment.defineLocale('ar', {\n months : months,\n monthsShort : months,\n weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),\n weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),\n weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'D/\\u200FM/\\u200FYYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n meridiemParse: /ص|م/,\n isPM : function (input) {\n return 'م' === input;\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ص';\n } else {\n return 'م';\n }\n },\n calendar : {\n sameDay: '[اليوم عند الساعة] LT',\n nextDay: '[غدًا عند الساعة] LT',\n nextWeek: 'dddd [عند الساعة] LT',\n lastDay: '[أمس عند الساعة] LT',\n lastWeek: 'dddd [عند الساعة] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'بعد %s',\n past : 'منذ %s',\n s : pluralize('s'),\n m : pluralize('m'),\n mm : pluralize('m'),\n h : pluralize('h'),\n hh : pluralize('h'),\n d : pluralize('d'),\n dd : pluralize('d'),\n M : pluralize('M'),\n MM : pluralize('M'),\n y : pluralize('y'),\n yy : pluralize('y')\n },\n preparse: function (string) {\n return string.replace(/\\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {\n return numberMap[match];\n }).replace(/،/g, ',');\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n }).replace(/,/g, '،');\n },\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ar;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ar.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/az.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/az.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : azerbaijani (az)\n//! author : topchiyev : https://github.com/topchiyev\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var suffixes = {\n 1: '-inci',\n 5: '-inci',\n 8: '-inci',\n 70: '-inci',\n 80: '-inci',\n 2: '-nci',\n 7: '-nci',\n 20: '-nci',\n 50: '-nci',\n 3: '-üncü',\n 4: '-üncü',\n 100: '-üncü',\n 6: '-ncı',\n 9: '-uncu',\n 10: '-uncu',\n 30: '-uncu',\n 60: '-ıncı',\n 90: '-ıncı'\n };\n\n var az = moment.defineLocale('az', {\n months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),\n monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),\n weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),\n weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),\n weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[bugün saat] LT',\n nextDay : '[sabah saat] LT',\n nextWeek : '[gələn həftə] dddd [saat] LT',\n lastDay : '[dünən] LT',\n lastWeek : '[keçən həftə] dddd [saat] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s sonra',\n past : '%s əvvəl',\n s : 'birneçə saniyyə',\n m : 'bir dəqiqə',\n mm : '%d dəqiqə',\n h : 'bir saat',\n hh : '%d saat',\n d : 'bir gün',\n dd : '%d gün',\n M : 'bir ay',\n MM : '%d ay',\n y : 'bir il',\n yy : '%d il'\n },\n meridiemParse: /gecə|səhər|gündüz|axşam/,\n isPM : function (input) {\n return /^(gündüz|axşam)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'gecə';\n } else if (hour < 12) {\n return 'səhər';\n } else if (hour < 17) {\n return 'gündüz';\n } else {\n return 'axşam';\n }\n },\n ordinalParse: /\\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,\n ordinal : function (number) {\n if (number === 0) { // special case for zero\n return number + '-ıncı';\n }\n var a = number % 10,\n b = number % 100 - a,\n c = number >= 100 ? 100 : null;\n return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return az;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/az.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/be.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/be.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : belarusian (be)\n//! author : Dmitry Demidov : https://github.com/demidov91\n//! author: Praleska: http://praleska.pro/\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',\n 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',\n 'dd': 'дзень_дні_дзён',\n 'MM': 'месяц_месяцы_месяцаў',\n 'yy': 'год_гады_гадоў'\n };\n if (key === 'm') {\n return withoutSuffix ? 'хвіліна' : 'хвіліну';\n }\n else if (key === 'h') {\n return withoutSuffix ? 'гадзіна' : 'гадзіну';\n }\n else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n\n var be = moment.defineLocale('be', {\n months : {\n format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),\n standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')\n },\n monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),\n weekdays : {\n format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),\n standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),\n isFormat: /\\[ ?[Вв] ?(?:мінулую|наступную)? ?\\] ?dddd/\n },\n weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY г.',\n LLL : 'D MMMM YYYY г., HH:mm',\n LLLL : 'dddd, D MMMM YYYY г., HH:mm'\n },\n calendar : {\n sameDay: '[Сёння ў] LT',\n nextDay: '[Заўтра ў] LT',\n lastDay: '[Учора ў] LT',\n nextWeek: function () {\n return '[У] dddd [ў] LT';\n },\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 5:\n case 6:\n return '[У мінулую] dddd [ў] LT';\n case 1:\n case 2:\n case 4:\n return '[У мінулы] dddd [ў] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'праз %s',\n past : '%s таму',\n s : 'некалькі секунд',\n m : relativeTimeWithPlural,\n mm : relativeTimeWithPlural,\n h : relativeTimeWithPlural,\n hh : relativeTimeWithPlural,\n d : 'дзень',\n dd : relativeTimeWithPlural,\n M : 'месяц',\n MM : relativeTimeWithPlural,\n y : 'год',\n yy : relativeTimeWithPlural\n },\n meridiemParse: /ночы|раніцы|дня|вечара/,\n isPM : function (input) {\n return /^(дня|вечара)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночы';\n } else if (hour < 12) {\n return 'раніцы';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечара';\n }\n },\n ordinalParse: /\\d{1,2}-(і|ы|га)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n case 'w':\n case 'W':\n return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';\n case 'D':\n return number + '-га';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return be;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/be.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/bg.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/bg.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : bulgarian (bg)\n//! author : Krasen Borisov : https://github.com/kraz\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var bg = moment.defineLocale('bg', {\n months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),\n monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),\n weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),\n weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),\n weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'D.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY H:mm',\n LLLL : 'dddd, D MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[Днес в] LT',\n nextDay : '[Утре в] LT',\n nextWeek : 'dddd [в] LT',\n lastDay : '[Вчера в] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 6:\n return '[В изминалата] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[В изминалия] dddd [в] LT';\n }\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'след %s',\n past : 'преди %s',\n s : 'няколко секунди',\n m : 'минута',\n mm : '%d минути',\n h : 'час',\n hh : '%d часа',\n d : 'ден',\n dd : '%d дни',\n M : 'месец',\n MM : '%d месеца',\n y : 'година',\n yy : '%d години'\n },\n ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n ordinal : function (number) {\n var lastDigit = number % 10,\n last2Digits = number % 100;\n if (number === 0) {\n return number + '-ев';\n } else if (last2Digits === 0) {\n return number + '-ен';\n } else if (last2Digits > 10 && last2Digits < 20) {\n return number + '-ти';\n } else if (lastDigit === 1) {\n return number + '-ви';\n } else if (lastDigit === 2) {\n return number + '-ри';\n } else if (lastDigit === 7 || lastDigit === 8) {\n return number + '-ми';\n } else {\n return number + '-ти';\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return bg;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/bg.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/bn.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/bn.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Bengali (bn)\n//! author : Kaushik Gandhi : https://github.com/kaushikgandhi\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '১',\n '2': '২',\n '3': '৩',\n '4': '৪',\n '5': '৫',\n '6': '৬',\n '7': '৭',\n '8': '৮',\n '9': '৯',\n '0': '০'\n },\n numberMap = {\n '১': '1',\n '২': '2',\n '৩': '3',\n '৪': '4',\n '৫': '5',\n '৬': '6',\n '৭': '7',\n '৮': '8',\n '৯': '9',\n '০': '0'\n };\n\n var bn = moment.defineLocale('bn', {\n months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),\n monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'),\n weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'),\n weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'),\n weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'),\n longDateFormat : {\n LT : 'A h:mm সময়',\n LTS : 'A h:mm:ss সময়',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm সময়',\n LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'\n },\n calendar : {\n sameDay : '[আজ] LT',\n nextDay : '[আগামীকাল] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[গতকাল] LT',\n lastWeek : '[গত] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s পরে',\n past : '%s আগে',\n s : 'কয়েক সেকেন্ড',\n m : 'এক মিনিট',\n mm : '%d মিনিট',\n h : 'এক ঘন্টা',\n hh : '%d ঘন্টা',\n d : 'এক দিন',\n dd : '%d দিন',\n M : 'এক মাস',\n MM : '%d মাস',\n y : 'এক বছর',\n yy : '%d বছর'\n },\n preparse: function (string) {\n return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if ((meridiem === 'রাত' && hour >= 4) ||\n (meridiem === 'দুপুর' && hour < 5) ||\n meridiem === 'বিকাল') {\n return hour + 12;\n } else {\n return hour;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'রাত';\n } else if (hour < 10) {\n return 'সকাল';\n } else if (hour < 17) {\n return 'দুপুর';\n } else if (hour < 20) {\n return 'বিকাল';\n } else {\n return 'রাত';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return bn;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/bn.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/bo.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/bo.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : tibetan (bo)\n//! author : Thupten N. Chakrishar : https://github.com/vajradog\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '༡',\n '2': '༢',\n '3': '༣',\n '4': '༤',\n '5': '༥',\n '6': '༦',\n '7': '༧',\n '8': '༨',\n '9': '༩',\n '0': '༠'\n },\n numberMap = {\n '༡': '1',\n '༢': '2',\n '༣': '3',\n '༤': '4',\n '༥': '5',\n '༦': '6',\n '༧': '7',\n '༨': '8',\n '༩': '9',\n '༠': '0'\n };\n\n var bo = moment.defineLocale('bo', {\n months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),\n weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),\n weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),\n longDateFormat : {\n LT : 'A h:mm',\n LTS : 'A h:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm',\n LLLL : 'dddd, D MMMM YYYY, A h:mm'\n },\n calendar : {\n sameDay : '[དི་རིང] LT',\n nextDay : '[སང་ཉིན] LT',\n nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',\n lastDay : '[ཁ་སང] LT',\n lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s ལ་',\n past : '%s སྔན་ལ',\n s : 'ལམ་སང',\n m : 'སྐར་མ་གཅིག',\n mm : '%d སྐར་མ',\n h : 'ཆུ་ཚོད་གཅིག',\n hh : '%d ཆུ་ཚོད',\n d : 'ཉིན་གཅིག',\n dd : '%d ཉིན་',\n M : 'ཟླ་བ་གཅིག',\n MM : '%d ཟླ་བ',\n y : 'ལོ་གཅིག',\n yy : '%d ལོ'\n },\n preparse: function (string) {\n return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if ((meridiem === 'མཚན་མོ' && hour >= 4) ||\n (meridiem === 'ཉིན་གུང' && hour < 5) ||\n meridiem === 'དགོང་དག') {\n return hour + 12;\n } else {\n return hour;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'མཚན་མོ';\n } else if (hour < 10) {\n return 'ཞོགས་ཀས';\n } else if (hour < 17) {\n return 'ཉིན་གུང';\n } else if (hour < 20) {\n return 'དགོང་དག';\n } else {\n return 'མཚན་མོ';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return bo;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/bo.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/br.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/br.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : breton (br)\n//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function relativeTimeWithMutation(number, withoutSuffix, key) {\n var format = {\n 'mm': 'munutenn',\n 'MM': 'miz',\n 'dd': 'devezh'\n };\n return number + ' ' + mutation(format[key], number);\n }\n function specialMutationForYears(number) {\n switch (lastNumber(number)) {\n case 1:\n case 3:\n case 4:\n case 5:\n case 9:\n return number + ' bloaz';\n default:\n return number + ' vloaz';\n }\n }\n function lastNumber(number) {\n if (number > 9) {\n return lastNumber(number % 10);\n }\n return number;\n }\n function mutation(text, number) {\n if (number === 2) {\n return softMutation(text);\n }\n return text;\n }\n function softMutation(text) {\n var mutationTable = {\n 'm': 'v',\n 'b': 'v',\n 'd': 'z'\n };\n if (mutationTable[text.charAt(0)] === undefined) {\n return text;\n }\n return mutationTable[text.charAt(0)] + text.substring(1);\n }\n\n var br = moment.defineLocale('br', {\n months : 'Genver_C\\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),\n monthsShort : 'Gen_C\\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),\n weekdays : 'Sul_Lun_Meurzh_Merc\\'her_Yaou_Gwener_Sadorn'.split('_'),\n weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),\n weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'h[e]mm A',\n LTS : 'h[e]mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D [a viz] MMMM YYYY',\n LLL : 'D [a viz] MMMM YYYY h[e]mm A',\n LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'\n },\n calendar : {\n sameDay : '[Hiziv da] LT',\n nextDay : '[Warc\\'hoazh da] LT',\n nextWeek : 'dddd [da] LT',\n lastDay : '[Dec\\'h da] LT',\n lastWeek : 'dddd [paset da] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'a-benn %s',\n past : '%s \\'zo',\n s : 'un nebeud segondennoù',\n m : 'ur vunutenn',\n mm : relativeTimeWithMutation,\n h : 'un eur',\n hh : '%d eur',\n d : 'un devezh',\n dd : relativeTimeWithMutation,\n M : 'ur miz',\n MM : relativeTimeWithMutation,\n y : 'ur bloaz',\n yy : specialMutationForYears\n },\n ordinalParse: /\\d{1,2}(añ|vet)/,\n ordinal : function (number) {\n var output = (number === 1) ? 'añ' : 'vet';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return br;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/br.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/bs.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/bs.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;\n }\n }\n\n var bs = moment.defineLocale('bs', {\n months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),\n monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD. MM. YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd, D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[danas u] LT',\n nextDay : '[sutra u] LT',\n nextWeek : function () {\n switch (this.day()) {\n case 0:\n return '[u] [nedjelju] [u] LT';\n case 3:\n return '[u] [srijedu] [u] LT';\n case 6:\n return '[u] [subotu] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[u] dddd [u] LT';\n }\n },\n lastDay : '[jučer u] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 0:\n case 3:\n return '[prošlu] dddd [u] LT';\n case 6:\n return '[prošle] [subote] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[prošli] dddd [u] LT';\n }\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'prije %s',\n s : 'par sekundi',\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : 'dan',\n dd : translate,\n M : 'mjesec',\n MM : translate,\n y : 'godinu',\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return bs;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/bs.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ca.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ca.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : catalan (ca)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ca = moment.defineLocale('ca', {\n months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),\n monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),\n monthsParseExact : true,\n weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),\n weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),\n weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY H:mm',\n LLLL : 'dddd D MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : function () {\n return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n },\n nextDay : function () {\n return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n },\n nextWeek : function () {\n return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n },\n lastDay : function () {\n return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n },\n lastWeek : function () {\n return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'en %s',\n past : 'fa %s',\n s : 'uns segons',\n m : 'un minut',\n mm : '%d minuts',\n h : 'una hora',\n hh : '%d hores',\n d : 'un dia',\n dd : '%d dies',\n M : 'un mes',\n MM : '%d mesos',\n y : 'un any',\n yy : '%d anys'\n },\n ordinalParse: /\\d{1,2}(r|n|t|è|a)/,\n ordinal : function (number, period) {\n var output = (number === 1) ? 'r' :\n (number === 2) ? 'n' :\n (number === 3) ? 'r' :\n (number === 4) ? 't' : 'è';\n if (period === 'w' || period === 'W') {\n output = 'a';\n }\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return ca;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ca.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/cs.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/cs.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : czech (cs)\n//! author : petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'),\n monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');\n function plural(n) {\n return (n > 1) && (n < 5) && (~~(n / 10) !== 1);\n }\n function translate(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's': // a few seconds / in a few seconds / a few seconds ago\n return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';\n case 'm': // a minute / in a minute / a minute ago\n return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');\n case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'minuty' : 'minut');\n } else {\n return result + 'minutami';\n }\n break;\n case 'h': // an hour / in an hour / an hour ago\n return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n case 'hh': // 9 hours / in 9 hours / 9 hours ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'hodiny' : 'hodin');\n } else {\n return result + 'hodinami';\n }\n break;\n case 'd': // a day / in a day / a day ago\n return (withoutSuffix || isFuture) ? 'den' : 'dnem';\n case 'dd': // 9 days / in 9 days / 9 days ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'dny' : 'dní');\n } else {\n return result + 'dny';\n }\n break;\n case 'M': // a month / in a month / a month ago\n return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';\n case 'MM': // 9 months / in 9 months / 9 months ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'měsíce' : 'měsíců');\n } else {\n return result + 'měsíci';\n }\n break;\n case 'y': // a year / in a year / a year ago\n return (withoutSuffix || isFuture) ? 'rok' : 'rokem';\n case 'yy': // 9 years / in 9 years / 9 years ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'roky' : 'let');\n } else {\n return result + 'lety';\n }\n break;\n }\n }\n\n var cs = moment.defineLocale('cs', {\n months : months,\n monthsShort : monthsShort,\n monthsParse : (function (months, monthsShort) {\n var i, _monthsParse = [];\n for (i = 0; i < 12; i++) {\n // use custom parser to solve problem with July (červenec)\n _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');\n }\n return _monthsParse;\n }(months, monthsShort)),\n shortMonthsParse : (function (monthsShort) {\n var i, _shortMonthsParse = [];\n for (i = 0; i < 12; i++) {\n _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');\n }\n return _shortMonthsParse;\n }(monthsShort)),\n longMonthsParse : (function (months) {\n var i, _longMonthsParse = [];\n for (i = 0; i < 12; i++) {\n _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');\n }\n return _longMonthsParse;\n }(months)),\n weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),\n weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),\n weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),\n longDateFormat : {\n LT: 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay: '[dnes v] LT',\n nextDay: '[zítra v] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[v neděli v] LT';\n case 1:\n case 2:\n return '[v] dddd [v] LT';\n case 3:\n return '[ve středu v] LT';\n case 4:\n return '[ve čtvrtek v] LT';\n case 5:\n return '[v pátek v] LT';\n case 6:\n return '[v sobotu v] LT';\n }\n },\n lastDay: '[včera v] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[minulou neděli v] LT';\n case 1:\n case 2:\n return '[minulé] dddd [v] LT';\n case 3:\n return '[minulou středu v] LT';\n case 4:\n case 5:\n return '[minulý] dddd [v] LT';\n case 6:\n return '[minulou sobotu v] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'před %s',\n s : translate,\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n ordinalParse : /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return cs;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/cs.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/cv.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/cv.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : chuvash (cv)\n//! author : Anatoly Mironov : https://github.com/mirontoli\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var cv = moment.defineLocale('cv', {\n months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),\n monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),\n weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),\n weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),\n weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',\n LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',\n LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'\n },\n calendar : {\n sameDay: '[Паян] LT [сехетре]',\n nextDay: '[Ыран] LT [сехетре]',\n lastDay: '[Ӗнер] LT [сехетре]',\n nextWeek: '[Ҫитес] dddd LT [сехетре]',\n lastWeek: '[Иртнӗ] dddd LT [сехетре]',\n sameElse: 'L'\n },\n relativeTime : {\n future : function (output) {\n var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';\n return output + affix;\n },\n past : '%s каялла',\n s : 'пӗр-ик ҫеккунт',\n m : 'пӗр минут',\n mm : '%d минут',\n h : 'пӗр сехет',\n hh : '%d сехет',\n d : 'пӗр кун',\n dd : '%d кун',\n M : 'пӗр уйӑх',\n MM : '%d уйӑх',\n y : 'пӗр ҫул',\n yy : '%d ҫул'\n },\n ordinalParse: /\\d{1,2}-мӗш/,\n ordinal : '%d-мӗш',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return cv;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/cv.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/cy.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/cy.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Welsh (cy)\n//! author : Robert Allen\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var cy = moment.defineLocale('cy', {\n months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),\n monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),\n weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),\n weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),\n weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),\n weekdaysParseExact : true,\n // time formats are the same as en-gb\n longDateFormat: {\n LT: 'HH:mm',\n LTS : 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[Heddiw am] LT',\n nextDay: '[Yfory am] LT',\n nextWeek: 'dddd [am] LT',\n lastDay: '[Ddoe am] LT',\n lastWeek: 'dddd [diwethaf am] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'mewn %s',\n past: '%s yn ôl',\n s: 'ychydig eiliadau',\n m: 'munud',\n mm: '%d munud',\n h: 'awr',\n hh: '%d awr',\n d: 'diwrnod',\n dd: '%d diwrnod',\n M: 'mis',\n MM: '%d mis',\n y: 'blwyddyn',\n yy: '%d flynedd'\n },\n ordinalParse: /\\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,\n // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh\n ordinal: function (number) {\n var b = number,\n output = '',\n lookup = [\n '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed\n 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed\n ];\n if (b > 20) {\n if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {\n output = 'fed'; // not 30ain, 70ain or 90ain\n } else {\n output = 'ain';\n }\n } else if (b > 0) {\n output = lookup[b];\n }\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return cy;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/cy.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/da.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/da.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : danish (da)\n//! author : Ulrik Nielsen : https://github.com/mrbase\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var da = moment.defineLocale('da', {\n months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),\n monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),\n weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY HH:mm',\n LLLL : 'dddd [d.] D. MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[I dag kl.] LT',\n nextDay : '[I morgen kl.] LT',\n nextWeek : 'dddd [kl.] LT',\n lastDay : '[I går kl.] LT',\n lastWeek : '[sidste] dddd [kl] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'om %s',\n past : '%s siden',\n s : 'få sekunder',\n m : 'et minut',\n mm : '%d minutter',\n h : 'en time',\n hh : '%d timer',\n d : 'en dag',\n dd : '%d dage',\n M : 'en måned',\n MM : '%d måneder',\n y : 'et år',\n yy : '%d år'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return da;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/da.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/de-at.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/de-at.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : austrian german (de-at)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eine Minute', 'einer Minute'],\n 'h': ['eine Stunde', 'einer Stunde'],\n 'd': ['ein Tag', 'einem Tag'],\n 'dd': [number + ' Tage', number + ' Tagen'],\n 'M': ['ein Monat', 'einem Monat'],\n 'MM': [number + ' Monate', number + ' Monaten'],\n 'y': ['ein Jahr', 'einem Jahr'],\n 'yy': [number + ' Jahre', number + ' Jahren']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var de_at = moment.defineLocale('de-at', {\n months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n monthsParseExact : true,\n weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY HH:mm',\n LLLL : 'dddd, D. MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]'\n },\n relativeTime : {\n future : 'in %s',\n past : 'vor %s',\n s : 'ein paar Sekunden',\n m : processRelativeTime,\n mm : '%d Minuten',\n h : processRelativeTime,\n hh : '%d Stunden',\n d : processRelativeTime,\n dd : processRelativeTime,\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return de_at;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/de-at.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/de.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/de.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : german (de)\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eine Minute', 'einer Minute'],\n 'h': ['eine Stunde', 'einer Stunde'],\n 'd': ['ein Tag', 'einem Tag'],\n 'dd': [number + ' Tage', number + ' Tagen'],\n 'M': ['ein Monat', 'einem Monat'],\n 'MM': [number + ' Monate', number + ' Monaten'],\n 'y': ['ein Jahr', 'einem Jahr'],\n 'yy': [number + ' Jahre', number + ' Jahren']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var de = moment.defineLocale('de', {\n months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n monthsParseExact : true,\n weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),\n weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY HH:mm',\n LLLL : 'dddd, D. MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]'\n },\n relativeTime : {\n future : 'in %s',\n past : 'vor %s',\n s : 'ein paar Sekunden',\n m : processRelativeTime,\n mm : '%d Minuten',\n h : processRelativeTime,\n hh : '%d Stunden',\n d : processRelativeTime,\n dd : processRelativeTime,\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return de;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/de.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/dv.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/dv.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : dhivehi (dv)\n//! author : Jawish Hameed : https://github.com/jawish\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var months = [\n 'ޖެނުއަރީ',\n 'ފެބްރުއަރީ',\n 'މާރިޗު',\n 'އޭޕްރީލު',\n 'މޭ',\n 'ޖޫން',\n 'ޖުލައި',\n 'އޯގަސްޓު',\n 'ސެޕްޓެމްބަރު',\n 'އޮކްޓޯބަރު',\n 'ނޮވެމްބަރު',\n 'ޑިސެމްބަރު'\n ], weekdays = [\n 'އާދިއްތަ',\n 'ހޯމަ',\n 'އަންގާރަ',\n 'ބުދަ',\n 'ބުރާސްފަތި',\n 'ހުކުރު',\n 'ހޮނިހިރު'\n ];\n\n var dv = moment.defineLocale('dv', {\n months : months,\n monthsShort : months,\n weekdays : weekdays,\n weekdaysShort : weekdays,\n weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),\n longDateFormat : {\n\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'D/M/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n meridiemParse: /މކ|މފ/,\n isPM : function (input) {\n return 'މފ' === input;\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'މކ';\n } else {\n return 'މފ';\n }\n },\n calendar : {\n sameDay : '[މިއަދު] LT',\n nextDay : '[މާދަމާ] LT',\n nextWeek : 'dddd LT',\n lastDay : '[އިއްޔެ] LT',\n lastWeek : '[ފާއިތުވި] dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'ތެރޭގައި %s',\n past : 'ކުރިން %s',\n s : 'ސިކުންތުކޮޅެއް',\n m : 'މިނިޓެއް',\n mm : 'މިނިޓު %d',\n h : 'ގަޑިއިރެއް',\n hh : 'ގަޑިއިރު %d',\n d : 'ދުވަހެއް',\n dd : 'ދުވަސް %d',\n M : 'މަހެއް',\n MM : 'މަސް %d',\n y : 'އަހަރެއް',\n yy : 'އަހަރު %d'\n },\n preparse: function (string) {\n return string.replace(/،/g, ',');\n },\n postformat: function (string) {\n return string.replace(/,/g, '،');\n },\n week : {\n dow : 7, // Sunday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return dv;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/dv.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/el.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/el.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : modern greek (el)\n//! author : Aggelos Karalias : https://github.com/mehiel\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n\n var el = moment.defineLocale('el', {\n monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),\n monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),\n months : function (momentToFormat, format) {\n if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'\n return this._monthsGenitiveEl[momentToFormat.month()];\n } else {\n return this._monthsNominativeEl[momentToFormat.month()];\n }\n },\n monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),\n weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),\n weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),\n weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),\n meridiem : function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'μμ' : 'ΜΜ';\n } else {\n return isLower ? 'πμ' : 'ΠΜ';\n }\n },\n isPM : function (input) {\n return ((input + '').toLowerCase()[0] === 'μ');\n },\n meridiemParse : /[ΠΜ]\\.?Μ?\\.?/i,\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendarEl : {\n sameDay : '[Σήμερα {}] LT',\n nextDay : '[Αύριο {}] LT',\n nextWeek : 'dddd [{}] LT',\n lastDay : '[Χθες {}] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 6:\n return '[το προηγούμενο] dddd [{}] LT';\n default:\n return '[την προηγούμενη] dddd [{}] LT';\n }\n },\n sameElse : 'L'\n },\n calendar : function (key, mom) {\n var output = this._calendarEl[key],\n hours = mom && mom.hours();\n if (isFunction(output)) {\n output = output.apply(mom);\n }\n return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));\n },\n relativeTime : {\n future : 'σε %s',\n past : '%s πριν',\n s : 'λίγα δευτερόλεπτα',\n m : 'ένα λεπτό',\n mm : '%d λεπτά',\n h : 'μία ώρα',\n hh : '%d ώρες',\n d : 'μία μέρα',\n dd : '%d μέρες',\n M : 'ένας μήνας',\n MM : '%d μήνες',\n y : 'ένας χρόνος',\n yy : '%d χρόνια'\n },\n ordinalParse: /\\d{1,2}η/,\n ordinal: '%dη',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4st is the first week of the year.\n }\n });\n\n return el;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/el.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/en-au.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/en-au.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : australian english (en-au)\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var en_au = moment.defineLocale('en-au', {\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return en_au;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/en-au.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/en-ca.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/en-ca.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : canadian english (en-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var en_ca = moment.defineLocale('en-ca', {\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'YYYY-MM-DD',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n return en_ca;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/en-ca.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/en-gb.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/en-gb.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : great britain english (en-gb)\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var en_gb = moment.defineLocale('en-gb', {\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return en_gb;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/en-gb.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/en-ie.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/en-ie.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Irish english (en-ie)\n//! author : Chris Cartlidge : https://github.com/chriscartlidge\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var en_ie = moment.defineLocale('en-ie', {\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return en_ie;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/en-ie.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/en-nz.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/en-nz.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : New Zealand english (en-nz)\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var en_nz = moment.defineLocale('en-nz', {\n months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),\n weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendar : {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n },\n ordinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return en_nz;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/en-nz.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/eo.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/eo.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : esperanto (eo)\n//! author : Colin Dean : https://github.com/colindean\n//! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.\n//! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var eo = moment.defineLocale('eo', {\n months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),\n monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),\n weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),\n weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),\n weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'D[-an de] MMMM, YYYY',\n LLL : 'D[-an de] MMMM, YYYY HH:mm',\n LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm'\n },\n meridiemParse: /[ap]\\.t\\.m/i,\n isPM: function (input) {\n return input.charAt(0).toLowerCase() === 'p';\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'p.t.m.' : 'P.T.M.';\n } else {\n return isLower ? 'a.t.m.' : 'A.T.M.';\n }\n },\n calendar : {\n sameDay : '[Hodiaŭ je] LT',\n nextDay : '[Morgaŭ je] LT',\n nextWeek : 'dddd [je] LT',\n lastDay : '[Hieraŭ je] LT',\n lastWeek : '[pasinta] dddd [je] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'je %s',\n past : 'antaŭ %s',\n s : 'sekundoj',\n m : 'minuto',\n mm : '%d minutoj',\n h : 'horo',\n hh : '%d horoj',\n d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo\n dd : '%d tagoj',\n M : 'monato',\n MM : '%d monatoj',\n y : 'jaro',\n yy : '%d jaroj'\n },\n ordinalParse: /\\d{1,2}a/,\n ordinal : '%da',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return eo;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/eo.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/es.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/es.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : spanish (es)\n//! author : Julio Napurí : https://github.com/julionc\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');\n\n var es = moment.defineLocale('es', {\n months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),\n monthsShort : function (m, format) {\n if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsParseExact : true,\n weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D [de] MMMM [de] YYYY',\n LLL : 'D [de] MMMM [de] YYYY H:mm',\n LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'\n },\n calendar : {\n sameDay : function () {\n return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n nextDay : function () {\n return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n nextWeek : function () {\n return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n lastDay : function () {\n return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n lastWeek : function () {\n return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'en %s',\n past : 'hace %s',\n s : 'unos segundos',\n m : 'un minuto',\n mm : '%d minutos',\n h : 'una hora',\n hh : '%d horas',\n d : 'un día',\n dd : '%d días',\n M : 'un mes',\n MM : '%d meses',\n y : 'un año',\n yy : '%d años'\n },\n ordinalParse : /\\d{1,2}º/,\n ordinal : '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return es;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/es.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/et.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/et.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : estonian (et)\n//! author : Henry Kehlmann : https://github.com/madhenry\n//! improvements : Illimar Tambek : https://github.com/ragulka\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],\n 'm' : ['ühe minuti', 'üks minut'],\n 'mm': [number + ' minuti', number + ' minutit'],\n 'h' : ['ühe tunni', 'tund aega', 'üks tund'],\n 'hh': [number + ' tunni', number + ' tundi'],\n 'd' : ['ühe päeva', 'üks päev'],\n 'M' : ['kuu aja', 'kuu aega', 'üks kuu'],\n 'MM': [number + ' kuu', number + ' kuud'],\n 'y' : ['ühe aasta', 'aasta', 'üks aasta'],\n 'yy': [number + ' aasta', number + ' aastat']\n };\n if (withoutSuffix) {\n return format[key][2] ? format[key][2] : format[key][1];\n }\n return isFuture ? format[key][0] : format[key][1];\n }\n\n var et = moment.defineLocale('et', {\n months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),\n monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),\n weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),\n weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),\n weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd, D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[Täna,] LT',\n nextDay : '[Homme,] LT',\n nextWeek : '[Järgmine] dddd LT',\n lastDay : '[Eile,] LT',\n lastWeek : '[Eelmine] dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s pärast',\n past : '%s tagasi',\n s : processRelativeTime,\n m : processRelativeTime,\n mm : processRelativeTime,\n h : processRelativeTime,\n hh : processRelativeTime,\n d : processRelativeTime,\n dd : '%d päeva',\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return et;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/et.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/eu.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/eu.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : euskara (eu)\n//! author : Eneko Illarramendi : https://github.com/eillarra\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var eu = moment.defineLocale('eu', {\n months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),\n monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),\n monthsParseExact : true,\n weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),\n weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),\n weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'YYYY[ko] MMMM[ren] D[a]',\n LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',\n LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',\n l : 'YYYY-M-D',\n ll : 'YYYY[ko] MMM D[a]',\n lll : 'YYYY[ko] MMM D[a] HH:mm',\n llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'\n },\n calendar : {\n sameDay : '[gaur] LT[etan]',\n nextDay : '[bihar] LT[etan]',\n nextWeek : 'dddd LT[etan]',\n lastDay : '[atzo] LT[etan]',\n lastWeek : '[aurreko] dddd LT[etan]',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s barru',\n past : 'duela %s',\n s : 'segundo batzuk',\n m : 'minutu bat',\n mm : '%d minutu',\n h : 'ordu bat',\n hh : '%d ordu',\n d : 'egun bat',\n dd : '%d egun',\n M : 'hilabete bat',\n MM : '%d hilabete',\n y : 'urte bat',\n yy : '%d urte'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return eu;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/eu.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fa.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fa.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Persian (fa)\n//! author : Ebrahim Byagowi : https://github.com/ebraminio\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '۱',\n '2': '۲',\n '3': '۳',\n '4': '۴',\n '5': '۵',\n '6': '۶',\n '7': '۷',\n '8': '۸',\n '9': '۹',\n '0': '۰'\n }, numberMap = {\n '۱': '1',\n '۲': '2',\n '۳': '3',\n '۴': '4',\n '۵': '5',\n '۶': '6',\n '۷': '7',\n '۸': '8',\n '۹': '9',\n '۰': '0'\n };\n\n var fa = moment.defineLocale('fa', {\n months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),\n weekdays : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n weekdaysShort : 'یک\\u200cشنبه_دوشنبه_سه\\u200cشنبه_چهارشنبه_پنج\\u200cشنبه_جمعه_شنبه'.split('_'),\n weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n meridiemParse: /قبل از ظهر|بعد از ظهر/,\n isPM: function (input) {\n return /بعد از ظهر/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'قبل از ظهر';\n } else {\n return 'بعد از ظهر';\n }\n },\n calendar : {\n sameDay : '[امروز ساعت] LT',\n nextDay : '[فردا ساعت] LT',\n nextWeek : 'dddd [ساعت] LT',\n lastDay : '[دیروز ساعت] LT',\n lastWeek : 'dddd [پیش] [ساعت] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'در %s',\n past : '%s پیش',\n s : 'چندین ثانیه',\n m : 'یک دقیقه',\n mm : '%d دقیقه',\n h : 'یک ساعت',\n hh : '%d ساعت',\n d : 'یک روز',\n dd : '%d روز',\n M : 'یک ماه',\n MM : '%d ماه',\n y : 'یک سال',\n yy : '%d سال'\n },\n preparse: function (string) {\n return string.replace(/[۰-۹]/g, function (match) {\n return numberMap[match];\n }).replace(/،/g, ',');\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n }).replace(/,/g, '،');\n },\n ordinalParse: /\\d{1,2}م/,\n ordinal : '%dم',\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return fa;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fa.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fi.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fi.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : finnish (fi)\n//! author : Tarmo Aidantausta : https://github.com/bleadof\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '),\n numbersFuture = [\n 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',\n numbersPast[7], numbersPast[8], numbersPast[9]\n ];\n function translate(number, withoutSuffix, key, isFuture) {\n var result = '';\n switch (key) {\n case 's':\n return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';\n case 'm':\n return isFuture ? 'minuutin' : 'minuutti';\n case 'mm':\n result = isFuture ? 'minuutin' : 'minuuttia';\n break;\n case 'h':\n return isFuture ? 'tunnin' : 'tunti';\n case 'hh':\n result = isFuture ? 'tunnin' : 'tuntia';\n break;\n case 'd':\n return isFuture ? 'päivän' : 'päivä';\n case 'dd':\n result = isFuture ? 'päivän' : 'päivää';\n break;\n case 'M':\n return isFuture ? 'kuukauden' : 'kuukausi';\n case 'MM':\n result = isFuture ? 'kuukauden' : 'kuukautta';\n break;\n case 'y':\n return isFuture ? 'vuoden' : 'vuosi';\n case 'yy':\n result = isFuture ? 'vuoden' : 'vuotta';\n break;\n }\n result = verbalNumber(number, isFuture) + ' ' + result;\n return result;\n }\n function verbalNumber(number, isFuture) {\n return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;\n }\n\n var fi = moment.defineLocale('fi', {\n months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),\n monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),\n weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),\n weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),\n weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD.MM.YYYY',\n LL : 'Do MMMM[ta] YYYY',\n LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',\n LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',\n l : 'D.M.YYYY',\n ll : 'Do MMM YYYY',\n lll : 'Do MMM YYYY, [klo] HH.mm',\n llll : 'ddd, Do MMM YYYY, [klo] HH.mm'\n },\n calendar : {\n sameDay : '[tänään] [klo] LT',\n nextDay : '[huomenna] [klo] LT',\n nextWeek : 'dddd [klo] LT',\n lastDay : '[eilen] [klo] LT',\n lastWeek : '[viime] dddd[na] [klo] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s päästä',\n past : '%s sitten',\n s : translate,\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fi;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fi.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fo.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fo.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : faroese (fo)\n//! author : Ragnar Johannesen : https://github.com/ragnar123\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var fo = moment.defineLocale('fo', {\n months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),\n weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),\n weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D. MMMM, YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Í dag kl.] LT',\n nextDay : '[Í morgin kl.] LT',\n nextWeek : 'dddd [kl.] LT',\n lastDay : '[Í gjár kl.] LT',\n lastWeek : '[síðstu] dddd [kl] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'um %s',\n past : '%s síðani',\n s : 'fá sekund',\n m : 'ein minutt',\n mm : '%d minuttir',\n h : 'ein tími',\n hh : '%d tímar',\n d : 'ein dagur',\n dd : '%d dagar',\n M : 'ein mánaði',\n MM : '%d mánaðir',\n y : 'eitt ár',\n yy : '%d ár'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fo;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fo.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fr-ca.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fr-ca.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : canadian french (fr-ca)\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var fr_ca = moment.defineLocale('fr-ca', {\n months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n monthsParseExact : true,\n weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Aujourd\\'hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'dans %s',\n past : 'il y a %s',\n s : 'quelques secondes',\n m : 'une minute',\n mm : '%d minutes',\n h : 'une heure',\n hh : '%d heures',\n d : 'un jour',\n dd : '%d jours',\n M : 'un mois',\n MM : '%d mois',\n y : 'un an',\n yy : '%d ans'\n },\n ordinalParse: /\\d{1,2}(er|e)/,\n ordinal : function (number) {\n return number + (number === 1 ? 'er' : 'e');\n }\n });\n\n return fr_ca;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fr-ca.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fr-ch.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fr-ch.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : swiss french (fr)\n//! author : Gaspard Bucher : https://github.com/gaspard\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var fr_ch = moment.defineLocale('fr-ch', {\n months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n monthsParseExact : true,\n weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Aujourd\\'hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'dans %s',\n past : 'il y a %s',\n s : 'quelques secondes',\n m : 'une minute',\n mm : '%d minutes',\n h : 'une heure',\n hh : '%d heures',\n d : 'un jour',\n dd : '%d jours',\n M : 'un mois',\n MM : '%d mois',\n y : 'un an',\n yy : '%d ans'\n },\n ordinalParse: /\\d{1,2}(er|e)/,\n ordinal : function (number) {\n return number + (number === 1 ? 'er' : 'e');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fr_ch;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fr-ch.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fr.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fr.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : french (fr)\n//! author : John Fischer : https://github.com/jfroffice\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var fr = moment.defineLocale('fr', {\n months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),\n monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),\n monthsParseExact : true,\n weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Aujourd\\'hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'dans %s',\n past : 'il y a %s',\n s : 'quelques secondes',\n m : 'une minute',\n mm : '%d minutes',\n h : 'une heure',\n hh : '%d heures',\n d : 'un jour',\n dd : '%d jours',\n M : 'un mois',\n MM : '%d mois',\n y : 'un an',\n yy : '%d ans'\n },\n ordinalParse: /\\d{1,2}(er|)/,\n ordinal : function (number) {\n return number + (number === 1 ? 'er' : '');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fr;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fr.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/fy.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/fy.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : frisian (fy)\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'),\n monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');\n\n var fy = moment.defineLocale('fy', {\n months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),\n monthsShort : function (m, format) {\n if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[m.month()];\n } else {\n return monthsShortWithDots[m.month()];\n }\n },\n monthsParseExact : true,\n weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),\n weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),\n weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[hjoed om] LT',\n nextDay: '[moarn om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[juster om] LT',\n lastWeek: '[ôfrûne] dddd [om] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'oer %s',\n past : '%s lyn',\n s : 'in pear sekonden',\n m : 'ien minút',\n mm : '%d minuten',\n h : 'ien oere',\n hh : '%d oeren',\n d : 'ien dei',\n dd : '%d dagen',\n M : 'ien moanne',\n MM : '%d moannen',\n y : 'ien jier',\n yy : '%d jierren'\n },\n ordinalParse: /\\d{1,2}(ste|de)/,\n ordinal : function (number) {\n return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return fy;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/fy.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/gd.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/gd.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : great britain scottish gealic (gd)\n//! author : Jon Ashdown : https://github.com/jonashdown\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var months = [\n 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'\n ];\n\n var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];\n\n var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];\n\n var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];\n\n var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];\n\n var gd = moment.defineLocale('gd', {\n months : months,\n monthsShort : monthsShort,\n monthsParseExact : true,\n weekdays : weekdays,\n weekdaysShort : weekdaysShort,\n weekdaysMin : weekdaysMin,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[An-diugh aig] LT',\n nextDay : '[A-màireach aig] LT',\n nextWeek : 'dddd [aig] LT',\n lastDay : '[An-dè aig] LT',\n lastWeek : 'dddd [seo chaidh] [aig] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'ann an %s',\n past : 'bho chionn %s',\n s : 'beagan diogan',\n m : 'mionaid',\n mm : '%d mionaidean',\n h : 'uair',\n hh : '%d uairean',\n d : 'latha',\n dd : '%d latha',\n M : 'mìos',\n MM : '%d mìosan',\n y : 'bliadhna',\n yy : '%d bliadhna'\n },\n ordinalParse : /\\d{1,2}(d|na|mh)/,\n ordinal : function (number) {\n var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return gd;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/gd.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/gl.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/gl.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : galician (gl)\n//! author : Juan G. Hurtado : https://github.com/juanghurtado\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var gl = moment.defineLocale('gl', {\n months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'),\n monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'),\n monthsParseExact: true,\n weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'),\n weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'),\n weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY H:mm',\n LLLL : 'dddd D MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : function () {\n return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n },\n nextDay : function () {\n return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';\n },\n nextWeek : function () {\n return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n },\n lastDay : function () {\n return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';\n },\n lastWeek : function () {\n return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : function (str) {\n if (str === 'uns segundos') {\n return 'nuns segundos';\n }\n return 'en ' + str;\n },\n past : 'hai %s',\n s : 'uns segundos',\n m : 'un minuto',\n mm : '%d minutos',\n h : 'unha hora',\n hh : '%d horas',\n d : 'un día',\n dd : '%d días',\n M : 'un mes',\n MM : '%d meses',\n y : 'un ano',\n yy : '%d anos'\n },\n ordinalParse : /\\d{1,2}º/,\n ordinal : '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return gl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/gl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/he.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/he.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Hebrew (he)\n//! author : Tomer Cohen : https://github.com/tomer\n//! author : Moshe Simantov : https://github.com/DevelopmentIL\n//! author : Tal Ater : https://github.com/TalAter\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var he = moment.defineLocale('he', {\n months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),\n monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),\n weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),\n weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),\n weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D [ב]MMMM YYYY',\n LLL : 'D [ב]MMMM YYYY HH:mm',\n LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',\n l : 'D/M/YYYY',\n ll : 'D MMM YYYY',\n lll : 'D MMM YYYY HH:mm',\n llll : 'ddd, D MMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[היום ב־]LT',\n nextDay : '[מחר ב־]LT',\n nextWeek : 'dddd [בשעה] LT',\n lastDay : '[אתמול ב־]LT',\n lastWeek : '[ביום] dddd [האחרון בשעה] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'בעוד %s',\n past : 'לפני %s',\n s : 'מספר שניות',\n m : 'דקה',\n mm : '%d דקות',\n h : 'שעה',\n hh : function (number) {\n if (number === 2) {\n return 'שעתיים';\n }\n return number + ' שעות';\n },\n d : 'יום',\n dd : function (number) {\n if (number === 2) {\n return 'יומיים';\n }\n return number + ' ימים';\n },\n M : 'חודש',\n MM : function (number) {\n if (number === 2) {\n return 'חודשיים';\n }\n return number + ' חודשים';\n },\n y : 'שנה',\n yy : function (number) {\n if (number === 2) {\n return 'שנתיים';\n } else if (number % 10 === 0 && number !== 10) {\n return number + ' שנה';\n }\n return number + ' שנים';\n }\n },\n meridiemParse: /אחה\"צ|לפנה\"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,\n isPM : function (input) {\n return /^(אחה\"צ|אחרי הצהריים|בערב)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 5) {\n return 'לפנות בוקר';\n } else if (hour < 10) {\n return 'בבוקר';\n } else if (hour < 12) {\n return isLower ? 'לפנה\"צ' : 'לפני הצהריים';\n } else if (hour < 18) {\n return isLower ? 'אחה\"צ' : 'אחרי הצהריים';\n } else {\n return 'בערב';\n }\n }\n });\n\n return he;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/he.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/hi.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/hi.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : hindi (hi)\n//! author : Mayank Singhal : https://github.com/mayanksinghal\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '१',\n '2': '२',\n '3': '३',\n '4': '४',\n '5': '५',\n '6': '६',\n '7': '७',\n '8': '८',\n '9': '९',\n '0': '०'\n },\n numberMap = {\n '१': '1',\n '२': '2',\n '३': '3',\n '४': '4',\n '५': '5',\n '६': '6',\n '७': '7',\n '८': '8',\n '९': '9',\n '०': '0'\n };\n\n var hi = moment.defineLocale('hi', {\n months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),\n monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),\n monthsParseExact: true,\n weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),\n weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n longDateFormat : {\n LT : 'A h:mm बजे',\n LTS : 'A h:mm:ss बजे',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm बजे',\n LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'\n },\n calendar : {\n sameDay : '[आज] LT',\n nextDay : '[कल] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[कल] LT',\n lastWeek : '[पिछले] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s में',\n past : '%s पहले',\n s : 'कुछ ही क्षण',\n m : 'एक मिनट',\n mm : '%d मिनट',\n h : 'एक घंटा',\n hh : '%d घंटे',\n d : 'एक दिन',\n dd : '%d दिन',\n M : 'एक महीने',\n MM : '%d महीने',\n y : 'एक वर्ष',\n yy : '%d वर्ष'\n },\n preparse: function (string) {\n return string.replace(/[१२३४५६७८९०]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n // Hindi notation for meridiems are quite fuzzy in practice. While there exists\n // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.\n meridiemParse: /रात|सुबह|दोपहर|शाम/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'रात') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'सुबह') {\n return hour;\n } else if (meridiem === 'दोपहर') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'शाम') {\n return hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'रात';\n } else if (hour < 10) {\n return 'सुबह';\n } else if (hour < 17) {\n return 'दोपहर';\n } else if (hour < 20) {\n return 'शाम';\n } else {\n return 'रात';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return hi;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/hi.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/hr.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/hr.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : hrvatski (hr)\n//! author : Bojan Marković : https://github.com/bmarkovic\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;\n }\n }\n\n var hr = moment.defineLocale('hr', {\n months : {\n format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),\n standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')\n },\n monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),\n monthsParseExact: true,\n weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD. MM. YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd, D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[danas u] LT',\n nextDay : '[sutra u] LT',\n nextWeek : function () {\n switch (this.day()) {\n case 0:\n return '[u] [nedjelju] [u] LT';\n case 3:\n return '[u] [srijedu] [u] LT';\n case 6:\n return '[u] [subotu] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[u] dddd [u] LT';\n }\n },\n lastDay : '[jučer u] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 0:\n case 3:\n return '[prošlu] dddd [u] LT';\n case 6:\n return '[prošle] [subote] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[prošli] dddd [u] LT';\n }\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'prije %s',\n s : 'par sekundi',\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : 'dan',\n dd : translate,\n M : 'mjesec',\n MM : translate,\n y : 'godinu',\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return hr;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/hr.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/hu.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/hu.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : hungarian (hu)\n//! author : Adam Brunner : https://github.com/adambrunner\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');\n function translate(number, withoutSuffix, key, isFuture) {\n var num = number,\n suffix;\n switch (key) {\n case 's':\n return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';\n case 'm':\n return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');\n case 'mm':\n return num + (isFuture || withoutSuffix ? ' perc' : ' perce');\n case 'h':\n return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');\n case 'hh':\n return num + (isFuture || withoutSuffix ? ' óra' : ' órája');\n case 'd':\n return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');\n case 'dd':\n return num + (isFuture || withoutSuffix ? ' nap' : ' napja');\n case 'M':\n return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n case 'MM':\n return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');\n case 'y':\n return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');\n case 'yy':\n return num + (isFuture || withoutSuffix ? ' év' : ' éve');\n }\n return '';\n }\n function week(isFuture) {\n return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';\n }\n\n var hu = moment.defineLocale('hu', {\n months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),\n monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),\n weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),\n weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),\n weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'YYYY.MM.DD.',\n LL : 'YYYY. MMMM D.',\n LLL : 'YYYY. MMMM D. H:mm',\n LLLL : 'YYYY. MMMM D., dddd H:mm'\n },\n meridiemParse: /de|du/i,\n isPM: function (input) {\n return input.charAt(1).toLowerCase() === 'u';\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 12) {\n return isLower === true ? 'de' : 'DE';\n } else {\n return isLower === true ? 'du' : 'DU';\n }\n },\n calendar : {\n sameDay : '[ma] LT[-kor]',\n nextDay : '[holnap] LT[-kor]',\n nextWeek : function () {\n return week.call(this, true);\n },\n lastDay : '[tegnap] LT[-kor]',\n lastWeek : function () {\n return week.call(this, false);\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s múlva',\n past : '%s',\n s : translate,\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return hu;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/hu.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/hy-am.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/hy-am.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Armenian (hy-am)\n//! author : Armendarabyan : https://github.com/armendarabyan\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var hy_am = moment.defineLocale('hy-am', {\n months : {\n format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),\n standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')\n },\n monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),\n weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),\n weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY թ.',\n LLL : 'D MMMM YYYY թ., HH:mm',\n LLLL : 'dddd, D MMMM YYYY թ., HH:mm'\n },\n calendar : {\n sameDay: '[այսօր] LT',\n nextDay: '[վաղը] LT',\n lastDay: '[երեկ] LT',\n nextWeek: function () {\n return 'dddd [օրը ժամը] LT';\n },\n lastWeek: function () {\n return '[անցած] dddd [օրը ժամը] LT';\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : '%s հետո',\n past : '%s առաջ',\n s : 'մի քանի վայրկյան',\n m : 'րոպե',\n mm : '%d րոպե',\n h : 'ժամ',\n hh : '%d ժամ',\n d : 'օր',\n dd : '%d օր',\n M : 'ամիս',\n MM : '%d ամիս',\n y : 'տարի',\n yy : '%d տարի'\n },\n meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,\n isPM: function (input) {\n return /^(ցերեկվա|երեկոյան)$/.test(input);\n },\n meridiem : function (hour) {\n if (hour < 4) {\n return 'գիշերվա';\n } else if (hour < 12) {\n return 'առավոտվա';\n } else if (hour < 17) {\n return 'ցերեկվա';\n } else {\n return 'երեկոյան';\n }\n },\n ordinalParse: /\\d{1,2}|\\d{1,2}-(ին|րդ)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'DDD':\n case 'w':\n case 'W':\n case 'DDDo':\n if (number === 1) {\n return number + '-ին';\n }\n return number + '-րդ';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return hy_am;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/hy-am.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/id.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/id.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Bahasa Indonesia (id)\n//! author : Mohammad Satrio Utomo : https://github.com/tyok\n//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var id = moment.defineLocale('id', {\n months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),\n weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),\n weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),\n weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [pukul] HH.mm',\n LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'\n },\n meridiemParse: /pagi|siang|sore|malam/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'pagi') {\n return hour;\n } else if (meridiem === 'siang') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'sore' || meridiem === 'malam') {\n return hour + 12;\n }\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 11) {\n return 'pagi';\n } else if (hours < 15) {\n return 'siang';\n } else if (hours < 19) {\n return 'sore';\n } else {\n return 'malam';\n }\n },\n calendar : {\n sameDay : '[Hari ini pukul] LT',\n nextDay : '[Besok pukul] LT',\n nextWeek : 'dddd [pukul] LT',\n lastDay : '[Kemarin pukul] LT',\n lastWeek : 'dddd [lalu pukul] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'dalam %s',\n past : '%s yang lalu',\n s : 'beberapa detik',\n m : 'semenit',\n mm : '%d menit',\n h : 'sejam',\n hh : '%d jam',\n d : 'sehari',\n dd : '%d hari',\n M : 'sebulan',\n MM : '%d bulan',\n y : 'setahun',\n yy : '%d tahun'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return id;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/id.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/is.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/is.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : icelandic (is)\n//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function plural(n) {\n if (n % 100 === 11) {\n return true;\n } else if (n % 10 === 1) {\n return false;\n }\n return true;\n }\n function translate(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';\n case 'm':\n return withoutSuffix ? 'mínúta' : 'mínútu';\n case 'mm':\n if (plural(number)) {\n return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');\n } else if (withoutSuffix) {\n return result + 'mínúta';\n }\n return result + 'mínútu';\n case 'hh':\n if (plural(number)) {\n return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');\n }\n return result + 'klukkustund';\n case 'd':\n if (withoutSuffix) {\n return 'dagur';\n }\n return isFuture ? 'dag' : 'degi';\n case 'dd':\n if (plural(number)) {\n if (withoutSuffix) {\n return result + 'dagar';\n }\n return result + (isFuture ? 'daga' : 'dögum');\n } else if (withoutSuffix) {\n return result + 'dagur';\n }\n return result + (isFuture ? 'dag' : 'degi');\n case 'M':\n if (withoutSuffix) {\n return 'mánuður';\n }\n return isFuture ? 'mánuð' : 'mánuði';\n case 'MM':\n if (plural(number)) {\n if (withoutSuffix) {\n return result + 'mánuðir';\n }\n return result + (isFuture ? 'mánuði' : 'mánuðum');\n } else if (withoutSuffix) {\n return result + 'mánuður';\n }\n return result + (isFuture ? 'mánuð' : 'mánuði');\n case 'y':\n return withoutSuffix || isFuture ? 'ár' : 'ári';\n case 'yy':\n if (plural(number)) {\n return result + (withoutSuffix || isFuture ? 'ár' : 'árum');\n }\n return result + (withoutSuffix || isFuture ? 'ár' : 'ári');\n }\n }\n\n var is = moment.defineLocale('is', {\n months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),\n monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),\n weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),\n weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),\n weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY [kl.] H:mm',\n LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'\n },\n calendar : {\n sameDay : '[í dag kl.] LT',\n nextDay : '[á morgun kl.] LT',\n nextWeek : 'dddd [kl.] LT',\n lastDay : '[í gær kl.] LT',\n lastWeek : '[síðasta] dddd [kl.] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'eftir %s',\n past : 'fyrir %s síðan',\n s : translate,\n m : translate,\n mm : translate,\n h : 'klukkustund',\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return is;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/is.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/it.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/it.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : italian (it)\n//! author : Lorenzo : https://github.com/aliem\n//! author: Mattia Larentis: https://github.com/nostalgiaz\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var it = moment.defineLocale('it', {\n months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),\n monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),\n weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),\n weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),\n weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Oggi alle] LT',\n nextDay: '[Domani alle] LT',\n nextWeek: 'dddd [alle] LT',\n lastDay: '[Ieri alle] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[la scorsa] dddd [alle] LT';\n default:\n return '[lo scorso] dddd [alle] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : function (s) {\n return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;\n },\n past : '%s fa',\n s : 'alcuni secondi',\n m : 'un minuto',\n mm : '%d minuti',\n h : 'un\\'ora',\n hh : '%d ore',\n d : 'un giorno',\n dd : '%d giorni',\n M : 'un mese',\n MM : '%d mesi',\n y : 'un anno',\n yy : '%d anni'\n },\n ordinalParse : /\\d{1,2}º/,\n ordinal: '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return it;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/it.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ja.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ja.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : japanese (ja)\n//! author : LI Long : https://github.com/baryon\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ja = moment.defineLocale('ja', {\n months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n weekdaysShort : '日_月_火_水_木_金_土'.split('_'),\n weekdaysMin : '日_月_火_水_木_金_土'.split('_'),\n longDateFormat : {\n LT : 'Ah時m分',\n LTS : 'Ah時m分s秒',\n L : 'YYYY/MM/DD',\n LL : 'YYYY年M月D日',\n LLL : 'YYYY年M月D日Ah時m分',\n LLLL : 'YYYY年M月D日Ah時m分 dddd'\n },\n meridiemParse: /午前|午後/i,\n isPM : function (input) {\n return input === '午後';\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return '午前';\n } else {\n return '午後';\n }\n },\n calendar : {\n sameDay : '[今日] LT',\n nextDay : '[明日] LT',\n nextWeek : '[来週]dddd LT',\n lastDay : '[昨日] LT',\n lastWeek : '[前週]dddd LT',\n sameElse : 'L'\n },\n ordinalParse : /\\d{1,2}日/,\n ordinal : function (number, period) {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return number + '日';\n default:\n return number;\n }\n },\n relativeTime : {\n future : '%s後',\n past : '%s前',\n s : '数秒',\n m : '1分',\n mm : '%d分',\n h : '1時間',\n hh : '%d時間',\n d : '1日',\n dd : '%d日',\n M : '1ヶ月',\n MM : '%dヶ月',\n y : '1年',\n yy : '%d年'\n }\n });\n\n return ja;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ja.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/jv.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/jv.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Boso Jowo (jv)\n//! author : Rony Lantip : https://github.com/lantip\n//! reference: http://jv.wikipedia.org/wiki/Basa_Jawa\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var jv = moment.defineLocale('jv', {\n months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),\n monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),\n weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),\n weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),\n weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [pukul] HH.mm',\n LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'\n },\n meridiemParse: /enjing|siyang|sonten|ndalu/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'enjing') {\n return hour;\n } else if (meridiem === 'siyang') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'sonten' || meridiem === 'ndalu') {\n return hour + 12;\n }\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 11) {\n return 'enjing';\n } else if (hours < 15) {\n return 'siyang';\n } else if (hours < 19) {\n return 'sonten';\n } else {\n return 'ndalu';\n }\n },\n calendar : {\n sameDay : '[Dinten puniko pukul] LT',\n nextDay : '[Mbenjang pukul] LT',\n nextWeek : 'dddd [pukul] LT',\n lastDay : '[Kala wingi pukul] LT',\n lastWeek : 'dddd [kepengker pukul] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'wonten ing %s',\n past : '%s ingkang kepengker',\n s : 'sawetawis detik',\n m : 'setunggal menit',\n mm : '%d menit',\n h : 'setunggal jam',\n hh : '%d jam',\n d : 'sedinten',\n dd : '%d dinten',\n M : 'sewulan',\n MM : '%d wulan',\n y : 'setaun',\n yy : '%d taun'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return jv;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/jv.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ka.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ka.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Georgian (ka)\n//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ka = moment.defineLocale('ka', {\n months : {\n standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),\n format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')\n },\n monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),\n weekdays : {\n standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),\n format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),\n isFormat: /(წინა|შემდეგ)/\n },\n weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),\n weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendar : {\n sameDay : '[დღეს] LT[-ზე]',\n nextDay : '[ხვალ] LT[-ზე]',\n lastDay : '[გუშინ] LT[-ზე]',\n nextWeek : '[შემდეგ] dddd LT[-ზე]',\n lastWeek : '[წინა] dddd LT-ზე',\n sameElse : 'L'\n },\n relativeTime : {\n future : function (s) {\n return (/(წამი|წუთი|საათი|წელი)/).test(s) ?\n s.replace(/ი$/, 'ში') :\n s + 'ში';\n },\n past : function (s) {\n if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {\n return s.replace(/(ი|ე)$/, 'ის წინ');\n }\n if ((/წელი/).test(s)) {\n return s.replace(/წელი$/, 'წლის წინ');\n }\n },\n s : 'რამდენიმე წამი',\n m : 'წუთი',\n mm : '%d წუთი',\n h : 'საათი',\n hh : '%d საათი',\n d : 'დღე',\n dd : '%d დღე',\n M : 'თვე',\n MM : '%d თვე',\n y : 'წელი',\n yy : '%d წელი'\n },\n ordinalParse: /0|1-ლი|მე-\\d{1,2}|\\d{1,2}-ე/,\n ordinal : function (number) {\n if (number === 0) {\n return number;\n }\n if (number === 1) {\n return number + '-ლი';\n }\n if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {\n return 'მე-' + number;\n }\n return number + '-ე';\n },\n week : {\n dow : 1,\n doy : 7\n }\n });\n\n return ka;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ka.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/kk.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/kk.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : kazakh (kk)\n//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var suffixes = {\n 0: '-ші',\n 1: '-ші',\n 2: '-ші',\n 3: '-ші',\n 4: '-ші',\n 5: '-ші',\n 6: '-шы',\n 7: '-ші',\n 8: '-ші',\n 9: '-шы',\n 10: '-шы',\n 20: '-шы',\n 30: '-шы',\n 40: '-шы',\n 50: '-ші',\n 60: '-шы',\n 70: '-ші',\n 80: '-ші',\n 90: '-шы',\n 100: '-ші'\n };\n\n var kk = moment.defineLocale('kk', {\n months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),\n monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),\n weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),\n weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),\n weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Бүгін сағат] LT',\n nextDay : '[Ертең сағат] LT',\n nextWeek : 'dddd [сағат] LT',\n lastDay : '[Кеше сағат] LT',\n lastWeek : '[Өткен аптаның] dddd [сағат] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s ішінде',\n past : '%s бұрын',\n s : 'бірнеше секунд',\n m : 'бір минут',\n mm : '%d минут',\n h : 'бір сағат',\n hh : '%d сағат',\n d : 'бір күн',\n dd : '%d күн',\n M : 'бір ай',\n MM : '%d ай',\n y : 'бір жыл',\n yy : '%d жыл'\n },\n ordinalParse: /\\d{1,2}-(ші|шы)/,\n ordinal : function (number) {\n var a = number % 10,\n b = number >= 100 ? 100 : null;\n return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return kk;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/kk.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/km.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/km.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : khmer (km)\n//! author : Kruy Vanna : https://github.com/kruyvanna\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var km = moment.defineLocale('km', {\n months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),\n weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS : 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',\n nextDay: '[ស្អែក ម៉ោង] LT',\n nextWeek: 'dddd [ម៉ោង] LT',\n lastDay: '[ម្សិលមិញ ម៉ោង] LT',\n lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',\n sameElse: 'L'\n },\n relativeTime: {\n future: '%sទៀត',\n past: '%sមុន',\n s: 'ប៉ុន្មានវិនាទី',\n m: 'មួយនាទី',\n mm: '%d នាទី',\n h: 'មួយម៉ោង',\n hh: '%d ម៉ោង',\n d: 'មួយថ្ងៃ',\n dd: '%d ថ្ងៃ',\n M: 'មួយខែ',\n MM: '%d ខែ',\n y: 'មួយឆ្នាំ',\n yy: '%d ឆ្នាំ'\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return km;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/km.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ko.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ko.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : korean (ko)\n//!\n//! authors\n//!\n//! - Kyungwook, Park : https://github.com/kyungw00k\n//! - Jeeeyul Lee <jeeeyul@gmail.com>\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ko = moment.defineLocale('ko', {\n months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),\n weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),\n weekdaysShort : '일_월_화_수_목_금_토'.split('_'),\n weekdaysMin : '일_월_화_수_목_금_토'.split('_'),\n longDateFormat : {\n LT : 'A h시 m분',\n LTS : 'A h시 m분 s초',\n L : 'YYYY.MM.DD',\n LL : 'YYYY년 MMMM D일',\n LLL : 'YYYY년 MMMM D일 A h시 m분',\n LLLL : 'YYYY년 MMMM D일 dddd A h시 m분'\n },\n calendar : {\n sameDay : '오늘 LT',\n nextDay : '내일 LT',\n nextWeek : 'dddd LT',\n lastDay : '어제 LT',\n lastWeek : '지난주 dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s 후',\n past : '%s 전',\n s : '몇 초',\n ss : '%d초',\n m : '일분',\n mm : '%d분',\n h : '한 시간',\n hh : '%d시간',\n d : '하루',\n dd : '%d일',\n M : '한 달',\n MM : '%d달',\n y : '일 년',\n yy : '%d년'\n },\n ordinalParse : /\\d{1,2}일/,\n ordinal : '%d일',\n meridiemParse : /오전|오후/,\n isPM : function (token) {\n return token === '오후';\n },\n meridiem : function (hour, minute, isUpper) {\n return hour < 12 ? '오전' : '오후';\n }\n });\n\n return ko;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ko.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ky.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ky.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : kyrgyz (ky)\n//! author : Chyngyz Arystan uulu : https://github.com/chyngyz\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n\n var suffixes = {\n 0: '-чү',\n 1: '-чи',\n 2: '-чи',\n 3: '-чү',\n 4: '-чү',\n 5: '-чи',\n 6: '-чы',\n 7: '-чи',\n 8: '-чи',\n 9: '-чу',\n 10: '-чу',\n 20: '-чы',\n 30: '-чу',\n 40: '-чы',\n 50: '-чү',\n 60: '-чы',\n 70: '-чи',\n 80: '-чи',\n 90: '-чу',\n 100: '-чү'\n };\n\n var ky = moment.defineLocale('ky', {\n months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),\n monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),\n weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),\n weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),\n weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Бүгүн саат] LT',\n nextDay : '[Эртең саат] LT',\n nextWeek : 'dddd [саат] LT',\n lastDay : '[Кече саат] LT',\n lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s ичинде',\n past : '%s мурун',\n s : 'бирнече секунд',\n m : 'бир мүнөт',\n mm : '%d мүнөт',\n h : 'бир саат',\n hh : '%d саат',\n d : 'бир күн',\n dd : '%d күн',\n M : 'бир ай',\n MM : '%d ай',\n y : 'бир жыл',\n yy : '%d жыл'\n },\n ordinalParse: /\\d{1,2}-(чи|чы|чү|чу)/,\n ordinal : function (number) {\n var a = number % 10,\n b = number >= 100 ? 100 : null;\n return number + (suffixes[number] || suffixes[a] || suffixes[b]);\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ky;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ky.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/lb.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/lb.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Luxembourgish (lb)\n//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 'm': ['eng Minutt', 'enger Minutt'],\n 'h': ['eng Stonn', 'enger Stonn'],\n 'd': ['een Dag', 'engem Dag'],\n 'M': ['ee Mount', 'engem Mount'],\n 'y': ['ee Joer', 'engem Joer']\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n function processFutureTime(string) {\n var number = string.substr(0, string.indexOf(' '));\n if (eifelerRegelAppliesToNumber(number)) {\n return 'a ' + string;\n }\n return 'an ' + string;\n }\n function processPastTime(string) {\n var number = string.substr(0, string.indexOf(' '));\n if (eifelerRegelAppliesToNumber(number)) {\n return 'viru ' + string;\n }\n return 'virun ' + string;\n }\n /**\n * Returns true if the word before the given number loses the '-n' ending.\n * e.g. 'an 10 Deeg' but 'a 5 Deeg'\n *\n * @param number {integer}\n * @returns {boolean}\n */\n function eifelerRegelAppliesToNumber(number) {\n number = parseInt(number, 10);\n if (isNaN(number)) {\n return false;\n }\n if (number < 0) {\n // Negative Number --> always true\n return true;\n } else if (number < 10) {\n // Only 1 digit\n if (4 <= number && number <= 7) {\n return true;\n }\n return false;\n } else if (number < 100) {\n // 2 digits\n var lastDigit = number % 10, firstDigit = number / 10;\n if (lastDigit === 0) {\n return eifelerRegelAppliesToNumber(firstDigit);\n }\n return eifelerRegelAppliesToNumber(lastDigit);\n } else if (number < 10000) {\n // 3 or 4 digits --> recursively check first digit\n while (number >= 10) {\n number = number / 10;\n }\n return eifelerRegelAppliesToNumber(number);\n } else {\n // Anything larger than 4 digits: recursively check first n-3 digits\n number = number / 1000;\n return eifelerRegelAppliesToNumber(number);\n }\n }\n\n var lb = moment.defineLocale('lb', {\n months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),\n monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),\n monthsParseExact : true,\n weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),\n weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),\n weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),\n weekdaysParseExact : true,\n longDateFormat: {\n LT: 'H:mm [Auer]',\n LTS: 'H:mm:ss [Auer]',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm [Auer]',\n LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'\n },\n calendar: {\n sameDay: '[Haut um] LT',\n sameElse: 'L',\n nextDay: '[Muer um] LT',\n nextWeek: 'dddd [um] LT',\n lastDay: '[Gëschter um] LT',\n lastWeek: function () {\n // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule\n switch (this.day()) {\n case 2:\n case 4:\n return '[Leschten] dddd [um] LT';\n default:\n return '[Leschte] dddd [um] LT';\n }\n }\n },\n relativeTime : {\n future : processFutureTime,\n past : processPastTime,\n s : 'e puer Sekonnen',\n m : processRelativeTime,\n mm : '%d Minutten',\n h : processRelativeTime,\n hh : '%d Stonnen',\n d : processRelativeTime,\n dd : '%d Deeg',\n M : processRelativeTime,\n MM : '%d Méint',\n y : processRelativeTime,\n yy : '%d Joer'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return lb;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/lb.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/lo.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/lo.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : lao (lo)\n//! author : Ryan Hart : https://github.com/ryanhart2\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var lo = moment.defineLocale('lo', {\n months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),\n monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),\n weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),\n weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'ວັນdddd D MMMM YYYY HH:mm'\n },\n meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,\n isPM: function (input) {\n return input === 'ຕອນແລງ';\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ຕອນເຊົ້າ';\n } else {\n return 'ຕອນແລງ';\n }\n },\n calendar : {\n sameDay : '[ມື້ນີ້ເວລາ] LT',\n nextDay : '[ມື້ອື່ນເວລາ] LT',\n nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',\n lastDay : '[ມື້ວານນີ້ເວລາ] LT',\n lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'ອີກ %s',\n past : '%sຜ່ານມາ',\n s : 'ບໍ່ເທົ່າໃດວິນາທີ',\n m : '1 ນາທີ',\n mm : '%d ນາທີ',\n h : '1 ຊົ່ວໂມງ',\n hh : '%d ຊົ່ວໂມງ',\n d : '1 ມື້',\n dd : '%d ມື້',\n M : '1 ເດືອນ',\n MM : '%d ເດືອນ',\n y : '1 ປີ',\n yy : '%d ປີ'\n },\n ordinalParse: /(ທີ່)\\d{1,2}/,\n ordinal : function (number) {\n return 'ທີ່' + number;\n }\n });\n\n return lo;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/lo.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/lt.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/lt.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Lithuanian (lt)\n//! author : Mindaugas Mozūras : https://github.com/mmozuras\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var units = {\n 'm' : 'minutė_minutės_minutę',\n 'mm': 'minutės_minučių_minutes',\n 'h' : 'valanda_valandos_valandą',\n 'hh': 'valandos_valandų_valandas',\n 'd' : 'diena_dienos_dieną',\n 'dd': 'dienos_dienų_dienas',\n 'M' : 'mėnuo_mėnesio_mėnesį',\n 'MM': 'mėnesiai_mėnesių_mėnesius',\n 'y' : 'metai_metų_metus',\n 'yy': 'metai_metų_metus'\n };\n function translateSeconds(number, withoutSuffix, key, isFuture) {\n if (withoutSuffix) {\n return 'kelios sekundės';\n } else {\n return isFuture ? 'kelių sekundžių' : 'kelias sekundes';\n }\n }\n function translateSingular(number, withoutSuffix, key, isFuture) {\n return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);\n }\n function special(number) {\n return number % 10 === 0 || (number > 10 && number < 20);\n }\n function forms(key) {\n return units[key].split('_');\n }\n function translate(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n if (number === 1) {\n return result + translateSingular(number, withoutSuffix, key[0], isFuture);\n } else if (withoutSuffix) {\n return result + (special(number) ? forms(key)[1] : forms(key)[0]);\n } else {\n if (isFuture) {\n return result + forms(key)[1];\n } else {\n return result + (special(number) ? forms(key)[1] : forms(key)[2]);\n }\n }\n }\n var lt = moment.defineLocale('lt', {\n months : {\n format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),\n standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_')\n },\n monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),\n weekdays : {\n format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),\n standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),\n isFormat: /dddd HH:mm/\n },\n weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),\n weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'YYYY [m.] MMMM D [d.]',\n LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',\n l : 'YYYY-MM-DD',\n ll : 'YYYY [m.] MMMM D [d.]',\n lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',\n llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'\n },\n calendar : {\n sameDay : '[Šiandien] LT',\n nextDay : '[Rytoj] LT',\n nextWeek : 'dddd LT',\n lastDay : '[Vakar] LT',\n lastWeek : '[Praėjusį] dddd LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'po %s',\n past : 'prieš %s',\n s : translateSeconds,\n m : translateSingular,\n mm : translate,\n h : translateSingular,\n hh : translate,\n d : translateSingular,\n dd : translate,\n M : translateSingular,\n MM : translate,\n y : translateSingular,\n yy : translate\n },\n ordinalParse: /\\d{1,2}-oji/,\n ordinal : function (number) {\n return number + '-oji';\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return lt;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/lt.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/lv.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/lv.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : latvian (lv)\n//! author : Kristaps Karlsons : https://github.com/skakri\n//! author : Jānis Elmeris : https://github.com/JanisE\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var units = {\n 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),\n 'h': 'stundas_stundām_stunda_stundas'.split('_'),\n 'hh': 'stundas_stundām_stunda_stundas'.split('_'),\n 'd': 'dienas_dienām_diena_dienas'.split('_'),\n 'dd': 'dienas_dienām_diena_dienas'.split('_'),\n 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),\n 'y': 'gada_gadiem_gads_gadi'.split('_'),\n 'yy': 'gada_gadiem_gads_gadi'.split('_')\n };\n /**\n * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.\n */\n function format(forms, number, withoutSuffix) {\n if (withoutSuffix) {\n // E.g. \"21 minūte\", \"3 minūtes\".\n return number % 10 === 1 && number !== 11 ? forms[2] : forms[3];\n } else {\n // E.g. \"21 minūtes\" as in \"pēc 21 minūtes\".\n // E.g. \"3 minūtēm\" as in \"pēc 3 minūtēm\".\n return number % 10 === 1 && number !== 11 ? forms[0] : forms[1];\n }\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n return number + ' ' + format(units[key], number, withoutSuffix);\n }\n function relativeTimeWithSingular(number, withoutSuffix, key) {\n return format(units[key], number, withoutSuffix);\n }\n function relativeSeconds(number, withoutSuffix) {\n return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';\n }\n\n var lv = moment.defineLocale('lv', {\n months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),\n monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),\n weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),\n weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),\n weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY.',\n LL : 'YYYY. [gada] D. MMMM',\n LLL : 'YYYY. [gada] D. MMMM, HH:mm',\n LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'\n },\n calendar : {\n sameDay : '[Šodien pulksten] LT',\n nextDay : '[Rīt pulksten] LT',\n nextWeek : 'dddd [pulksten] LT',\n lastDay : '[Vakar pulksten] LT',\n lastWeek : '[Pagājušā] dddd [pulksten] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'pēc %s',\n past : 'pirms %s',\n s : relativeSeconds,\n m : relativeTimeWithSingular,\n mm : relativeTimeWithPlural,\n h : relativeTimeWithSingular,\n hh : relativeTimeWithPlural,\n d : relativeTimeWithSingular,\n dd : relativeTimeWithPlural,\n M : relativeTimeWithSingular,\n MM : relativeTimeWithPlural,\n y : relativeTimeWithSingular,\n yy : relativeTimeWithPlural\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return lv;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/lv.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/me.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/me.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Montenegrin (me)\n//! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var translator = {\n words: { //Different grammatical cases\n m: ['jedan minut', 'jednog minuta'],\n mm: ['minut', 'minuta', 'minuta'],\n h: ['jedan sat', 'jednog sata'],\n hh: ['sat', 'sata', 'sati'],\n dd: ['dan', 'dana', 'dana'],\n MM: ['mjesec', 'mjeseca', 'mjeseci'],\n yy: ['godina', 'godine', 'godina']\n },\n correctGrammaticalCase: function (number, wordKey) {\n return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n },\n translate: function (number, withoutSuffix, key) {\n var wordKey = translator.words[key];\n if (key.length === 1) {\n return withoutSuffix ? wordKey[0] : wordKey[1];\n } else {\n return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n }\n }\n };\n\n var me = moment.defineLocale('me', {\n months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),\n monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n monthsParseExact : true,\n weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),\n weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),\n weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n weekdaysParseExact : true,\n longDateFormat: {\n LT: 'H:mm',\n LTS : 'H:mm:ss',\n L: 'DD. MM. YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[danas u] LT',\n nextDay: '[sjutra u] LT',\n\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[u] [nedjelju] [u] LT';\n case 3:\n return '[u] [srijedu] [u] LT';\n case 6:\n return '[u] [subotu] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[u] dddd [u] LT';\n }\n },\n lastDay : '[juče u] LT',\n lastWeek : function () {\n var lastWeekDays = [\n '[prošle] [nedjelje] [u] LT',\n '[prošlog] [ponedjeljka] [u] LT',\n '[prošlog] [utorka] [u] LT',\n '[prošle] [srijede] [u] LT',\n '[prošlog] [četvrtka] [u] LT',\n '[prošlog] [petka] [u] LT',\n '[prošle] [subote] [u] LT'\n ];\n return lastWeekDays[this.day()];\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'prije %s',\n s : 'nekoliko sekundi',\n m : translator.translate,\n mm : translator.translate,\n h : translator.translate,\n hh : translator.translate,\n d : 'dan',\n dd : translator.translate,\n M : 'mjesec',\n MM : translator.translate,\n y : 'godinu',\n yy : translator.translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return me;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/me.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/mk.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/mk.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : macedonian (mk)\n//! author : Borislav Mickov : https://github.com/B0k0\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var mk = moment.defineLocale('mk', {\n months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),\n monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),\n weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),\n weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),\n weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'D.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY H:mm',\n LLLL : 'dddd, D MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[Денес во] LT',\n nextDay : '[Утре во] LT',\n nextWeek : '[Во] dddd [во] LT',\n lastDay : '[Вчера во] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 6:\n return '[Изминатата] dddd [во] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[Изминатиот] dddd [во] LT';\n }\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'после %s',\n past : 'пред %s',\n s : 'неколку секунди',\n m : 'минута',\n mm : '%d минути',\n h : 'час',\n hh : '%d часа',\n d : 'ден',\n dd : '%d дена',\n M : 'месец',\n MM : '%d месеци',\n y : 'година',\n yy : '%d години'\n },\n ordinalParse: /\\d{1,2}-(ев|ен|ти|ви|ри|ми)/,\n ordinal : function (number) {\n var lastDigit = number % 10,\n last2Digits = number % 100;\n if (number === 0) {\n return number + '-ев';\n } else if (last2Digits === 0) {\n return number + '-ен';\n } else if (last2Digits > 10 && last2Digits < 20) {\n return number + '-ти';\n } else if (lastDigit === 1) {\n return number + '-ви';\n } else if (lastDigit === 2) {\n return number + '-ри';\n } else if (lastDigit === 7 || lastDigit === 8) {\n return number + '-ми';\n } else {\n return number + '-ти';\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return mk;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/mk.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ml.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ml.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : malayalam (ml)\n//! author : Floyd Pink : https://github.com/floydpink\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ml = moment.defineLocale('ml', {\n months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),\n monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),\n monthsParseExact : true,\n weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),\n weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),\n weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),\n longDateFormat : {\n LT : 'A h:mm -നു',\n LTS : 'A h:mm:ss -നു',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm -നു',\n LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'\n },\n calendar : {\n sameDay : '[ഇന്ന്] LT',\n nextDay : '[നാളെ] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[ഇന്നലെ] LT',\n lastWeek : '[കഴിഞ്ഞ] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s കഴിഞ്ഞ്',\n past : '%s മുൻപ്',\n s : 'അൽപ നിമിഷങ്ങൾ',\n m : 'ഒരു മിനിറ്റ്',\n mm : '%d മിനിറ്റ്',\n h : 'ഒരു മണിക്കൂർ',\n hh : '%d മണിക്കൂർ',\n d : 'ഒരു ദിവസം',\n dd : '%d ദിവസം',\n M : 'ഒരു മാസം',\n MM : '%d മാസം',\n y : 'ഒരു വർഷം',\n yy : '%d വർഷം'\n },\n meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if ((meridiem === 'രാത്രി' && hour >= 4) ||\n meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||\n meridiem === 'വൈകുന്നേരം') {\n return hour + 12;\n } else {\n return hour;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'രാത്രി';\n } else if (hour < 12) {\n return 'രാവിലെ';\n } else if (hour < 17) {\n return 'ഉച്ച കഴിഞ്ഞ്';\n } else if (hour < 20) {\n return 'വൈകുന്നേരം';\n } else {\n return 'രാത്രി';\n }\n }\n });\n\n return ml;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ml.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/mr.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/mr.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Marathi (mr)\n//! author : Harshad Kale : https://github.com/kalehv\n//! author : Vivek Athalye : https://github.com/vnathalye\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '१',\n '2': '२',\n '3': '३',\n '4': '४',\n '5': '५',\n '6': '६',\n '7': '७',\n '8': '८',\n '9': '९',\n '0': '०'\n },\n numberMap = {\n '१': '1',\n '२': '2',\n '३': '3',\n '४': '4',\n '५': '5',\n '६': '6',\n '७': '7',\n '८': '8',\n '९': '9',\n '०': '0'\n };\n\n function relativeTimeMr(number, withoutSuffix, string, isFuture)\n {\n var output = '';\n if (withoutSuffix) {\n switch (string) {\n case 's': output = 'काही सेकंद'; break;\n case 'm': output = 'एक मिनिट'; break;\n case 'mm': output = '%d मिनिटे'; break;\n case 'h': output = 'एक तास'; break;\n case 'hh': output = '%d तास'; break;\n case 'd': output = 'एक दिवस'; break;\n case 'dd': output = '%d दिवस'; break;\n case 'M': output = 'एक महिना'; break;\n case 'MM': output = '%d महिने'; break;\n case 'y': output = 'एक वर्ष'; break;\n case 'yy': output = '%d वर्षे'; break;\n }\n }\n else {\n switch (string) {\n case 's': output = 'काही सेकंदां'; break;\n case 'm': output = 'एका मिनिटा'; break;\n case 'mm': output = '%d मिनिटां'; break;\n case 'h': output = 'एका तासा'; break;\n case 'hh': output = '%d तासां'; break;\n case 'd': output = 'एका दिवसा'; break;\n case 'dd': output = '%d दिवसां'; break;\n case 'M': output = 'एका महिन्या'; break;\n case 'MM': output = '%d महिन्यां'; break;\n case 'y': output = 'एका वर्षा'; break;\n case 'yy': output = '%d वर्षां'; break;\n }\n }\n return output.replace(/%d/i, number);\n }\n\n var mr = moment.defineLocale('mr', {\n months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),\n monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),\n monthsParseExact : true,\n weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),\n weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),\n weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),\n longDateFormat : {\n LT : 'A h:mm वाजता',\n LTS : 'A h:mm:ss वाजता',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm वाजता',\n LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'\n },\n calendar : {\n sameDay : '[आज] LT',\n nextDay : '[उद्या] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[काल] LT',\n lastWeek: '[मागील] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future: '%sमध्ये',\n past: '%sपूर्वी',\n s: relativeTimeMr,\n m: relativeTimeMr,\n mm: relativeTimeMr,\n h: relativeTimeMr,\n hh: relativeTimeMr,\n d: relativeTimeMr,\n dd: relativeTimeMr,\n M: relativeTimeMr,\n MM: relativeTimeMr,\n y: relativeTimeMr,\n yy: relativeTimeMr\n },\n preparse: function (string) {\n return string.replace(/[१२३४५६७८९०]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'रात्री') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'सकाळी') {\n return hour;\n } else if (meridiem === 'दुपारी') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'सायंकाळी') {\n return hour + 12;\n }\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 4) {\n return 'रात्री';\n } else if (hour < 10) {\n return 'सकाळी';\n } else if (hour < 17) {\n return 'दुपारी';\n } else if (hour < 20) {\n return 'सायंकाळी';\n } else {\n return 'रात्री';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return mr;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/mr.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ms-my.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ms-my.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Bahasa Malaysia (ms-MY)\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ms_my = moment.defineLocale('ms-my', {\n months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [pukul] HH.mm',\n LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'\n },\n meridiemParse: /pagi|tengahari|petang|malam/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'pagi') {\n return hour;\n } else if (meridiem === 'tengahari') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'petang' || meridiem === 'malam') {\n return hour + 12;\n }\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 11) {\n return 'pagi';\n } else if (hours < 15) {\n return 'tengahari';\n } else if (hours < 19) {\n return 'petang';\n } else {\n return 'malam';\n }\n },\n calendar : {\n sameDay : '[Hari ini pukul] LT',\n nextDay : '[Esok pukul] LT',\n nextWeek : 'dddd [pukul] LT',\n lastDay : '[Kelmarin pukul] LT',\n lastWeek : 'dddd [lepas pukul] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'dalam %s',\n past : '%s yang lepas',\n s : 'beberapa saat',\n m : 'seminit',\n mm : '%d minit',\n h : 'sejam',\n hh : '%d jam',\n d : 'sehari',\n dd : '%d hari',\n M : 'sebulan',\n MM : '%d bulan',\n y : 'setahun',\n yy : '%d tahun'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ms_my;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ms-my.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ms.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ms.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Bahasa Malaysia (ms-MY)\n//! author : Weldan Jamili : https://github.com/weldan\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var ms = moment.defineLocale('ms', {\n months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),\n monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),\n weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),\n weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),\n weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [pukul] HH.mm',\n LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'\n },\n meridiemParse: /pagi|tengahari|petang|malam/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'pagi') {\n return hour;\n } else if (meridiem === 'tengahari') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'petang' || meridiem === 'malam') {\n return hour + 12;\n }\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 11) {\n return 'pagi';\n } else if (hours < 15) {\n return 'tengahari';\n } else if (hours < 19) {\n return 'petang';\n } else {\n return 'malam';\n }\n },\n calendar : {\n sameDay : '[Hari ini pukul] LT',\n nextDay : '[Esok pukul] LT',\n nextWeek : 'dddd [pukul] LT',\n lastDay : '[Kelmarin pukul] LT',\n lastWeek : 'dddd [lepas pukul] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'dalam %s',\n past : '%s yang lepas',\n s : 'beberapa saat',\n m : 'seminit',\n mm : '%d minit',\n h : 'sejam',\n hh : '%d jam',\n d : 'sehari',\n dd : '%d hari',\n M : 'sebulan',\n MM : '%d bulan',\n y : 'setahun',\n yy : '%d tahun'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ms;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ms.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/my.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/my.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Burmese (my)\n//! author : Squar team, mysquar.com\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '၁',\n '2': '၂',\n '3': '၃',\n '4': '၄',\n '5': '၅',\n '6': '၆',\n '7': '၇',\n '8': '၈',\n '9': '၉',\n '0': '၀'\n }, numberMap = {\n '၁': '1',\n '၂': '2',\n '၃': '3',\n '၄': '4',\n '၅': '5',\n '၆': '6',\n '၇': '7',\n '၈': '8',\n '၉': '9',\n '၀': '0'\n };\n\n var my = moment.defineLocale('my', {\n months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),\n monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),\n weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),\n weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),\n\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm'\n },\n calendar: {\n sameDay: '[ယနေ.] LT [မှာ]',\n nextDay: '[မနက်ဖြန်] LT [မှာ]',\n nextWeek: 'dddd LT [မှာ]',\n lastDay: '[မနေ.က] LT [မှာ]',\n lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',\n sameElse: 'L'\n },\n relativeTime: {\n future: 'လာမည့် %s မှာ',\n past: 'လွန်ခဲ့သော %s က',\n s: 'စက္ကန်.အနည်းငယ်',\n m: 'တစ်မိနစ်',\n mm: '%d မိနစ်',\n h: 'တစ်နာရီ',\n hh: '%d နာရီ',\n d: 'တစ်ရက်',\n dd: '%d ရက်',\n M: 'တစ်လ',\n MM: '%d လ',\n y: 'တစ်နှစ်',\n yy: '%d နှစ်'\n },\n preparse: function (string) {\n return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return my;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/my.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/nb.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/nb.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : norwegian bokmål (nb)\n//! authors : Espen Hovlandsdal : https://github.com/rexxars\n//! Sigurd Gartmann : https://github.com/sigurdga\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var nb = moment.defineLocale('nb', {\n months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),\n monthsParseExact : true,\n weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),\n weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),\n weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY [kl.] HH:mm',\n LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'\n },\n calendar : {\n sameDay: '[i dag kl.] LT',\n nextDay: '[i morgen kl.] LT',\n nextWeek: 'dddd [kl.] LT',\n lastDay: '[i går kl.] LT',\n lastWeek: '[forrige] dddd [kl.] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'om %s',\n past : '%s siden',\n s : 'noen sekunder',\n m : 'ett minutt',\n mm : '%d minutter',\n h : 'en time',\n hh : '%d timer',\n d : 'en dag',\n dd : '%d dager',\n M : 'en måned',\n MM : '%d måneder',\n y : 'ett år',\n yy : '%d år'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return nb;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/nb.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ne.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ne.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : nepali/nepalese\n//! author : suvash : https://github.com/suvash\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '१',\n '2': '२',\n '3': '३',\n '4': '४',\n '5': '५',\n '6': '६',\n '7': '७',\n '8': '८',\n '9': '९',\n '0': '०'\n },\n numberMap = {\n '१': '1',\n '२': '2',\n '३': '3',\n '४': '4',\n '५': '5',\n '६': '6',\n '७': '7',\n '८': '8',\n '९': '9',\n '०': '0'\n };\n\n var ne = moment.defineLocale('ne', {\n months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),\n monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),\n monthsParseExact : true,\n weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),\n weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),\n weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'Aको h:mm बजे',\n LTS : 'Aको h:mm:ss बजे',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, Aको h:mm बजे',\n LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'\n },\n preparse: function (string) {\n return string.replace(/[१२३४५६७८९०]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n meridiemParse: /राति|बिहान|दिउँसो|साँझ/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'राति') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'बिहान') {\n return hour;\n } else if (meridiem === 'दिउँसो') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'साँझ') {\n return hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 3) {\n return 'राति';\n } else if (hour < 12) {\n return 'बिहान';\n } else if (hour < 16) {\n return 'दिउँसो';\n } else if (hour < 20) {\n return 'साँझ';\n } else {\n return 'राति';\n }\n },\n calendar : {\n sameDay : '[आज] LT',\n nextDay : '[भोलि] LT',\n nextWeek : '[आउँदो] dddd[,] LT',\n lastDay : '[हिजो] LT',\n lastWeek : '[गएको] dddd[,] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%sमा',\n past : '%s अगाडि',\n s : 'केही क्षण',\n m : 'एक मिनेट',\n mm : '%d मिनेट',\n h : 'एक घण्टा',\n hh : '%d घण्टा',\n d : 'एक दिन',\n dd : '%d दिन',\n M : 'एक महिना',\n MM : '%d महिना',\n y : 'एक बर्ष',\n yy : '%d बर्ष'\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ne;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ne.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/nl.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/nl.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : dutch (nl)\n//! author : Joris Röling : https://github.com/jjupiter\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'),\n monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');\n\n var nl = moment.defineLocale('nl', {\n months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),\n monthsShort : function (m, format) {\n if (/-MMM-/.test(format)) {\n return monthsShortWithoutDots[m.month()];\n } else {\n return monthsShortWithDots[m.month()];\n }\n },\n monthsParseExact : true,\n weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),\n weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),\n weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD-MM-YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[vandaag om] LT',\n nextDay: '[morgen om] LT',\n nextWeek: 'dddd [om] LT',\n lastDay: '[gisteren om] LT',\n lastWeek: '[afgelopen] dddd [om] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'over %s',\n past : '%s geleden',\n s : 'een paar seconden',\n m : 'één minuut',\n mm : '%d minuten',\n h : 'één uur',\n hh : '%d uur',\n d : 'één dag',\n dd : '%d dagen',\n M : 'één maand',\n MM : '%d maanden',\n y : 'één jaar',\n yy : '%d jaar'\n },\n ordinalParse: /\\d{1,2}(ste|de)/,\n ordinal : function (number) {\n return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return nl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/nl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/nn.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/nn.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : norwegian nynorsk (nn)\n//! author : https://github.com/mechuwind\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var nn = moment.defineLocale('nn', {\n months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),\n monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),\n weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),\n weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),\n weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY [kl.] H:mm',\n LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'\n },\n calendar : {\n sameDay: '[I dag klokka] LT',\n nextDay: '[I morgon klokka] LT',\n nextWeek: 'dddd [klokka] LT',\n lastDay: '[I går klokka] LT',\n lastWeek: '[Føregåande] dddd [klokka] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'om %s',\n past : '%s sidan',\n s : 'nokre sekund',\n m : 'eit minutt',\n mm : '%d minutt',\n h : 'ein time',\n hh : '%d timar',\n d : 'ein dag',\n dd : '%d dagar',\n M : 'ein månad',\n MM : '%d månader',\n y : 'eit år',\n yy : '%d år'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return nn;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/nn.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/pa-in.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/pa-in.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : punjabi india (pa-in)\n//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '੧',\n '2': '੨',\n '3': '੩',\n '4': '੪',\n '5': '੫',\n '6': '੬',\n '7': '੭',\n '8': '੮',\n '9': '੯',\n '0': '੦'\n },\n numberMap = {\n '੧': '1',\n '੨': '2',\n '੩': '3',\n '੪': '4',\n '੫': '5',\n '੬': '6',\n '੭': '7',\n '੮': '8',\n '੯': '9',\n '੦': '0'\n };\n\n var pa_in = moment.defineLocale('pa-in', {\n // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.\n months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),\n monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),\n weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),\n weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),\n longDateFormat : {\n LT : 'A h:mm ਵਜੇ',\n LTS : 'A h:mm:ss ਵਜੇ',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',\n LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'\n },\n calendar : {\n sameDay : '[ਅਜ] LT',\n nextDay : '[ਕਲ] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[ਕਲ] LT',\n lastWeek : '[ਪਿਛਲੇ] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s ਵਿੱਚ',\n past : '%s ਪਿਛਲੇ',\n s : 'ਕੁਝ ਸਕਿੰਟ',\n m : 'ਇਕ ਮਿੰਟ',\n mm : '%d ਮਿੰਟ',\n h : 'ਇੱਕ ਘੰਟਾ',\n hh : '%d ਘੰਟੇ',\n d : 'ਇੱਕ ਦਿਨ',\n dd : '%d ਦਿਨ',\n M : 'ਇੱਕ ਮਹੀਨਾ',\n MM : '%d ਮਹੀਨੇ',\n y : 'ਇੱਕ ਸਾਲ',\n yy : '%d ਸਾਲ'\n },\n preparse: function (string) {\n return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n // Punjabi notation for meridiems are quite fuzzy in practice. While there exists\n // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.\n meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'ਰਾਤ') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'ਸਵੇਰ') {\n return hour;\n } else if (meridiem === 'ਦੁਪਹਿਰ') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'ਸ਼ਾਮ') {\n return hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ਰਾਤ';\n } else if (hour < 10) {\n return 'ਸਵੇਰ';\n } else if (hour < 17) {\n return 'ਦੁਪਹਿਰ';\n } else if (hour < 20) {\n return 'ਸ਼ਾਮ';\n } else {\n return 'ਰਾਤ';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return pa_in;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/pa-in.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/pl.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/pl.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : polish (pl)\n//! author : Rafal Hirsz : https://github.com/evoL\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),\n monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');\n function plural(n) {\n return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);\n }\n function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'm':\n return withoutSuffix ? 'minuta' : 'minutę';\n case 'mm':\n return result + (plural(number) ? 'minuty' : 'minut');\n case 'h':\n return withoutSuffix ? 'godzina' : 'godzinę';\n case 'hh':\n return result + (plural(number) ? 'godziny' : 'godzin');\n case 'MM':\n return result + (plural(number) ? 'miesiące' : 'miesięcy');\n case 'yy':\n return result + (plural(number) ? 'lata' : 'lat');\n }\n }\n\n var pl = moment.defineLocale('pl', {\n months : function (momentToFormat, format) {\n if (format === '') {\n // Hack: if format empty we know this is used to generate\n // RegExp by moment. Give then back both valid forms of months\n // in RegExp ready format.\n return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';\n } else if (/D MMMM/.test(format)) {\n return monthsSubjective[momentToFormat.month()];\n } else {\n return monthsNominative[momentToFormat.month()];\n }\n },\n monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),\n weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),\n weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),\n weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Dziś o] LT',\n nextDay: '[Jutro o] LT',\n nextWeek: '[W] dddd [o] LT',\n lastDay: '[Wczoraj o] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[W zeszłą niedzielę o] LT';\n case 3:\n return '[W zeszłą środę o] LT';\n case 6:\n return '[W zeszłą sobotę o] LT';\n default:\n return '[W zeszły] dddd [o] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : '%s temu',\n s : 'kilka sekund',\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : '1 dzień',\n dd : '%d dni',\n M : 'miesiąc',\n MM : translate,\n y : 'rok',\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return pl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/pl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/pt-br.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/pt-br.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : brazilian portuguese (pt-br)\n//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var pt_br = moment.defineLocale('pt-br', {\n months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),\n monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),\n weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),\n weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),\n weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D [de] MMMM [de] YYYY',\n LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',\n LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'\n },\n calendar : {\n sameDay: '[Hoje às] LT',\n nextDay: '[Amanhã às] LT',\n nextWeek: 'dddd [às] LT',\n lastDay: '[Ontem às] LT',\n lastWeek: function () {\n return (this.day() === 0 || this.day() === 6) ?\n '[Último] dddd [às] LT' : // Saturday + Sunday\n '[Última] dddd [às] LT'; // Monday - Friday\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'em %s',\n past : '%s atrás',\n s : 'poucos segundos',\n m : 'um minuto',\n mm : '%d minutos',\n h : 'uma hora',\n hh : '%d horas',\n d : 'um dia',\n dd : '%d dias',\n M : 'um mês',\n MM : '%d meses',\n y : 'um ano',\n yy : '%d anos'\n },\n ordinalParse: /\\d{1,2}º/,\n ordinal : '%dº'\n });\n\n return pt_br;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/pt-br.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/pt.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/pt.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : portuguese (pt)\n//! author : Jefferson : https://github.com/jalex79\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var pt = moment.defineLocale('pt', {\n months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),\n monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),\n weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),\n weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),\n weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D [de] MMMM [de] YYYY',\n LLL : 'D [de] MMMM [de] YYYY HH:mm',\n LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Hoje às] LT',\n nextDay: '[Amanhã às] LT',\n nextWeek: 'dddd [às] LT',\n lastDay: '[Ontem às] LT',\n lastWeek: function () {\n return (this.day() === 0 || this.day() === 6) ?\n '[Último] dddd [às] LT' : // Saturday + Sunday\n '[Última] dddd [às] LT'; // Monday - Friday\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'em %s',\n past : 'há %s',\n s : 'segundos',\n m : 'um minuto',\n mm : '%d minutos',\n h : 'uma hora',\n hh : '%d horas',\n d : 'um dia',\n dd : '%d dias',\n M : 'um mês',\n MM : '%d meses',\n y : 'um ano',\n yy : '%d anos'\n },\n ordinalParse: /\\d{1,2}º/,\n ordinal : '%dº',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return pt;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/pt.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ro.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ro.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : romanian (ro)\n//! author : Vlad Gurdiga : https://github.com/gurdiga\n//! author : Valentin Agachi : https://github.com/avaly\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'mm': 'minute',\n 'hh': 'ore',\n 'dd': 'zile',\n 'MM': 'luni',\n 'yy': 'ani'\n },\n separator = ' ';\n if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {\n separator = ' de ';\n }\n return number + separator + format[key];\n }\n\n var ro = moment.defineLocale('ro', {\n months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),\n monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),\n weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),\n weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY H:mm',\n LLLL : 'dddd, D MMMM YYYY H:mm'\n },\n calendar : {\n sameDay: '[azi la] LT',\n nextDay: '[mâine la] LT',\n nextWeek: 'dddd [la] LT',\n lastDay: '[ieri la] LT',\n lastWeek: '[fosta] dddd [la] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'peste %s',\n past : '%s în urmă',\n s : 'câteva secunde',\n m : 'un minut',\n mm : relativeTimeWithPlural,\n h : 'o oră',\n hh : relativeTimeWithPlural,\n d : 'o zi',\n dd : relativeTimeWithPlural,\n M : 'o lună',\n MM : relativeTimeWithPlural,\n y : 'un an',\n yy : relativeTimeWithPlural\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ro;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ro.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ru.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ru.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : russian (ru)\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',\n 'hh': 'час_часа_часов',\n 'dd': 'день_дня_дней',\n 'MM': 'месяц_месяца_месяцев',\n 'yy': 'год_года_лет'\n };\n if (key === 'm') {\n return withoutSuffix ? 'минута' : 'минуту';\n }\n else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];\n\n // http://new.gramota.ru/spravka/rules/139-prop : § 103\n // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637\n // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753\n var ru = moment.defineLocale('ru', {\n months : {\n format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),\n standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')\n },\n monthsShort : {\n // по CLDR именно \"июл.\" и \"июн.\", но какой смысл менять букву на точку ?\n format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),\n standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')\n },\n weekdays : {\n standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),\n format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),\n isFormat: /\\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\\] ?dddd/\n },\n weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),\n monthsParse : monthsParse,\n longMonthsParse : monthsParse,\n shortMonthsParse : monthsParse,\n monthsRegex: /^(сентябр[яь]|октябр[яь]|декабр[яь]|феврал[яь]|январ[яь]|апрел[яь]|августа?|ноябр[яь]|сент\\.|февр\\.|нояб\\.|июнь|янв.|июль|дек.|авг.|апр.|марта|мар[.т]|окт.|июн[яь]|июл[яь]|ма[яй])/i,\n monthsShortRegex: /^(сентябр[яь]|октябр[яь]|декабр[яь]|феврал[яь]|январ[яь]|апрел[яь]|августа?|ноябр[яь]|сент\\.|февр\\.|нояб\\.|июнь|янв.|июль|дек.|авг.|апр.|марта|мар[.т]|окт.|июн[яь]|июл[яь]|ма[яй])/i,\n monthsStrictRegex: /^(сентябр[яь]|октябр[яь]|декабр[яь]|феврал[яь]|январ[яь]|апрел[яь]|августа?|ноябр[яь]|марта?|июн[яь]|июл[яь]|ма[яй])/i,\n monthsShortStrictRegex: /^(нояб\\.|февр\\.|сент\\.|июль|янв\\.|июн[яь]|мар[.т]|авг\\.|апр\\.|окт\\.|дек\\.|ма[яй])/i,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY г.',\n LLL : 'D MMMM YYYY г., HH:mm',\n LLLL : 'dddd, D MMMM YYYY г., HH:mm'\n },\n calendar : {\n sameDay: '[Сегодня в] LT',\n nextDay: '[Завтра в] LT',\n lastDay: '[Вчера в] LT',\n nextWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В следующее] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В следующий] dddd [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В следующую] dddd [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd [в] LT';\n } else {\n return '[В] dddd [в] LT';\n }\n }\n },\n lastWeek: function (now) {\n if (now.week() !== this.week()) {\n switch (this.day()) {\n case 0:\n return '[В прошлое] dddd [в] LT';\n case 1:\n case 2:\n case 4:\n return '[В прошлый] dddd [в] LT';\n case 3:\n case 5:\n case 6:\n return '[В прошлую] dddd [в] LT';\n }\n } else {\n if (this.day() === 2) {\n return '[Во] dddd [в] LT';\n } else {\n return '[В] dddd [в] LT';\n }\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'через %s',\n past : '%s назад',\n s : 'несколько секунд',\n m : relativeTimeWithPlural,\n mm : relativeTimeWithPlural,\n h : 'час',\n hh : relativeTimeWithPlural,\n d : 'день',\n dd : relativeTimeWithPlural,\n M : 'месяц',\n MM : relativeTimeWithPlural,\n y : 'год',\n yy : relativeTimeWithPlural\n },\n meridiemParse: /ночи|утра|дня|вечера/i,\n isPM : function (input) {\n return /^(дня|вечера)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночи';\n } else if (hour < 12) {\n return 'утра';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечера';\n }\n },\n ordinalParse: /\\d{1,2}-(й|го|я)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n return number + '-й';\n case 'D':\n return number + '-го';\n case 'w':\n case 'W':\n return number + '-я';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ru;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ru.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/se.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/se.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Northern Sami (se)\n//! authors : Bård Rolstad Henriksen : https://github.com/karamell\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n\n var se = moment.defineLocale('se', {\n months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),\n monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),\n weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),\n weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),\n weekdaysMin : 's_v_m_g_d_b_L'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'MMMM D. [b.] YYYY',\n LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',\n LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'\n },\n calendar : {\n sameDay: '[otne ti] LT',\n nextDay: '[ihttin ti] LT',\n nextWeek: 'dddd [ti] LT',\n lastDay: '[ikte ti] LT',\n lastWeek: '[ovddit] dddd [ti] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : '%s geažes',\n past : 'maŋit %s',\n s : 'moadde sekunddat',\n m : 'okta minuhta',\n mm : '%d minuhtat',\n h : 'okta diimmu',\n hh : '%d diimmut',\n d : 'okta beaivi',\n dd : '%d beaivvit',\n M : 'okta mánnu',\n MM : '%d mánut',\n y : 'okta jahki',\n yy : '%d jagit'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return se;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/se.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/si.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/si.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Sinhalese (si)\n//! author : Sampath Sitinamaluwa : https://github.com/sampathsris\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n /*jshint -W100*/\n var si = moment.defineLocale('si', {\n months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),\n monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),\n weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),\n weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),\n weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'a h:mm',\n LTS : 'a h:mm:ss',\n L : 'YYYY/MM/DD',\n LL : 'YYYY MMMM D',\n LLL : 'YYYY MMMM D, a h:mm',\n LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'\n },\n calendar : {\n sameDay : '[අද] LT[ට]',\n nextDay : '[හෙට] LT[ට]',\n nextWeek : 'dddd LT[ට]',\n lastDay : '[ඊයේ] LT[ට]',\n lastWeek : '[පසුගිය] dddd LT[ට]',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%sකින්',\n past : '%sකට පෙර',\n s : 'තත්පර කිහිපය',\n m : 'මිනිත්තුව',\n mm : 'මිනිත්තු %d',\n h : 'පැය',\n hh : 'පැය %d',\n d : 'දිනය',\n dd : 'දින %d',\n M : 'මාසය',\n MM : 'මාස %d',\n y : 'වසර',\n yy : 'වසර %d'\n },\n ordinalParse: /\\d{1,2} වැනි/,\n ordinal : function (number) {\n return number + ' වැනි';\n },\n meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,\n isPM : function (input) {\n return input === 'ප.ව.' || input === 'පස් වරු';\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'ප.ව.' : 'පස් වරු';\n } else {\n return isLower ? 'පෙ.ව.' : 'පෙර වරු';\n }\n }\n });\n\n return si;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/si.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sk.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sk.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : slovak (sk)\n//! author : Martin Minka : https://github.com/k2s\n//! based on work of petrbela : https://github.com/petrbela\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'),\n monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');\n function plural(n) {\n return (n > 1) && (n < 5);\n }\n function translate(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's': // a few seconds / in a few seconds / a few seconds ago\n return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';\n case 'm': // a minute / in a minute / a minute ago\n return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');\n case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'minúty' : 'minút');\n } else {\n return result + 'minútami';\n }\n break;\n case 'h': // an hour / in an hour / an hour ago\n return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');\n case 'hh': // 9 hours / in 9 hours / 9 hours ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'hodiny' : 'hodín');\n } else {\n return result + 'hodinami';\n }\n break;\n case 'd': // a day / in a day / a day ago\n return (withoutSuffix || isFuture) ? 'deň' : 'dňom';\n case 'dd': // 9 days / in 9 days / 9 days ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'dni' : 'dní');\n } else {\n return result + 'dňami';\n }\n break;\n case 'M': // a month / in a month / a month ago\n return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';\n case 'MM': // 9 months / in 9 months / 9 months ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'mesiace' : 'mesiacov');\n } else {\n return result + 'mesiacmi';\n }\n break;\n case 'y': // a year / in a year / a year ago\n return (withoutSuffix || isFuture) ? 'rok' : 'rokom';\n case 'yy': // 9 years / in 9 years / 9 years ago\n if (withoutSuffix || isFuture) {\n return result + (plural(number) ? 'roky' : 'rokov');\n } else {\n return result + 'rokmi';\n }\n break;\n }\n }\n\n var sk = moment.defineLocale('sk', {\n months : months,\n monthsShort : monthsShort,\n weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),\n weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),\n weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),\n longDateFormat : {\n LT: 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay: '[dnes o] LT',\n nextDay: '[zajtra o] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[v nedeľu o] LT';\n case 1:\n case 2:\n return '[v] dddd [o] LT';\n case 3:\n return '[v stredu o] LT';\n case 4:\n return '[vo štvrtok o] LT';\n case 5:\n return '[v piatok o] LT';\n case 6:\n return '[v sobotu o] LT';\n }\n },\n lastDay: '[včera o] LT',\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n return '[minulú nedeľu o] LT';\n case 1:\n case 2:\n return '[minulý] dddd [o] LT';\n case 3:\n return '[minulú stredu o] LT';\n case 4:\n case 5:\n return '[minulý] dddd [o] LT';\n case 6:\n return '[minulú sobotu o] LT';\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'pred %s',\n s : translate,\n m : translate,\n mm : translate,\n h : translate,\n hh : translate,\n d : translate,\n dd : translate,\n M : translate,\n MM : translate,\n y : translate,\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return sk;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sk.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sl.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sl.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : slovenian (sl)\n//! author : Robert Sedovšek : https://github.com/sedovsek\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var result = number + ' ';\n switch (key) {\n case 's':\n return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';\n case 'm':\n return withoutSuffix ? 'ena minuta' : 'eno minuto';\n case 'mm':\n if (number === 1) {\n result += withoutSuffix ? 'minuta' : 'minuto';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'minuti' : 'minutama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'minute' : 'minutami';\n } else {\n result += withoutSuffix || isFuture ? 'minut' : 'minutami';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'ena ura' : 'eno uro';\n case 'hh':\n if (number === 1) {\n result += withoutSuffix ? 'ura' : 'uro';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'uri' : 'urama';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'ure' : 'urami';\n } else {\n result += withoutSuffix || isFuture ? 'ur' : 'urami';\n }\n return result;\n case 'd':\n return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';\n case 'dd':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'dan' : 'dnem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';\n } else {\n result += withoutSuffix || isFuture ? 'dni' : 'dnevi';\n }\n return result;\n case 'M':\n return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';\n case 'MM':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'mesece' : 'meseci';\n } else {\n result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';\n }\n return result;\n case 'y':\n return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';\n case 'yy':\n if (number === 1) {\n result += withoutSuffix || isFuture ? 'leto' : 'letom';\n } else if (number === 2) {\n result += withoutSuffix || isFuture ? 'leti' : 'letoma';\n } else if (number < 5) {\n result += withoutSuffix || isFuture ? 'leta' : 'leti';\n } else {\n result += withoutSuffix || isFuture ? 'let' : 'leti';\n }\n return result;\n }\n }\n\n var sl = moment.defineLocale('sl', {\n months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),\n monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),\n weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),\n weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H:mm',\n LTS : 'H:mm:ss',\n L : 'DD. MM. YYYY',\n LL : 'D. MMMM YYYY',\n LLL : 'D. MMMM YYYY H:mm',\n LLLL : 'dddd, D. MMMM YYYY H:mm'\n },\n calendar : {\n sameDay : '[danes ob] LT',\n nextDay : '[jutri ob] LT',\n\n nextWeek : function () {\n switch (this.day()) {\n case 0:\n return '[v] [nedeljo] [ob] LT';\n case 3:\n return '[v] [sredo] [ob] LT';\n case 6:\n return '[v] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[v] dddd [ob] LT';\n }\n },\n lastDay : '[včeraj ob] LT',\n lastWeek : function () {\n switch (this.day()) {\n case 0:\n return '[prejšnjo] [nedeljo] [ob] LT';\n case 3:\n return '[prejšnjo] [sredo] [ob] LT';\n case 6:\n return '[prejšnjo] [soboto] [ob] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[prejšnji] dddd [ob] LT';\n }\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'čez %s',\n past : 'pred %s',\n s : processRelativeTime,\n m : processRelativeTime,\n mm : processRelativeTime,\n h : processRelativeTime,\n hh : processRelativeTime,\n d : processRelativeTime,\n dd : processRelativeTime,\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return sl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sq.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sq.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Albanian (sq)\n//! author : Flakërim Ismani : https://github.com/flakerimi\n//! author: Menelion Elensúle: https://github.com/Oire (tests)\n//! author : Oerd Cukalla : https://github.com/oerd (fixes)\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var sq = moment.defineLocale('sq', {\n months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),\n monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),\n weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),\n weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),\n weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),\n weekdaysParseExact : true,\n meridiemParse: /PD|MD/,\n isPM: function (input) {\n return input.charAt(0) === 'M';\n },\n meridiem : function (hours, minutes, isLower) {\n return hours < 12 ? 'PD' : 'MD';\n },\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[Sot në] LT',\n nextDay : '[Nesër në] LT',\n nextWeek : 'dddd [në] LT',\n lastDay : '[Dje në] LT',\n lastWeek : 'dddd [e kaluar në] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'në %s',\n past : '%s më parë',\n s : 'disa sekonda',\n m : 'një minutë',\n mm : '%d minuta',\n h : 'një orë',\n hh : '%d orë',\n d : 'një ditë',\n dd : '%d ditë',\n M : 'një muaj',\n MM : '%d muaj',\n y : 'një vit',\n yy : '%d vite'\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return sq;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sq.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sr-cyrl.js":
/*!*************************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sr-cyrl.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Serbian-cyrillic (sr-cyrl)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var translator = {\n words: { //Different grammatical cases\n m: ['један минут', 'једне минуте'],\n mm: ['минут', 'минуте', 'минута'],\n h: ['један сат', 'једног сата'],\n hh: ['сат', 'сата', 'сати'],\n dd: ['дан', 'дана', 'дана'],\n MM: ['месец', 'месеца', 'месеци'],\n yy: ['година', 'године', 'година']\n },\n correctGrammaticalCase: function (number, wordKey) {\n return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n },\n translate: function (number, withoutSuffix, key) {\n var wordKey = translator.words[key];\n if (key.length === 1) {\n return withoutSuffix ? wordKey[0] : wordKey[1];\n } else {\n return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n }\n }\n };\n\n var sr_cyrl = moment.defineLocale('sr-cyrl', {\n months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),\n monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),\n monthsParseExact: true,\n weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),\n weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),\n weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),\n weekdaysParseExact : true,\n longDateFormat: {\n LT: 'H:mm',\n LTS : 'H:mm:ss',\n L: 'DD. MM. YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[данас у] LT',\n nextDay: '[сутра у] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[у] [недељу] [у] LT';\n case 3:\n return '[у] [среду] [у] LT';\n case 6:\n return '[у] [суботу] [у] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[у] dddd [у] LT';\n }\n },\n lastDay : '[јуче у] LT',\n lastWeek : function () {\n var lastWeekDays = [\n '[прошле] [недеље] [у] LT',\n '[прошлог] [понедељка] [у] LT',\n '[прошлог] [уторка] [у] LT',\n '[прошле] [среде] [у] LT',\n '[прошлог] [четвртка] [у] LT',\n '[прошлог] [петка] [у] LT',\n '[прошле] [суботе] [у] LT'\n ];\n return lastWeekDays[this.day()];\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'за %s',\n past : 'пре %s',\n s : 'неколико секунди',\n m : translator.translate,\n mm : translator.translate,\n h : translator.translate,\n hh : translator.translate,\n d : 'дан',\n dd : translator.translate,\n M : 'месец',\n MM : translator.translate,\n y : 'годину',\n yy : translator.translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return sr_cyrl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sr-cyrl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sr.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sr.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Serbian-latin (sr)\n//! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var translator = {\n words: { //Different grammatical cases\n m: ['jedan minut', 'jedne minute'],\n mm: ['minut', 'minute', 'minuta'],\n h: ['jedan sat', 'jednog sata'],\n hh: ['sat', 'sata', 'sati'],\n dd: ['dan', 'dana', 'dana'],\n MM: ['mesec', 'meseca', 'meseci'],\n yy: ['godina', 'godine', 'godina']\n },\n correctGrammaticalCase: function (number, wordKey) {\n return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);\n },\n translate: function (number, withoutSuffix, key) {\n var wordKey = translator.words[key];\n if (key.length === 1) {\n return withoutSuffix ? wordKey[0] : wordKey[1];\n } else {\n return number + ' ' + translator.correctGrammaticalCase(number, wordKey);\n }\n }\n };\n\n var sr = moment.defineLocale('sr', {\n months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),\n monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),\n monthsParseExact: true,\n weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),\n weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),\n weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),\n weekdaysParseExact : true,\n longDateFormat: {\n LT: 'H:mm',\n LTS : 'H:mm:ss',\n L: 'DD. MM. YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY H:mm',\n LLLL: 'dddd, D. MMMM YYYY H:mm'\n },\n calendar: {\n sameDay: '[danas u] LT',\n nextDay: '[sutra u] LT',\n nextWeek: function () {\n switch (this.day()) {\n case 0:\n return '[u] [nedelju] [u] LT';\n case 3:\n return '[u] [sredu] [u] LT';\n case 6:\n return '[u] [subotu] [u] LT';\n case 1:\n case 2:\n case 4:\n case 5:\n return '[u] dddd [u] LT';\n }\n },\n lastDay : '[juče u] LT',\n lastWeek : function () {\n var lastWeekDays = [\n '[prošle] [nedelje] [u] LT',\n '[prošlog] [ponedeljka] [u] LT',\n '[prošlog] [utorka] [u] LT',\n '[prošle] [srede] [u] LT',\n '[prošlog] [četvrtka] [u] LT',\n '[prošlog] [petka] [u] LT',\n '[prošle] [subote] [u] LT'\n ];\n return lastWeekDays[this.day()];\n },\n sameElse : 'L'\n },\n relativeTime : {\n future : 'za %s',\n past : 'pre %s',\n s : 'nekoliko sekundi',\n m : translator.translate,\n mm : translator.translate,\n h : translator.translate,\n hh : translator.translate,\n d : 'dan',\n dd : translator.translate,\n M : 'mesec',\n MM : translator.translate,\n y : 'godinu',\n yy : translator.translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return sr;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sr.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ss.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ss.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : siSwati (ss)\n//! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n\n var ss = moment.defineLocale('ss', {\n months : \"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni\".split('_'),\n monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),\n weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),\n weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),\n weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'h:mm A',\n LTS : 'h:mm:ss A',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY h:mm A',\n LLLL : 'dddd, D MMMM YYYY h:mm A'\n },\n calendar : {\n sameDay : '[Namuhla nga] LT',\n nextDay : '[Kusasa nga] LT',\n nextWeek : 'dddd [nga] LT',\n lastDay : '[Itolo nga] LT',\n lastWeek : 'dddd [leliphelile] [nga] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'nga %s',\n past : 'wenteka nga %s',\n s : 'emizuzwana lomcane',\n m : 'umzuzu',\n mm : '%d emizuzu',\n h : 'lihora',\n hh : '%d emahora',\n d : 'lilanga',\n dd : '%d emalanga',\n M : 'inyanga',\n MM : '%d tinyanga',\n y : 'umnyaka',\n yy : '%d iminyaka'\n },\n meridiemParse: /ekuseni|emini|entsambama|ebusuku/,\n meridiem : function (hours, minutes, isLower) {\n if (hours < 11) {\n return 'ekuseni';\n } else if (hours < 15) {\n return 'emini';\n } else if (hours < 19) {\n return 'entsambama';\n } else {\n return 'ebusuku';\n }\n },\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'ekuseni') {\n return hour;\n } else if (meridiem === 'emini') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {\n if (hour === 0) {\n return 0;\n }\n return hour + 12;\n }\n },\n ordinalParse: /\\d{1,2}/,\n ordinal : '%d',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return ss;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ss.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sv.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sv.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : swedish (sv)\n//! author : Jens Alm : https://github.com/ulmus\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var sv = moment.defineLocale('sv', {\n months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),\n monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),\n weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),\n weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),\n weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'YYYY-MM-DD',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY [kl.] HH:mm',\n LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',\n lll : 'D MMM YYYY HH:mm',\n llll : 'ddd D MMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Idag] LT',\n nextDay: '[Imorgon] LT',\n lastDay: '[Igår] LT',\n nextWeek: '[På] dddd LT',\n lastWeek: '[I] dddd[s] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'om %s',\n past : 'för %s sedan',\n s : 'några sekunder',\n m : 'en minut',\n mm : '%d minuter',\n h : 'en timme',\n hh : '%d timmar',\n d : 'en dag',\n dd : '%d dagar',\n M : 'en månad',\n MM : '%d månader',\n y : 'ett år',\n yy : '%d år'\n },\n ordinalParse: /\\d{1,2}(e|a)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'e' :\n (b === 1) ? 'a' :\n (b === 2) ? 'a' :\n (b === 3) ? 'e' : 'e';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return sv;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sv.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/sw.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/sw.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : swahili (sw)\n//! author : Fahad Kassim : https://github.com/fadsel\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var sw = moment.defineLocale('sw', {\n months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),\n monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),\n weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),\n weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),\n weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[leo saa] LT',\n nextDay : '[kesho saa] LT',\n nextWeek : '[wiki ijayo] dddd [saat] LT',\n lastDay : '[jana] LT',\n lastWeek : '[wiki iliyopita] dddd [saat] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s baadaye',\n past : 'tokea %s',\n s : 'hivi punde',\n m : 'dakika moja',\n mm : 'dakika %d',\n h : 'saa limoja',\n hh : 'masaa %d',\n d : 'siku moja',\n dd : 'masiku %d',\n M : 'mwezi mmoja',\n MM : 'miezi %d',\n y : 'mwaka mmoja',\n yy : 'miaka %d'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return sw;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/sw.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/ta.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/ta.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : tamil (ta)\n//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var symbolMap = {\n '1': '௧',\n '2': '௨',\n '3': '௩',\n '4': '௪',\n '5': '௫',\n '6': '௬',\n '7': '௭',\n '8': '௮',\n '9': '௯',\n '0': '௦'\n }, numberMap = {\n '௧': '1',\n '௨': '2',\n '௩': '3',\n '௪': '4',\n '௫': '5',\n '௬': '6',\n '௭': '7',\n '௮': '8',\n '௯': '9',\n '௦': '0'\n };\n\n var ta = moment.defineLocale('ta', {\n months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),\n weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),\n weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),\n weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, HH:mm',\n LLLL : 'dddd, D MMMM YYYY, HH:mm'\n },\n calendar : {\n sameDay : '[இன்று] LT',\n nextDay : '[நாளை] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[நேற்று] LT',\n lastWeek : '[கடந்த வாரம்] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s இல்',\n past : '%s முன்',\n s : 'ஒரு சில விநாடிகள்',\n m : 'ஒரு நிமிடம்',\n mm : '%d நிமிடங்கள்',\n h : 'ஒரு மணி நேரம்',\n hh : '%d மணி நேரம்',\n d : 'ஒரு நாள்',\n dd : '%d நாட்கள்',\n M : 'ஒரு மாதம்',\n MM : '%d மாதங்கள்',\n y : 'ஒரு வருடம்',\n yy : '%d ஆண்டுகள்'\n },\n ordinalParse: /\\d{1,2}வது/,\n ordinal : function (number) {\n return number + 'வது';\n },\n preparse: function (string) {\n return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {\n return numberMap[match];\n });\n },\n postformat: function (string) {\n return string.replace(/\\d/g, function (match) {\n return symbolMap[match];\n });\n },\n // refer http://ta.wikipedia.org/s/1er1\n meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,\n meridiem : function (hour, minute, isLower) {\n if (hour < 2) {\n return ' யாமம்';\n } else if (hour < 6) {\n return ' வைகறை'; // வைகறை\n } else if (hour < 10) {\n return ' காலை'; // காலை\n } else if (hour < 14) {\n return ' நண்பகல்'; // நண்பகல்\n } else if (hour < 18) {\n return ' எற்பாடு'; // எற்பாடு\n } else if (hour < 22) {\n return ' மாலை'; // மாலை\n } else {\n return ' யாமம்';\n }\n },\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'யாமம்') {\n return hour < 2 ? hour : hour + 12;\n } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {\n return hour;\n } else if (meridiem === 'நண்பகல்') {\n return hour >= 10 ? hour : hour + 12;\n } else {\n return hour + 12;\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return ta;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/ta.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/te.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/te.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : telugu (te)\n//! author : Krishna Chaitanya Thota : https://github.com/kcthota\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var te = moment.defineLocale('te', {\n months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),\n monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),\n monthsParseExact : true,\n weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),\n weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),\n weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),\n longDateFormat : {\n LT : 'A h:mm',\n LTS : 'A h:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY, A h:mm',\n LLLL : 'dddd, D MMMM YYYY, A h:mm'\n },\n calendar : {\n sameDay : '[నేడు] LT',\n nextDay : '[రేపు] LT',\n nextWeek : 'dddd, LT',\n lastDay : '[నిన్న] LT',\n lastWeek : '[గత] dddd, LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s లో',\n past : '%s క్రితం',\n s : 'కొన్ని క్షణాలు',\n m : 'ఒక నిమిషం',\n mm : '%d నిమిషాలు',\n h : 'ఒక గంట',\n hh : '%d గంటలు',\n d : 'ఒక రోజు',\n dd : '%d రోజులు',\n M : 'ఒక నెల',\n MM : '%d నెలలు',\n y : 'ఒక సంవత్సరం',\n yy : '%d సంవత్సరాలు'\n },\n ordinalParse : /\\d{1,2}వ/,\n ordinal : '%dవ',\n meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'రాత్రి') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'ఉదయం') {\n return hour;\n } else if (meridiem === 'మధ్యాహ్నం') {\n return hour >= 10 ? hour : hour + 12;\n } else if (meridiem === 'సాయంత్రం') {\n return hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'రాత్రి';\n } else if (hour < 10) {\n return 'ఉదయం';\n } else if (hour < 17) {\n return 'మధ్యాహ్నం';\n } else if (hour < 20) {\n return 'సాయంత్రం';\n } else {\n return 'రాత్రి';\n }\n },\n week : {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return te;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/te.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/th.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/th.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : thai (th)\n//! author : Kridsada Thanabulpong : https://github.com/sirn\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var th = moment.defineLocale('th', {\n months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),\n monthsShort : 'มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา'.split('_'),\n monthsParseExact: true,\n weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),\n weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference\n weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'H นาฬิกา m นาที',\n LTS : 'H นาฬิกา m นาที s วินาที',\n L : 'YYYY/MM/DD',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY เวลา H นาฬิกา m นาที',\n LLLL : 'วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที'\n },\n meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,\n isPM: function (input) {\n return input === 'หลังเที่ยง';\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 12) {\n return 'ก่อนเที่ยง';\n } else {\n return 'หลังเที่ยง';\n }\n },\n calendar : {\n sameDay : '[วันนี้ เวลา] LT',\n nextDay : '[พรุ่งนี้ เวลา] LT',\n nextWeek : 'dddd[หน้า เวลา] LT',\n lastDay : '[เมื่อวานนี้ เวลา] LT',\n lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'อีก %s',\n past : '%sที่แล้ว',\n s : 'ไม่กี่วินาที',\n m : '1 นาที',\n mm : '%d นาที',\n h : '1 ชั่วโมง',\n hh : '%d ชั่วโมง',\n d : '1 วัน',\n dd : '%d วัน',\n M : '1 เดือน',\n MM : '%d เดือน',\n y : '1 ปี',\n yy : '%d ปี'\n }\n });\n\n return th;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/th.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tl-ph.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tl-ph.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Tagalog/Filipino (tl-ph)\n//! author : Dan Hagman\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var tl_ph = moment.defineLocale('tl-ph', {\n months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),\n monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),\n weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),\n weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),\n weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'MM/D/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY HH:mm',\n LLLL : 'dddd, MMMM DD, YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Ngayon sa] LT',\n nextDay: '[Bukas sa] LT',\n nextWeek: 'dddd [sa] LT',\n lastDay: '[Kahapon sa] LT',\n lastWeek: 'dddd [huling linggo] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'sa loob ng %s',\n past : '%s ang nakalipas',\n s : 'ilang segundo',\n m : 'isang minuto',\n mm : '%d minuto',\n h : 'isang oras',\n hh : '%d oras',\n d : 'isang araw',\n dd : '%d araw',\n M : 'isang buwan',\n MM : '%d buwan',\n y : 'isang taon',\n yy : '%d taon'\n },\n ordinalParse: /\\d{1,2}/,\n ordinal : function (number) {\n return number;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return tl_ph;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tl-ph.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tlh.js":
/*!*********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tlh.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Klingon (tlh)\n//! author : Dominika Kruk : https://github.com/amaranthrose\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');\n\n function translateFuture(output) {\n var time = output;\n time = (output.indexOf('jaj') !== -1) ?\n \ttime.slice(0, -3) + 'leS' :\n \t(output.indexOf('jar') !== -1) ?\n \ttime.slice(0, -3) + 'waQ' :\n \t(output.indexOf('DIS') !== -1) ?\n \ttime.slice(0, -3) + 'nem' :\n \ttime + ' pIq';\n return time;\n }\n\n function translatePast(output) {\n var time = output;\n time = (output.indexOf('jaj') !== -1) ?\n \ttime.slice(0, -3) + 'Hu’' :\n \t(output.indexOf('jar') !== -1) ?\n \ttime.slice(0, -3) + 'wen' :\n \t(output.indexOf('DIS') !== -1) ?\n \ttime.slice(0, -3) + 'ben' :\n \ttime + ' ret';\n return time;\n }\n\n function translate(number, withoutSuffix, string, isFuture) {\n var numberNoun = numberAsNoun(number);\n switch (string) {\n case 'mm':\n return numberNoun + ' tup';\n case 'hh':\n return numberNoun + ' rep';\n case 'dd':\n return numberNoun + ' jaj';\n case 'MM':\n return numberNoun + ' jar';\n case 'yy':\n return numberNoun + ' DIS';\n }\n }\n\n function numberAsNoun(number) {\n var hundred = Math.floor((number % 1000) / 100),\n \tten = Math.floor((number % 100) / 10),\n \tone = number % 10,\n \tword = '';\n if (hundred > 0) {\n word += numbersNouns[hundred] + 'vatlh';\n }\n if (ten > 0) {\n word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';\n }\n if (one > 0) {\n word += ((word !== '') ? ' ' : '') + numbersNouns[one];\n }\n return (word === '') ? 'pagh' : word;\n }\n\n var tlh = moment.defineLocale('tlh', {\n months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),\n monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),\n monthsParseExact : true,\n weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[DaHjaj] LT',\n nextDay: '[wa’leS] LT',\n nextWeek: 'LLL',\n lastDay: '[wa’Hu’] LT',\n lastWeek: 'LLL',\n sameElse: 'L'\n },\n relativeTime : {\n future : translateFuture,\n past : translatePast,\n s : 'puS lup',\n m : 'wa’ tup',\n mm : translate,\n h : 'wa’ rep',\n hh : translate,\n d : 'wa’ jaj',\n dd : translate,\n M : 'wa’ jar',\n MM : translate,\n y : 'wa’ DIS',\n yy : translate\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return tlh;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tlh.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tr.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tr.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : turkish (tr)\n//! authors : Erhan Gundogan : https://github.com/erhangundogan,\n//! Burak Yiğit Kaya: https://github.com/BYK\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var suffixes = {\n 1: '\\'inci',\n 5: '\\'inci',\n 8: '\\'inci',\n 70: '\\'inci',\n 80: '\\'inci',\n 2: '\\'nci',\n 7: '\\'nci',\n 20: '\\'nci',\n 50: '\\'nci',\n 3: '\\'üncü',\n 4: '\\'üncü',\n 100: '\\'üncü',\n 6: '\\'ncı',\n 9: '\\'uncu',\n 10: '\\'uncu',\n 30: '\\'uncu',\n 60: '\\'ıncı',\n 90: '\\'ıncı'\n };\n\n var tr = moment.defineLocale('tr', {\n months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),\n monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),\n weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),\n weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),\n weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[bugün saat] LT',\n nextDay : '[yarın saat] LT',\n nextWeek : '[haftaya] dddd [saat] LT',\n lastDay : '[dün] LT',\n lastWeek : '[geçen hafta] dddd [saat] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : '%s sonra',\n past : '%s önce',\n s : 'birkaç saniye',\n m : 'bir dakika',\n mm : '%d dakika',\n h : 'bir saat',\n hh : '%d saat',\n d : 'bir gün',\n dd : '%d gün',\n M : 'bir ay',\n MM : '%d ay',\n y : 'bir yıl',\n yy : '%d yıl'\n },\n ordinalParse: /\\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,\n ordinal : function (number) {\n if (number === 0) { // special case for zero\n return number + '\\'ıncı';\n }\n var a = number % 10,\n b = number % 100 - a,\n c = number >= 100 ? 100 : null;\n return number + (suffixes[a] || suffixes[b] || suffixes[c]);\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return tr;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tr.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tzl.js":
/*!*********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tzl.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : talossan (tzl)\n//! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n\n // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.\n // This is currently too difficult (maybe even impossible) to add.\n var tzl = moment.defineLocale('tzl', {\n months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),\n monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),\n weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),\n weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),\n weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),\n longDateFormat : {\n LT : 'HH.mm',\n LTS : 'HH.mm.ss',\n L : 'DD.MM.YYYY',\n LL : 'D. MMMM [dallas] YYYY',\n LLL : 'D. MMMM [dallas] YYYY HH.mm',\n LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'\n },\n meridiemParse: /d\\'o|d\\'a/i,\n isPM : function (input) {\n return 'd\\'o' === input.toLowerCase();\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'd\\'o' : 'D\\'O';\n } else {\n return isLower ? 'd\\'a' : 'D\\'A';\n }\n },\n calendar : {\n sameDay : '[oxhi à] LT',\n nextDay : '[demà à] LT',\n nextWeek : 'dddd [à] LT',\n lastDay : '[ieiri à] LT',\n lastWeek : '[sür el] dddd [lasteu à] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'osprei %s',\n past : 'ja%s',\n s : processRelativeTime,\n m : processRelativeTime,\n mm : processRelativeTime,\n h : processRelativeTime,\n hh : processRelativeTime,\n d : processRelativeTime,\n dd : processRelativeTime,\n M : processRelativeTime,\n MM : processRelativeTime,\n y : processRelativeTime,\n yy : processRelativeTime\n },\n ordinalParse: /\\d{1,2}\\./,\n ordinal : '%d.',\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n 's': ['viensas secunds', '\\'iensas secunds'],\n 'm': ['\\'n míut', '\\'iens míut'],\n 'mm': [number + ' míuts', '' + number + ' míuts'],\n 'h': ['\\'n þora', '\\'iensa þora'],\n 'hh': [number + ' þoras', '' + number + ' þoras'],\n 'd': ['\\'n ziua', '\\'iensa ziua'],\n 'dd': [number + ' ziuas', '' + number + ' ziuas'],\n 'M': ['\\'n mes', '\\'iens mes'],\n 'MM': [number + ' mesen', '' + number + ' mesen'],\n 'y': ['\\'n ar', '\\'iens ar'],\n 'yy': [number + ' ars', '' + number + ' ars']\n };\n return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);\n }\n\n return tzl;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tzl.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tzm-latn.js":
/*!**************************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tzm-latn.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt in Latin (tzm-latn)\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var tzm_latn = moment.defineLocale('tzm-latn', {\n months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),\n weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[asdkh g] LT',\n nextDay: '[aska g] LT',\n nextWeek: 'dddd [g] LT',\n lastDay: '[assant g] LT',\n lastWeek: 'dddd [g] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'dadkh s yan %s',\n past : 'yan %s',\n s : 'imik',\n m : 'minuḍ',\n mm : '%d minuḍ',\n h : 'saɛa',\n hh : '%d tassaɛin',\n d : 'ass',\n dd : '%d ossan',\n M : 'ayowr',\n MM : '%d iyyirn',\n y : 'asgas',\n yy : '%d isgasn'\n },\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return tzm_latn;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tzm-latn.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/tzm.js":
/*!*********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/tzm.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : Morocco Central Atlas Tamaziɣt (tzm)\n//! author : Abdel Said : https://github.com/abdelsaid\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var tzm = moment.defineLocale('tzm', {\n months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),\n weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS: 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',\n nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',\n nextWeek: 'dddd [ⴴ] LT',\n lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',\n lastWeek: 'dddd [ⴴ] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',\n past : 'ⵢⴰⵏ %s',\n s : 'ⵉⵎⵉⴽ',\n m : 'ⵎⵉⵏⵓⴺ',\n mm : '%d ⵎⵉⵏⵓⴺ',\n h : 'ⵙⴰⵄⴰ',\n hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',\n d : 'ⴰⵙⵙ',\n dd : '%d oⵙⵙⴰⵏ',\n M : 'ⴰⵢoⵓⵔ',\n MM : '%d ⵉⵢⵢⵉⵔⵏ',\n y : 'ⴰⵙⴳⴰⵙ',\n yy : '%d ⵉⵙⴳⴰⵙⵏ'\n },\n week : {\n dow : 6, // Saturday is the first day of the week.\n doy : 12 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return tzm;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/tzm.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/uk.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/uk.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : ukrainian (uk)\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n function plural(word, num) {\n var forms = word.split('_');\n return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);\n }\n function relativeTimeWithPlural(number, withoutSuffix, key) {\n var format = {\n 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',\n 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',\n 'dd': 'день_дні_днів',\n 'MM': 'місяць_місяці_місяців',\n 'yy': 'рік_роки_років'\n };\n if (key === 'm') {\n return withoutSuffix ? 'хвилина' : 'хвилину';\n }\n else if (key === 'h') {\n return withoutSuffix ? 'година' : 'годину';\n }\n else {\n return number + ' ' + plural(format[key], +number);\n }\n }\n function weekdaysCaseReplace(m, format) {\n var weekdays = {\n 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),\n 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),\n 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')\n },\n nounCase = (/(\\[[ВвУу]\\]) ?dddd/).test(format) ?\n 'accusative' :\n ((/\\[?(?:минулої|наступної)? ?\\] ?dddd/).test(format) ?\n 'genitive' :\n 'nominative');\n return weekdays[nounCase][m.day()];\n }\n function processHoursFunction(str) {\n return function () {\n return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';\n };\n }\n\n var uk = moment.defineLocale('uk', {\n months : {\n 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),\n 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')\n },\n monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),\n weekdays : weekdaysCaseReplace,\n weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD.MM.YYYY',\n LL : 'D MMMM YYYY р.',\n LLL : 'D MMMM YYYY р., HH:mm',\n LLLL : 'dddd, D MMMM YYYY р., HH:mm'\n },\n calendar : {\n sameDay: processHoursFunction('[Сьогодні '),\n nextDay: processHoursFunction('[Завтра '),\n lastDay: processHoursFunction('[Вчора '),\n nextWeek: processHoursFunction('[У] dddd ['),\n lastWeek: function () {\n switch (this.day()) {\n case 0:\n case 3:\n case 5:\n case 6:\n return processHoursFunction('[Минулої] dddd [').call(this);\n case 1:\n case 2:\n case 4:\n return processHoursFunction('[Минулого] dddd [').call(this);\n }\n },\n sameElse: 'L'\n },\n relativeTime : {\n future : 'за %s',\n past : '%s тому',\n s : 'декілька секунд',\n m : relativeTimeWithPlural,\n mm : relativeTimeWithPlural,\n h : 'годину',\n hh : relativeTimeWithPlural,\n d : 'день',\n dd : relativeTimeWithPlural,\n M : 'місяць',\n MM : relativeTimeWithPlural,\n y : 'рік',\n yy : relativeTimeWithPlural\n },\n // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason\n meridiemParse: /ночі|ранку|дня|вечора/,\n isPM: function (input) {\n return /^(дня|вечора)$/.test(input);\n },\n meridiem : function (hour, minute, isLower) {\n if (hour < 4) {\n return 'ночі';\n } else if (hour < 12) {\n return 'ранку';\n } else if (hour < 17) {\n return 'дня';\n } else {\n return 'вечора';\n }\n },\n ordinalParse: /\\d{1,2}-(й|го)/,\n ordinal: function (number, period) {\n switch (period) {\n case 'M':\n case 'd':\n case 'DDD':\n case 'w':\n case 'W':\n return number + '-й';\n case 'D':\n return number + '-го';\n default:\n return number;\n }\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 1st is the first week of the year.\n }\n });\n\n return uk;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/uk.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/uz.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/uz.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : uzbek (uz)\n//! author : Sardor Muminov : https://github.com/muminoff\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var uz = moment.defineLocale('uz', {\n months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),\n monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),\n weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),\n weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),\n weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'D MMMM YYYY, dddd HH:mm'\n },\n calendar : {\n sameDay : '[Бугун соат] LT [да]',\n nextDay : '[Эртага] LT [да]',\n nextWeek : 'dddd [куни соат] LT [да]',\n lastDay : '[Кеча соат] LT [да]',\n lastWeek : '[Утган] dddd [куни соат] LT [да]',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'Якин %s ичида',\n past : 'Бир неча %s олдин',\n s : 'фурсат',\n m : 'бир дакика',\n mm : '%d дакика',\n h : 'бир соат',\n hh : '%d соат',\n d : 'бир кун',\n dd : '%d кун',\n M : 'бир ой',\n MM : '%d ой',\n y : 'бир йил',\n yy : '%d йил'\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 7 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return uz;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/uz.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/vi.js":
/*!********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/vi.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : vietnamese (vi)\n//! author : Bang Nguyen : https://github.com/bangnk\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var vi = moment.defineLocale('vi', {\n months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),\n monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),\n monthsParseExact : true,\n weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),\n weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),\n weekdaysParseExact : true,\n meridiemParse: /sa|ch/i,\n isPM : function (input) {\n return /^ch$/i.test(input);\n },\n meridiem : function (hours, minutes, isLower) {\n if (hours < 12) {\n return isLower ? 'sa' : 'SA';\n } else {\n return isLower ? 'ch' : 'CH';\n }\n },\n longDateFormat : {\n LT : 'HH:mm',\n LTS : 'HH:mm:ss',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM [năm] YYYY',\n LLL : 'D MMMM [năm] YYYY HH:mm',\n LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',\n l : 'DD/M/YYYY',\n ll : 'D MMM YYYY',\n lll : 'D MMM YYYY HH:mm',\n llll : 'ddd, D MMM YYYY HH:mm'\n },\n calendar : {\n sameDay: '[Hôm nay lúc] LT',\n nextDay: '[Ngày mai lúc] LT',\n nextWeek: 'dddd [tuần tới lúc] LT',\n lastDay: '[Hôm qua lúc] LT',\n lastWeek: 'dddd [tuần rồi lúc] LT',\n sameElse: 'L'\n },\n relativeTime : {\n future : '%s tới',\n past : '%s trước',\n s : 'vài giây',\n m : 'một phút',\n mm : '%d phút',\n h : 'một giờ',\n hh : '%d giờ',\n d : 'một ngày',\n dd : '%d ngày',\n M : 'một tháng',\n MM : '%d tháng',\n y : 'một năm',\n yy : '%d năm'\n },\n ordinalParse: /\\d{1,2}/,\n ordinal : function (number) {\n return number;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return vi;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/vi.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/x-pseudo.js":
/*!**************************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/x-pseudo.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : pseudo (x-pseudo)\n//! author : Andrew Hood : https://github.com/andrewhood125\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var x_pseudo = moment.defineLocale('x-pseudo', {\n months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),\n monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),\n monthsParseExact : true,\n weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),\n weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),\n weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),\n weekdaysParseExact : true,\n longDateFormat : {\n LT : 'HH:mm',\n L : 'DD/MM/YYYY',\n LL : 'D MMMM YYYY',\n LLL : 'D MMMM YYYY HH:mm',\n LLLL : 'dddd, D MMMM YYYY HH:mm'\n },\n calendar : {\n sameDay : '[T~ódá~ý át] LT',\n nextDay : '[T~ómó~rró~w át] LT',\n nextWeek : 'dddd [át] LT',\n lastDay : '[Ý~ést~érdá~ý át] LT',\n lastWeek : '[L~ást] dddd [át] LT',\n sameElse : 'L'\n },\n relativeTime : {\n future : 'í~ñ %s',\n past : '%s á~gó',\n s : 'á ~féw ~sécó~ñds',\n m : 'á ~míñ~úté',\n mm : '%d m~íñú~tés',\n h : 'á~ñ hó~úr',\n hh : '%d h~óúrs',\n d : 'á ~dáý',\n dd : '%d d~áýs',\n M : 'á ~móñ~th',\n MM : '%d m~óñt~hs',\n y : 'á ~ýéár',\n yy : '%d ý~éárs'\n },\n ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (~~(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n },\n week : {\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return x_pseudo;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/x-pseudo.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/zh-cn.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/zh-cn.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : chinese (zh-cn)\n//! author : suupic : https://github.com/suupic\n//! author : Zeno Zeng : https://github.com/zenozeng\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var zh_cn = moment.defineLocale('zh-cn', {\n months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),\n weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n longDateFormat : {\n LT : 'Ah点mm分',\n LTS : 'Ah点m分s秒',\n L : 'YYYY-MM-DD',\n LL : 'YYYY年MMMD日',\n LLL : 'YYYY年MMMD日Ah点mm分',\n LLLL : 'YYYY年MMMD日ddddAh点mm分',\n l : 'YYYY-MM-DD',\n ll : 'YYYY年MMMD日',\n lll : 'YYYY年MMMD日Ah点mm分',\n llll : 'YYYY年MMMD日ddddAh点mm分'\n },\n meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === '凌晨' || meridiem === '早上' ||\n meridiem === '上午') {\n return hour;\n } else if (meridiem === '下午' || meridiem === '晚上') {\n return hour + 12;\n } else {\n // '中午'\n return hour >= 11 ? hour : hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n var hm = hour * 100 + minute;\n if (hm < 600) {\n return '凌晨';\n } else if (hm < 900) {\n return '早上';\n } else if (hm < 1130) {\n return '上午';\n } else if (hm < 1230) {\n return '中午';\n } else if (hm < 1800) {\n return '下午';\n } else {\n return '晚上';\n }\n },\n calendar : {\n sameDay : function () {\n return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';\n },\n nextDay : function () {\n return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';\n },\n lastDay : function () {\n return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';\n },\n nextWeek : function () {\n var startOfWeek, prefix;\n startOfWeek = moment().startOf('week');\n prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]';\n return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n },\n lastWeek : function () {\n var startOfWeek, prefix;\n startOfWeek = moment().startOf('week');\n prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';\n return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';\n },\n sameElse : 'LL'\n },\n ordinalParse: /\\d{1,2}(日|月|周)/,\n ordinal : function (number, period) {\n switch (period) {\n case 'd':\n case 'D':\n case 'DDD':\n return number + '日';\n case 'M':\n return number + '月';\n case 'w':\n case 'W':\n return number + '周';\n default:\n return number;\n }\n },\n relativeTime : {\n future : '%s内',\n past : '%s前',\n s : '几秒',\n m : '1 分钟',\n mm : '%d 分钟',\n h : '1 小时',\n hh : '%d 小时',\n d : '1 天',\n dd : '%d 天',\n M : '1 个月',\n MM : '%d 个月',\n y : '1 年',\n yy : '%d 年'\n },\n week : {\n // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效\n dow : 1, // Monday is the first day of the week.\n doy : 4 // The week that contains Jan 4th is the first week of the year.\n }\n });\n\n return zh_cn;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/zh-cn.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/locale/zh-tw.js":
/*!***********************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/locale/zh-tw.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("//! moment.js locale configuration\n//! locale : traditional chinese (zh-tw)\n//! author : Ben : https://github.com/ben-lin\n\n;(function (global, factory) {\n true ? factory(__webpack_require__(/*! ../moment */ \"./node_modules/handsontable/node_modules/moment/moment.js\")) :\n undefined\n}(this, function (moment) { 'use strict';\n\n\n var zh_tw = moment.defineLocale('zh-tw', {\n months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),\n monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),\n weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),\n weekdaysMin : '日_一_二_三_四_五_六'.split('_'),\n longDateFormat : {\n LT : 'Ah點mm分',\n LTS : 'Ah點m分s秒',\n L : 'YYYY年MMMD日',\n LL : 'YYYY年MMMD日',\n LLL : 'YYYY年MMMD日Ah點mm分',\n LLLL : 'YYYY年MMMD日ddddAh點mm分',\n l : 'YYYY年MMMD日',\n ll : 'YYYY年MMMD日',\n lll : 'YYYY年MMMD日Ah點mm分',\n llll : 'YYYY年MMMD日ddddAh點mm分'\n },\n meridiemParse: /早上|上午|中午|下午|晚上/,\n meridiemHour : function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === '早上' || meridiem === '上午') {\n return hour;\n } else if (meridiem === '中午') {\n return hour >= 11 ? hour : hour + 12;\n } else if (meridiem === '下午' || meridiem === '晚上') {\n return hour + 12;\n }\n },\n meridiem : function (hour, minute, isLower) {\n var hm = hour * 100 + minute;\n if (hm < 900) {\n return '早上';\n } else if (hm < 1130) {\n return '上午';\n } else if (hm < 1230) {\n return '中午';\n } else if (hm < 1800) {\n return '下午';\n } else {\n return '晚上';\n }\n },\n calendar : {\n sameDay : '[今天]LT',\n nextDay : '[明天]LT',\n nextWeek : '[下]ddddLT',\n lastDay : '[昨天]LT',\n lastWeek : '[上]ddddLT',\n sameElse : 'L'\n },\n ordinalParse: /\\d{1,2}(日|月|週)/,\n ordinal : function (number, period) {\n switch (period) {\n case 'd' :\n case 'D' :\n case 'DDD' :\n return number + '日';\n case 'M' :\n return number + '月';\n case 'w' :\n case 'W' :\n return number + '週';\n default :\n return number;\n }\n },\n relativeTime : {\n future : '%s內',\n past : '%s前',\n s : '幾秒',\n m : '1分鐘',\n mm : '%d分鐘',\n h : '1小時',\n hh : '%d小時',\n d : '1天',\n dd : '%d天',\n M : '1個月',\n MM : '%d個月',\n y : '1年',\n yy : '%d年'\n }\n });\n\n return zh_tw;\n\n}));\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/locale/zh-tw.js?");
/***/ }),
/***/ "./node_modules/handsontable/node_modules/moment/moment.js":
/*!*****************************************************************!*\
!*** ./node_modules/handsontable/node_modules/moment/moment.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/* WEBPACK VAR INJECTION */(function(module) {//! moment.js\n//! version : 2.13.0\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n true ? module.exports = factory() :\n undefined\n}(this, function () { 'use strict';\n\n var hookCallback;\n\n function utils_hooks__hooks () {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback (callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function create_utc__createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n function valid__isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n m._isValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n m._isValid = m._isValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n }\n return m._isValid;\n }\n\n function valid__createInvalid (flags) {\n var m = create_utc__createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n // Plugins that add properties should also add the key here (null value),\n // so we can properly clone ourselves.\n var momentProperties = utils_hooks__hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i in momentProperties) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false;\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n utils_hooks__hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n }\n\n function absFloor (number) {\n if (number < 0) {\n return Math.ceil(number);\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n // compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (utils_hooks__hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (utils_hooks__hooks.deprecationHandler != null) {\n utils_hooks__hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (utils_hooks__hooks.deprecationHandler != null) {\n utils_hooks__hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n utils_hooks__hooks.suppressDeprecationWarnings = false;\n utils_hooks__hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function isObject(input) {\n return Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function locale_set__set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _ordinalParseLenient.\n this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\\d{1,2}/).source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n // internal storage for locale config files\n var locales = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }\n\n function loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n __webpack_require__(\"./node_modules/handsontable/node_modules/moment/locale sync recursive ^\\\\.\\\\/.*$\")(\"./\" + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n locale_locales__getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function locale_locales__getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = locale_locales__getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale (name, config) {\n if (config !== null) {\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale');\n config = mergeConfigs(locales[name]._config, config);\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n config = mergeConfigs(locales[config.parentLocale]._config, config);\n } else {\n // treat as if there is no base config\n deprecateSimple('parentLocaleUndefined',\n 'specified parentLocale is not defined yet');\n }\n }\n locales[name] = new Locale(config);\n\n // backwards compat for now: also set the locale\n locale_locales__getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale;\n if (locales[name] != null) {\n config = mergeConfigs(locales[name]._config, config);\n }\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n locale_locales__getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n // returns locale data\n function locale_locales__getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function locale_locales__listLocales() {\n return keys(locales);\n }\n\n var aliases = {};\n\n function addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n function makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n get_set__set(this, unit, value);\n utils_hooks__hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get_set__get(this, unit);\n }\n };\n }\n\n function get_set__get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function get_set__set (mom, unit, value) {\n if (mom.isValid()) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n\n // MOMENTS\n\n function getSet (units, value) {\n var unit;\n if (typeof units === 'object') {\n for (unit in units) {\n this.set(unit, units[unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n var formatFunctions = {};\n\n var formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n var match2 = /\\d\\d/; // 00 - 99\n var match3 = /\\d{3}/; // 000 - 999\n var match4 = /\\d{4}/; // 0000 - 9999\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n var match1to2 = /\\d\\d?/; // 0 - 99\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n var match1to3 = /\\d{1,3}/; // 0 - 999\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n // any word (or two) characters or numbers including two/three word month in arabic.\n // includes scottish gaelic two word and hyphenated months\n var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n\n var regexes = {};\n\n function addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (typeof callback === 'number') {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8;\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n function daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s+)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n function localeMonths (m, format) {\n return isArray(this._months) ? this._months[m.month()] :\n this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n function localeMonthsShort (m, format) {\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function units_month__handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = create_utc__createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return units_month__handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = create_utc__createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (typeof value !== 'number') {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n utils_hooks__hooks.updateOffset(this, true);\n return this;\n } else {\n return get_set__get(this, 'Month');\n }\n }\n\n function getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n function monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n function monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = create_utc__createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n function checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n // iso 8601 regex\n // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?/;\n var basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?/;\n\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\n var isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n ];\n\n // iso time formats and regexes\n var isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n ];\n\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n // date from iso format\n function configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n // date from iso format or fallback\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n utils_hooks__hooks.createFromInputFallback(config);\n }\n }\n\n utils_hooks__hooks.createFromInputFallback = deprecate(\n 'moment construction falls back to js Date. This is ' +\n 'discouraged and will be removed in upcoming major ' +\n 'release. Please refer to ' +\n 'https://github.com/moment/moment/issues/1407 for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n function createDate (y, m, d, h, M, s, ms) {\n //can't just apply() to create a date:\n //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n var date = new Date(y, m, d, h, M, s, ms);\n\n //the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n return date;\n }\n\n function createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n\n //the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n return date;\n }\n\n // FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n // HOOKS\n\n utils_hooks__hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear () {\n return isLeapYear(this.year());\n }\n\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(utils_hooks__hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);\n week = defaults(w.w, 1);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n // constant that refers to the ISO standard\n utils_hooks__hooks.ISO_8601 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === utils_hooks__hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (getParsingFlags(config).bigHour === true &&\n config._a[HOUR] <= 12 &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n\n function meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n // date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!valid__isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n }\n\n function createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || locale_locales__getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return valid__createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else if (isDate(input)) {\n config._d = input;\n } else {\n configFromInput(config);\n }\n\n if (!valid__isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (input === undefined) {\n config._d = new Date(utils_hooks__hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (typeof(input) === 'object') {\n configFromObject(config);\n } else if (typeof(input) === 'number') {\n // from milliseconds\n config._d = new Date(input);\n } else {\n utils_hooks__hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (typeof(locale) === 'boolean') {\n strict = locale;\n locale = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function local__createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',\n function () {\n var other = local__createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return valid__createInvalid();\n }\n }\n );\n\n var prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',\n function () {\n var other = local__createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return valid__createInvalid();\n }\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return local__createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +(new Date());\n };\n\n function Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = locale_locales__getLocale();\n\n this._bubble();\n }\n\n function isDuration (obj) {\n return obj instanceof Duration;\n }\n\n // FORMATTING\n\n function offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = ((string || '').match(matcher) || []);\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n }\n\n function getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n utils_hooks__hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset () {\n if (this._tzm) {\n this.utcOffset(this._tzm);\n } else if (typeof this._i === 'string') {\n this.utcOffset(offsetFromString(matchOffset, this._i));\n }\n return this;\n }\n\n function hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? local__createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal () {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n // ASP.NET json date format regex\n var aspNetRegex = /^(\\-)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?\\d*)?$/;\n\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n // and further modified to allow for strings containing both week and day\n var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;\n\n function create__createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (typeof input === 'number') {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(match[MILLISECOND]) * sign\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n create__createDuration.fn = Duration.prototype;\n\n function parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n function absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n // TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = create__createDuration(val, period);\n add_subtract__addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (days) {\n get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n utils_hooks__hooks.updateOffset(mom, days || months);\n }\n }\n\n var add_subtract__add = createAdder(1, 'add');\n var add_subtract__subtract = createAdder(-1, 'subtract');\n\n function moment_calendar__calendar (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || local__createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n diff = this.diff(sod, 'days', true),\n format = diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));\n }\n\n function clone () {\n return new Moment(this);\n }\n\n function isAfter (input, units) {\n var localInput = isMoment(input) ? input : local__createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore (input, units) {\n var localInput = isMoment(input) ? input : local__createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween (from, to, units, inclusivity) {\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));\n }\n\n function isSame (input, units) {\n var localInput = isMoment(input) ? input : local__createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input,units);\n }\n\n function isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input,units);\n }\n\n function diff (input, units, asFloat) {\n var that,\n zoneDelta,\n delta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function moment_format__toISOString () {\n var m = this.clone().utc();\n if (0 < m.year() && m.year() <= 9999) {\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n } else {\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n } else {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n }\n\n function format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n local__createLocal(time).isValid())) {\n return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow (withoutSuffix) {\n return this.from(local__createLocal(), withoutSuffix);\n }\n\n function to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n local__createLocal(time).isValid())) {\n return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow (withoutSuffix) {\n return this.to(local__createLocal(), withoutSuffix);\n }\n\n // If passed a locale key, it will set the locale for this\n // instance. Otherwise, it will return the locale configuration\n // variables for this instance.\n function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = locale_locales__getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData () {\n return this._locale;\n }\n\n function startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n /* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n /* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n this.hours(0);\n /* falls through */\n case 'hour':\n this.minutes(0);\n /* falls through */\n case 'minute':\n this.seconds(0);\n /* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n }\n\n function endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n\n // 'date' is an alias for 'day', so it should be considered as such.\n if (units === 'date') {\n units = 'day';\n }\n\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n }\n\n function to_type__valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n }\n\n function unix () {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate () {\n return this._offset ? new Date(this.valueOf()) : this._d;\n }\n\n function toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function moment_valid__isValid () {\n return valid__isValid(this);\n }\n\n function parsingFlags () {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt () {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n\n // FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = utils_hooks__hooks.parseTwoDigitYear(input);\n });\n\n // MOMENTS\n\n function getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n // FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n // FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // LOCALES\n\n function localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n };\n\n function localeFirstDayOfWeek () {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear () {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n // FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n // FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n // LOCALES\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n function localeWeekdays (m, format) {\n return isArray(this._weekdays) ? this._weekdays[m.day()] :\n this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n function localeWeekdaysShort (m) {\n return this._weekdaysShort[m.day()];\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n function localeWeekdaysMin (m) {\n return this._weekdaysMin[m.day()];\n }\n\n function day_of_week__handleStrictParse(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = create_utc__createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = create_utc__createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);\n }\n\n var defaultWeekdaysRegex = matchWord;\n function weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n function weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n function weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n\n function computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = create_utc__createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n // FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n // MOMENTS\n\n function getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n }\n\n // FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n function meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PARSING\n\n function matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n // LOCALES\n\n function localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n function localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n\n // MOMENTS\n\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour he wants. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n var getSetHour = makeGetSet('Hours', true);\n\n // FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n // FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n // FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n // MOMENTS\n\n var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n // FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var momentPrototype__proto = Moment.prototype;\n\n momentPrototype__proto.add = add_subtract__add;\n momentPrototype__proto.calendar = moment_calendar__calendar;\n momentPrototype__proto.clone = clone;\n momentPrototype__proto.diff = diff;\n momentPrototype__proto.endOf = endOf;\n momentPrototype__proto.format = format;\n momentPrototype__proto.from = from;\n momentPrototype__proto.fromNow = fromNow;\n momentPrototype__proto.to = to;\n momentPrototype__proto.toNow = toNow;\n momentPrototype__proto.get = getSet;\n momentPrototype__proto.invalidAt = invalidAt;\n momentPrototype__proto.isAfter = isAfter;\n momentPrototype__proto.isBefore = isBefore;\n momentPrototype__proto.isBetween = isBetween;\n momentPrototype__proto.isSame = isSame;\n momentPrototype__proto.isSameOrAfter = isSameOrAfter;\n momentPrototype__proto.isSameOrBefore = isSameOrBefore;\n momentPrototype__proto.isValid = moment_valid__isValid;\n momentPrototype__proto.lang = lang;\n momentPrototype__proto.locale = locale;\n momentPrototype__proto.localeData = localeData;\n momentPrototype__proto.max = prototypeMax;\n momentPrototype__proto.min = prototypeMin;\n momentPrototype__proto.parsingFlags = parsingFlags;\n momentPrototype__proto.set = getSet;\n momentPrototype__proto.startOf = startOf;\n momentPrototype__proto.subtract = add_subtract__subtract;\n momentPrototype__proto.toArray = toArray;\n momentPrototype__proto.toObject = toObject;\n momentPrototype__proto.toDate = toDate;\n momentPrototype__proto.toISOString = moment_format__toISOString;\n momentPrototype__proto.toJSON = toJSON;\n momentPrototype__proto.toString = toString;\n momentPrototype__proto.unix = unix;\n momentPrototype__proto.valueOf = to_type__valueOf;\n momentPrototype__proto.creationData = creationData;\n\n // Year\n momentPrototype__proto.year = getSetYear;\n momentPrototype__proto.isLeapYear = getIsLeapYear;\n\n // Week Year\n momentPrototype__proto.weekYear = getSetWeekYear;\n momentPrototype__proto.isoWeekYear = getSetISOWeekYear;\n\n // Quarter\n momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;\n\n // Month\n momentPrototype__proto.month = getSetMonth;\n momentPrototype__proto.daysInMonth = getDaysInMonth;\n\n // Week\n momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;\n momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;\n momentPrototype__proto.weeksInYear = getWeeksInYear;\n momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;\n\n // Day\n momentPrototype__proto.date = getSetDayOfMonth;\n momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;\n momentPrototype__proto.weekday = getSetLocaleDayOfWeek;\n momentPrototype__proto.isoWeekday = getSetISODayOfWeek;\n momentPrototype__proto.dayOfYear = getSetDayOfYear;\n\n // Hour\n momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;\n\n // Minute\n momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;\n\n // Second\n momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;\n\n // Millisecond\n momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;\n\n // Offset\n momentPrototype__proto.utcOffset = getSetOffset;\n momentPrototype__proto.utc = setOffsetToUTC;\n momentPrototype__proto.local = setOffsetToLocal;\n momentPrototype__proto.parseZone = setOffsetToParsedOffset;\n momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;\n momentPrototype__proto.isDST = isDaylightSavingTime;\n momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;\n momentPrototype__proto.isLocal = isLocal;\n momentPrototype__proto.isUtcOffset = isUtcOffset;\n momentPrototype__proto.isUtc = isUtc;\n momentPrototype__proto.isUTC = isUtc;\n\n // Timezone\n momentPrototype__proto.zoneAbbr = getZoneAbbr;\n momentPrototype__proto.zoneName = getZoneName;\n\n // Deprecations\n momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);\n\n var momentPrototype = momentPrototype__proto;\n\n function moment__createUnix (input) {\n return local__createLocal(input * 1000);\n }\n\n function moment__createInZone () {\n return local__createLocal.apply(null, arguments).parseZone();\n }\n\n var defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n };\n\n function locale_calendar__calendar (key, mom, now) {\n var output = this._calendar[key];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate () {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultOrdinalParse = /\\d{1,2}/;\n\n function ordinal (number) {\n return this._ordinal.replace('%d', number);\n }\n\n function preParsePostFormat (string) {\n return string;\n }\n\n var defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n };\n\n function relative__relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n }\n\n function pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var prototype__proto = Locale.prototype;\n\n prototype__proto._calendar = defaultCalendar;\n prototype__proto.calendar = locale_calendar__calendar;\n prototype__proto._longDateFormat = defaultLongDateFormat;\n prototype__proto.longDateFormat = longDateFormat;\n prototype__proto._invalidDate = defaultInvalidDate;\n prototype__proto.invalidDate = invalidDate;\n prototype__proto._ordinal = defaultOrdinal;\n prototype__proto.ordinal = ordinal;\n prototype__proto._ordinalParse = defaultOrdinalParse;\n prototype__proto.preparse = preParsePostFormat;\n prototype__proto.postformat = preParsePostFormat;\n prototype__proto._relativeTime = defaultRelativeTime;\n prototype__proto.relativeTime = relative__relativeTime;\n prototype__proto.pastFuture = pastFuture;\n prototype__proto.set = locale_set__set;\n\n // Month\n prototype__proto.months = localeMonths;\n prototype__proto._months = defaultLocaleMonths;\n prototype__proto.monthsShort = localeMonthsShort;\n prototype__proto._monthsShort = defaultLocaleMonthsShort;\n prototype__proto.monthsParse = localeMonthsParse;\n prototype__proto._monthsRegex = defaultMonthsRegex;\n prototype__proto.monthsRegex = monthsRegex;\n prototype__proto._monthsShortRegex = defaultMonthsShortRegex;\n prototype__proto.monthsShortRegex = monthsShortRegex;\n\n // Week\n prototype__proto.week = localeWeek;\n prototype__proto._week = defaultLocaleWeek;\n prototype__proto.firstDayOfYear = localeFirstDayOfYear;\n prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;\n\n // Day of Week\n prototype__proto.weekdays = localeWeekdays;\n prototype__proto._weekdays = defaultLocaleWeekdays;\n prototype__proto.weekdaysMin = localeWeekdaysMin;\n prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;\n prototype__proto.weekdaysShort = localeWeekdaysShort;\n prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;\n prototype__proto.weekdaysParse = localeWeekdaysParse;\n\n prototype__proto._weekdaysRegex = defaultWeekdaysRegex;\n prototype__proto.weekdaysRegex = weekdaysRegex;\n prototype__proto._weekdaysShortRegex = defaultWeekdaysShortRegex;\n prototype__proto.weekdaysShortRegex = weekdaysShortRegex;\n prototype__proto._weekdaysMinRegex = defaultWeekdaysMinRegex;\n prototype__proto.weekdaysMinRegex = weekdaysMinRegex;\n\n // Hours\n prototype__proto.isPM = localeIsPM;\n prototype__proto._meridiemParse = defaultLocaleMeridiemParse;\n prototype__proto.meridiem = localeMeridiem;\n\n function lists__get (format, index, field, setter) {\n var locale = locale_locales__getLocale();\n var utc = create_utc__createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl (format, index, field) {\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return lists__get(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = lists__get(format, i, field, 'month');\n }\n return out;\n }\n\n // ()\n // (5)\n // (fmt, 5)\n // (fmt)\n // (true)\n // (true, 5)\n // (true, fmt, 5)\n // (true, fmt)\n function listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = locale_locales__getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return lists__get(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = lists__get(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function lists__listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function lists__listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function lists__listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function lists__listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function lists__listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n locale_locales__getSetGlobalLocale('en', {\n ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n // Side effect imports\n utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);\n utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);\n\n var mathAbs = Math.abs;\n\n function duration_abs__abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function duration_add_subtract__addSubtract (duration, input, value, direction) {\n var other = create__createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }\n\n function absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as (units) {\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function duration_as__valueOf () {\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asYears = makeAs('y');\n\n function duration_get__get (units) {\n units = normalizeUnits(units);\n return this[units + 's']();\n }\n\n function makeGetter(name) {\n return function () {\n return this._data[name];\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks () {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month\n M: 11 // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {\n var duration = create__createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds < thresholds.s && ['s', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set a threshold for relative time strings\n function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n return true;\n }\n\n function humanize (withSuffix) {\n var locale = this.localeData();\n var output = duration_humanize__relativeTime(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var iso_string__abs = Math.abs;\n\n function iso_string__toISOString() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n var seconds = iso_string__abs(this._milliseconds) / 1000;\n var days = iso_string__abs(this._days);\n var months = iso_string__abs(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n }\n\n var duration_prototype__proto = Duration.prototype;\n\n duration_prototype__proto.abs = duration_abs__abs;\n duration_prototype__proto.add = duration_add_subtract__add;\n duration_prototype__proto.subtract = duration_add_subtract__subtract;\n duration_prototype__proto.as = as;\n duration_prototype__proto.asMilliseconds = asMilliseconds;\n duration_prototype__proto.asSeconds = asSeconds;\n duration_prototype__proto.asMinutes = asMinutes;\n duration_prototype__proto.asHours = asHours;\n duration_prototype__proto.asDays = asDays;\n duration_prototype__proto.asWeeks = asWeeks;\n duration_prototype__proto.asMonths = asMonths;\n duration_prototype__proto.asYears = asYears;\n duration_prototype__proto.valueOf = duration_as__valueOf;\n duration_prototype__proto._bubble = bubble;\n duration_prototype__proto.get = duration_get__get;\n duration_prototype__proto.milliseconds = milliseconds;\n duration_prototype__proto.seconds = seconds;\n duration_prototype__proto.minutes = minutes;\n duration_prototype__proto.hours = hours;\n duration_prototype__proto.days = days;\n duration_prototype__proto.weeks = weeks;\n duration_prototype__proto.months = months;\n duration_prototype__proto.years = years;\n duration_prototype__proto.humanize = humanize;\n duration_prototype__proto.toISOString = iso_string__toISOString;\n duration_prototype__proto.toString = iso_string__toISOString;\n duration_prototype__proto.toJSON = iso_string__toISOString;\n duration_prototype__proto.locale = locale;\n duration_prototype__proto.localeData = localeData;\n\n // Deprecations\n duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);\n duration_prototype__proto.lang = lang;\n\n // Side effect imports\n\n // FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n // Side effect imports\n\n\n utils_hooks__hooks.version = '2.13.0';\n\n setHookCallback(local__createLocal);\n\n utils_hooks__hooks.fn = momentPrototype;\n utils_hooks__hooks.min = min;\n utils_hooks__hooks.max = max;\n utils_hooks__hooks.now = now;\n utils_hooks__hooks.utc = create_utc__createUTC;\n utils_hooks__hooks.unix = moment__createUnix;\n utils_hooks__hooks.months = lists__listMonths;\n utils_hooks__hooks.isDate = isDate;\n utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;\n utils_hooks__hooks.invalid = valid__createInvalid;\n utils_hooks__hooks.duration = create__createDuration;\n utils_hooks__hooks.isMoment = isMoment;\n utils_hooks__hooks.weekdays = lists__listWeekdays;\n utils_hooks__hooks.parseZone = moment__createInZone;\n utils_hooks__hooks.localeData = locale_locales__getLocale;\n utils_hooks__hooks.isDuration = isDuration;\n utils_hooks__hooks.monthsShort = lists__listMonthsShort;\n utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;\n utils_hooks__hooks.defineLocale = defineLocale;\n utils_hooks__hooks.updateLocale = updateLocale;\n utils_hooks__hooks.locales = locale_locales__listLocales;\n utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;\n utils_hooks__hooks.normalizeUnits = normalizeUnits;\n utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;\n utils_hooks__hooks.prototype = momentPrototype;\n\n var _moment = utils_hooks__hooks;\n\n return _moment;\n\n}));\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/handsontable/node_modules/moment/moment.js?");
/***/ })
}]);