` element used as as placeholder to trigger screen alerts.\r\n *\r\n * @sunce 4.9.2\r\n * @return Element\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._readerAlertElement)) {\r\n // Create element\r\n var div = document.createElement(\"div\");\r\n div.setAttribute(\"role\", \"alert\");\r\n div.style.zIndex = \"-100000\";\r\n div.style.opacity = \"0\";\r\n div.style.position = \"absolute\";\r\n div.style.top = \"0\";\r\n this.SVGContainer.appendChild(div);\r\n this._readerAlertElement = div;\r\n }\r\n return this._readerAlertElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Triggers screen reader read out a message.\r\n *\r\n * @since 4.9.2\r\n * @param text Alert text\r\n */\r\n SVGContainer.prototype.readerAlert = function (text) {\r\n this.readerAlertElement.innerHTML = text;\r\n };\r\n /**\r\n * ==========================================================================\r\n * OTHER STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n SVGContainer.prototype.checkTransform = function (div) {\r\n if (window.getComputedStyle) {\r\n if (div && div.style) {\r\n var style = window.getComputedStyle(div, null);\r\n if (style) {\r\n var matrix = style.getPropertyValue(\"-webkit-transform\") ||\r\n style.getPropertyValue(\"-moz-transform\") ||\r\n style.getPropertyValue(\"-ms-transform\") ||\r\n style.getPropertyValue(\"-o-transform\") ||\r\n style.getPropertyValue(\"transform\");\r\n if (matrix && matrix !== \"none\") {\r\n var values = matrix.split('(')[1].split(')')[0].split(',');\r\n var a = Number(values[0]);\r\n var b = Number(values[1]);\r\n var scale = Math.sqrt(a * a + b * b);\r\n if (!isNaN(scale)) {\r\n this.cssScale *= scale;\r\n }\r\n }\r\n }\r\n }\r\n if (div.parentNode && div.parentNode instanceof HTMLElement) {\r\n this.checkTransform(div.parentNode);\r\n }\r\n }\r\n };\r\n return SVGContainer;\r\n}());\r\nexport { SVGContainer };\r\n//# sourceMappingURL=SVGContainer.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"./Path\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Tension = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n */\r\n function Tension(tensionX, tensionY) {\r\n this._tensionX = tensionX;\r\n this._tensionY = tensionY;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Tension.prototype.smooth = function (points) {\r\n for (var i = points.length - 1; i > 0; i--) {\r\n var p0 = points[i];\r\n var p1 = points[i - 1];\r\n if (Math.abs(p0.x - p1.x) < 0.1 && Math.abs(p0.y - p1.y) < 0.1) {\r\n points.splice(i - 1, 1);\r\n }\r\n }\r\n var tensionX = this._tensionX;\r\n var tensionY = this._tensionY;\r\n if (points.length < 3 || (tensionX >= 1 && tensionY >= 1)) {\r\n return $path.polyline(points);\r\n }\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed = true;\r\n }\r\n // Can't moveTo here, as it wont be possible to have fill then.\r\n var path = \"\";\r\n for (var i = 0, len = points.length - 1; i < len; i++) {\r\n var p0 = points[i - 1];\r\n var p1 = points[i];\r\n var p2 = points[i + 1];\r\n var p3 = points[i + 2];\r\n if (i === 0) {\r\n if (closed) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (i == points.length - 2) {\r\n if (closed) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[i + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n }\r\n return path;\r\n };\r\n return Tension;\r\n}());\r\nexport { Tension };\r\n/**\r\n * Returns a waved line SVG path between two points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point1 Starting point\r\n * @param point2 Ending point\r\n * @param waveLength Wave length\r\n * @param waveHeight Wave height\r\n * @param adjustWaveLength Adjust wave length based on the actual line length\r\n * @return SVG path\r\n */\r\nexport function wavedLine(point1, point2, waveLength, waveHeight, tension, adjustWaveLength) {\r\n var x1 = point1.x;\r\n var y1 = point1.y;\r\n var x2 = point2.x;\r\n var y2 = point2.y;\r\n var distance = $math.getDistance(point1, point2);\r\n if (adjustWaveLength) {\r\n waveLength = distance / Math.round(distance / waveLength);\r\n }\r\n var d = registry.getCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]));\r\n if (!d) {\r\n if (distance > 0) {\r\n var angle = Math.atan2(y2 - y1, x2 - x1);\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var waveLengthX = waveLength * cos;\r\n var waveLengthY = waveLength * sin;\r\n if (waveLength <= 1 || waveHeight <= 1) {\r\n d = $path.lineTo(point2);\r\n }\r\n else {\r\n var halfWaveCount = Math.round(2 * distance / waveLength);\r\n var points = [];\r\n var sign_1 = 1;\r\n if (x2 < x1) {\r\n sign_1 *= -1;\r\n }\r\n if (y2 < y1) {\r\n sign_1 *= -1;\r\n }\r\n for (var i = 0; i <= halfWaveCount; i++) {\r\n sign_1 *= -1;\r\n var x = x1 + i * waveLengthX / 2 + sign_1 * waveHeight / 2 * sin;\r\n var y = y1 + i * waveLengthY / 2 - sign_1 * waveHeight / 2 * cos;\r\n points.push({ x: x, y: y });\r\n }\r\n d = new Tension(tension, tension).smooth(points);\r\n }\r\n }\r\n else {\r\n d = \"\";\r\n }\r\n registry.setCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]), d);\r\n }\r\n return d;\r\n}\r\nvar Monotone = /** @class */ (function () {\r\n function Monotone(reversed, info) {\r\n this._reversed = reversed;\r\n this._closed = info.closed;\r\n }\r\n // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\r\n // \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\r\n // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\r\n Monotone.prototype._curve = function (x0, x1, y0, y1, t0, t1) {\r\n var dx = (x1 - x0) / 3;\r\n if (this._reversed) {\r\n return $path.cubicCurveTo({ x: y1, y: x1 }, { x: y0 + dx * t0, y: x0 + dx }, { x: y1 - dx * t1, y: x1 - dx });\r\n }\r\n else {\r\n return $path.cubicCurveTo({ x: x1, y: y1 }, { x: x0 + dx, y: y0 + dx * t0 }, { x: x1 - dx, y: y1 - dx * t1 });\r\n }\r\n };\r\n Monotone.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var t0 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n $array.each(points, function (_a) {\r\n var x = _a.x, y = _a.y;\r\n if (_this._reversed) {\r\n var temp = x;\r\n x = y;\r\n y = temp;\r\n }\r\n var t1 = NaN;\r\n if (!(x === x1 && y === y1)) {\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._reversed) {\r\n output += $path.lineTo({ x: y, y: x });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n break;\r\n case 2:\r\n point = 3;\r\n output += _this._curve(x0, x1, y0, y1, slope2(x0, x1, y0, y1, t1 = slope3(x0, x1, y0, y1, x, y)), t1);\r\n break;\r\n default:\r\n output += _this._curve(x0, x1, y0, y1, t0, t1 = slope3(x0, x1, y0, y1, x, y));\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n t0 = t1;\r\n }\r\n });\r\n switch (point) {\r\n case 2:\r\n if (this._reversed) {\r\n output += $path.lineTo({ x: y1, y: x1 });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n }\r\n break;\r\n case 3:\r\n output += this._curve(x0, x1, y0, y1, t0, slope2(x0, x1, y0, y1, t0));\r\n break;\r\n }\r\n if (this._closed) {\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Monotone;\r\n}());\r\nexport { Monotone };\r\n// TODO move this someplace else\r\nfunction sign(x) {\r\n return x < 0 ? -1 : 1;\r\n}\r\nfunction slope2(x0, x1, y0, y1, t) {\r\n var h = x1 - x0;\r\n return h ? (3 * (y1 - y0) / h - t) / 2 : t;\r\n}\r\nfunction slope3(x0, x1, y0, y1, x2, y2) {\r\n var h0 = x1 - x0;\r\n var h1 = x2 - x1;\r\n var s0 = (y1 - y0) / (h0 || h1 < 0 && -0);\r\n var s1 = (y2 - y1) / (h1 || h0 < 0 && -0);\r\n var p = (s0 * h1 + s1 * h0) / (h0 + h1);\r\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\r\n}\r\nvar MonotoneX = /** @class */ (function (_super) {\r\n __extends(MonotoneX, _super);\r\n function MonotoneX(info) {\r\n return _super.call(this, false, info) || this;\r\n }\r\n return MonotoneX;\r\n}(Monotone));\r\nexport { MonotoneX };\r\nvar MonotoneY = /** @class */ (function (_super) {\r\n __extends(MonotoneY, _super);\r\n function MonotoneY(info) {\r\n return _super.call(this, true, info) || this;\r\n }\r\n return MonotoneY;\r\n}(Monotone));\r\nexport { MonotoneY };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Basis = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param info [description]\r\n */\r\n function Basis(info) {\r\n this._closed = info.closed;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Basis.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var x2 = NaN;\r\n var x3 = NaN;\r\n var x4 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var y2 = NaN;\r\n var y3 = NaN;\r\n var y4 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n var pushCurve = function (x, y) {\r\n output += $path.cubicCurveTo({\r\n x: (x0 + 4 * x1 + x) / 6,\r\n y: (y0 + 4 * y1 + y) / 6\r\n }, {\r\n x: (2 * x0 + x1) / 3,\r\n y: (2 * y0 + y1) / 3\r\n }, {\r\n x: (x0 + 2 * x1) / 3,\r\n y: (y0 + 2 * y1) / 3\r\n });\r\n };\r\n var pushPoint = function (_a) {\r\n var x = _a.x, y = _a.y;\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._closed) {\r\n x2 = x;\r\n y2 = y;\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n if (_this._closed) {\r\n x3 = x;\r\n y3 = y;\r\n }\r\n break;\r\n case 2:\r\n point = 3;\r\n if (_this._closed) {\r\n x4 = x;\r\n y4 = y;\r\n output += $path.moveTo({ x: (x0 + 4 * x1 + x) / 6, y: (y0 + 4 * y1 + y) / 6 });\r\n break;\r\n }\r\n else {\r\n output += $path.lineTo({ x: (5 * x0 + x1) / 6, y: (5 * y0 + y1) / 6 });\r\n // fall-through\r\n }\r\n default:\r\n pushCurve(x, y);\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n };\r\n $array.each(points, pushPoint);\r\n if (this._closed) {\r\n switch (point) {\r\n case 1:\r\n output += $path.moveTo({ x: x2, y: y2 });\r\n output += $path.closePath();\r\n break;\r\n case 2:\r\n output += $path.moveTo({ x: (x2 + 2 * x3) / 3, y: (y2 + 2 * y3) / 3 });\r\n output += $path.lineTo({ x: (x3 + 2 * x2) / 3, y: (y3 + 2 * y2) / 3 });\r\n output += $path.closePath();\r\n break;\r\n case 3:\r\n pushPoint({ x: x2, y: y2 });\r\n pushPoint({ x: x3, y: y3 });\r\n pushPoint({ x: x4, y: y4 });\r\n break;\r\n }\r\n }\r\n else {\r\n switch (point) {\r\n case 3:\r\n pushCurve(x1, y1);\r\n // fall-through\r\n case 2:\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n break;\r\n }\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Basis;\r\n}());\r\nexport { Basis };\r\n//# sourceMappingURL=Smoothing.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Circular pattern\r\n */\r\nvar CirclePattern = /** @class */ (function (_super) {\r\n __extends(CirclePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CirclePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"radius\"] = 2;\r\n _this._circle = _this.paper.add(\"circle\");\r\n _this.addElement(_this._circle);\r\n _this.shapeRendering = \"auto\";\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle element.\r\n */\r\n CirclePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this._circle) {\r\n this._circle.attr({ \"r\": this.radius, \"cx\": this.width / 2, \"cy\": this.height / 2 });\r\n }\r\n };\r\n Object.defineProperty(CirclePattern.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.properties[\"radius\"];\r\n },\r\n /**\r\n * Circle radius in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"radius\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return CirclePattern;\r\n}(Pattern));\r\nexport { CirclePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CirclePattern\"] = CirclePattern;\r\n//# sourceMappingURL=CirclePattern.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ColorModifier = /** @class */ (function (_super) {\r\n __extends(ColorModifier, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Modifies color value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Original color\r\n * @return Modified\r\n */\r\n ColorModifier.prototype.modify = function (value) {\r\n return value;\r\n };\r\n return ColorModifier;\r\n}(BaseObject));\r\nexport { ColorModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorModifier\"] = ColorModifier;\r\n//# sourceMappingURL=ColorModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColorModifier } from \"./ColorModifier\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"GradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar GradientModifier = /** @class */ (function (_super) {\r\n __extends(GradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function GradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.lightnesses = [];\r\n _this.brightnesses = [];\r\n _this.opacities = [];\r\n _this.offsets = [];\r\n _this.className = \"GradientModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(GradientModifier.prototype, \"lightnesses\", {\r\n /**\r\n * @return Lightness values\r\n */\r\n get: function () {\r\n return this._lightnesses;\r\n },\r\n /**\r\n * An array of lightness values for each step.\r\n *\r\n * @param value Lightness values\r\n */\r\n set: function (value) {\r\n this._lightnesses = value;\r\n this._brightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"brightnesses\", {\r\n /**\r\n * @return Brightness values\r\n */\r\n get: function () {\r\n return this._brightnesses;\r\n },\r\n /**\r\n * An array of brightness values for each step.\r\n *\r\n * @param value Brightness values\r\n */\r\n set: function (value) {\r\n this._brightnesses = value;\r\n this._lightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"opacities\", {\r\n /**\r\n * @return Opacity values\r\n */\r\n get: function () {\r\n return this._opacities;\r\n },\r\n /**\r\n * An array of opacity values for each step.\r\n *\r\n * @param value Opacity values\r\n */\r\n set: function (value) {\r\n this._opacities = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"offsets\", {\r\n /**\r\n * @return Offsets\r\n */\r\n get: function () {\r\n return this._offsets;\r\n },\r\n /**\r\n * An array of relative position (0-1) for each step.\r\n *\r\n * If not set, all steps will be of equal relative length.\r\n *\r\n * @param value Offsets\r\n */\r\n set: function (value) {\r\n this._offsets = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Modifies the color based on step setting.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Source color\r\n * @return A gradient that matches set modification rules\r\n */\r\n GradientModifier.prototype.modify = function (value) {\r\n // Clear current gradient\r\n this.gradient.clear();\r\n // Get step count\r\n var count = 0;\r\n if (this.opacities) {\r\n count = $math.max(count, this.opacities.length);\r\n }\r\n if (this.lightnesses) {\r\n count = $math.max(count, this.lightnesses.length);\r\n }\r\n if (this.brightnesses) {\r\n count = $math.max(count, this.brightnesses.length);\r\n }\r\n // Init step values\r\n var opacity = 1, lightness, brightness;\r\n // Apply steps\r\n for (var i = 0; i < count; i++) {\r\n // Take base color\r\n var color = value;\r\n // Check if there are any parameters for this step\r\n if (this.opacities && $type.isNumber(this.opacities[i])) {\r\n opacity = this.opacities[i];\r\n }\r\n if (this.lightnesses && $type.isNumber(this.lightnesses[i])) {\r\n lightness = this.lightnesses[i];\r\n brightness = undefined;\r\n }\r\n if (this.brightnesses && $type.isNumber(this.brightnesses[i])) {\r\n brightness = this.brightnesses[i];\r\n lightness = undefined;\r\n }\r\n // Check if we need to brighten/lighten color\r\n if ($type.isNumber(brightness)) {\r\n color = value.brighten(this.brightnesses[i]);\r\n }\r\n else if ($type.isNumber(lightness)) {\r\n color = value.lighten(this.lightnesses[i]);\r\n }\r\n // Get offset (it's OK if it's undefined)\r\n var offset = this.offsets[i];\r\n // Apply step\r\n this.gradient.addColor(color, opacity, offset);\r\n }\r\n return this.gradient;\r\n };\r\n GradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this._offsets = source.offsets;\r\n this._brightnesses = source.brightnesses;\r\n this._lightnesses = source.lightnesses;\r\n this._opacities = source.opacities;\r\n };\r\n return GradientModifier;\r\n}(ColorModifier));\r\nexport { GradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GradientModifier\"] = GradientModifier;\r\n//# sourceMappingURL=GradientModifier.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $path from \"../../rendering/Path\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Line pattern.\r\n */\r\nvar LinePattern = /** @class */ (function (_super) {\r\n __extends(LinePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LinePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"gap\"] = 0;\r\n _this._line = _this.paper.add(\"path\");\r\n _this.addElement(_this._line);\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n LinePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n this.properties[\"shapeRendering\"] = \"auto\";\r\n }\r\n if (this._line) {\r\n var w = this.width;\r\n var h = this.height;\r\n var path = \"\";\r\n if (!this.gap) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path = $path.moveTo({ x: -w, y: h / 2 }) + $path.lineTo({ x: w * 2, y: h / 2 });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n }\r\n }\r\n else {\r\n var step = this.gap + this.strokeWidth;\r\n var count = this.height / step;\r\n for (var i = -count / 2; i < count * 1.5; i++) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path += $path.moveTo({ x: -w, y: (i + 0.5) * step }) + $path.lineTo({ x: w * 2, y: (i + 0.5) * step });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path += $path.moveTo({ x: -w, y: i * step }) + $path.lineTo({ x: w * 2, y: i * step });\r\n }\r\n }\r\n }\r\n this._line.attr({ \"d\": path });\r\n }\r\n };\r\n Object.defineProperty(LinePattern.prototype, \"gap\", {\r\n /**\r\n * @return gap\r\n */\r\n get: function () {\r\n return this.properties[\"gap\"];\r\n },\r\n /**\r\n * Number of pixels between pattern lines.\r\n *\r\n * The pattern will automatically draw required number of lines to fill\r\n * pattern area maintaining `gap` distance between them.\r\n *\r\n * 0 (zero) means only single line will be drawn.\r\n *\r\n * @default 0\r\n * @since 4.7.7\r\n */\r\n set: function (value) {\r\n this.properties[\"gap\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinePattern;\r\n}(Pattern));\r\nexport { LinePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinePattern\"] = LinePattern;\r\n//# sourceMappingURL=LinePattern.js.map","/**\r\n * Contains code and logic for generating linear gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Linear gradient class.\r\n */\r\nvar LinearGradient = /** @class */ (function (_super) {\r\n __extends(LinearGradient, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradient() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n /**\r\n * Gradient direction.\r\n */\r\n _this._rotation = 0;\r\n _this.className = \"LinearGradient\";\r\n _this._stops.events.on(\"setIndex\", _this.validate, _this);\r\n _this._stops.events.on(\"inserted\", _this.validate, _this);\r\n // Create element\r\n _this.element = _this.paper.addGroup(\"linearGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.validate = function () {\r\n var _this = this;\r\n var rotation = (this._rotation + 90) * $math.RADIANS;\r\n var x1 = Math.round(50 + Math.sin(rotation + Math.PI) * 50) + '%';\r\n var y1 = Math.round(50 + Math.cos(rotation) * 50) + '%';\r\n var x2 = Math.round(50 + Math.sin(rotation) * 50) + '%';\r\n var y2 = Math.round(50 + Math.cos(rotation + Math.PI) * 50) + '%';\r\n var gradientElement = this.element;\r\n gradientElement.removeChildNodes();\r\n gradientElement.attr({ \"x1\": x1, \"x2\": x2, \"y1\": y1, \"y2\": y2 });\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n LinearGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.validate();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Rotation (direction) of the gradient in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n //this.element.attr({ \"gradientTransform\": \"rotate(\" + value + \" 10 100)\" });\r\n this._rotation = value;\r\n this.validate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LinearGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this._rotation = source.rotation;\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"gradientUnits\", {\r\n /**\r\n * Which units are used when drawing gradient filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying gradient on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.element.attr({ gradientUnits: value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinearGradient;\r\n}(BaseObject));\r\nexport { LinearGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradient\"] = LinearGradient;\r\n//# sourceMappingURL=LinearGradient.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar LinearGradientModifier = /** @class */ (function (_super) {\r\n __extends(LinearGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LinearGradientModifier\";\r\n _this.gradient = new LinearGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n LinearGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return LinearGradientModifier;\r\n}(GradientModifier));\r\nexport { LinearGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradientModifier\"] = LinearGradientModifier;\r\n//# sourceMappingURL=LinearGradientModifier.js.map","/**\r\n * Pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { List, ListDisposer } from \"../../utils/List\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { registry } from \"../../Registry\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $type from \"../../utils/Type\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define patterns.\r\n */\r\nvar Pattern = /** @class */ (function (_super) {\r\n __extends(Pattern, _super);\r\n //public propertyValues = new Dictionary
();\r\n /**\r\n * Constructor\r\n */\r\n function Pattern() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of elements the pattern consists of.\r\n */\r\n _this._elements = new List();\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link PatternProperties}\r\n */\r\n _this.properties = {};\r\n _this.className = \"Pattern\";\r\n // Set defaults\r\n _this.width = 10;\r\n _this.height = 10;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.patternUnits = \"userSpaceOnUse\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.backgroundFill = interfaceColors.getFor(\"background\");\r\n _this.backgroundOpacity = 0;\r\n _this.fillOpacity = 1;\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.strokeOpacity = 1;\r\n _this.strokeWidth = 1;\r\n _this.shapeRendering = \"crispEdges\";\r\n _this.rotation = 0;\r\n // Create main group to store pattern elements inelements\r\n _this.element = _this.paper.addGroup(\"pattern\");\r\n _this.id = \"pattern-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Make elements disposable\r\n _this._disposers.push(new ListDisposer(_this._elements));\r\n // Request again to trigger getter/setter code\r\n _this.patternUnits = _this.patternUnits;\r\n _this.width = _this.width;\r\n _this.height = _this.height;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n Pattern.prototype.draw = function () {\r\n var _this = this;\r\n var patternElement = this.element;\r\n if (patternElement) {\r\n patternElement.removeChildNodes();\r\n var background = this.paper.add(\"rect\");\r\n background.attr({ \"width\": this.width, \"height\": this.height, \"shape-rendering\": \"crispEdges\", \"fill\": this.backgroundFill.hex, \"fill-opacity\": this.backgroundOpacity, \"stroke\": this.backgroundFill.hex, \"stroke-opacity\": 0 });\r\n patternElement.add(background);\r\n patternElement.attr({ \"x\": this.x, \"y\": this.y, \"width\": this.width, \"height\": this.height, \"stroke\": this.stroke.hex, \"fill\": this.fill.hex, \"fill-opacity\": this.fillOpacity, \"stroke-opacity\": this.strokeOpacity, \"stroke-width\": this.strokeWidth, \"shape-rendering\": this.shapeRendering, \"patternUnits\": this.patternUnits, \"stroke-dasharray\": this.strokeDasharray });\r\n $iter.each(this._elements.iterator(), function (element) {\r\n element.rotation = _this.rotation;\r\n element.rotationX = _this.properties[\"rotationX\"];\r\n element.rotationY = _this.properties[\"rotationY\"];\r\n _this.element.add(element);\r\n });\r\n }\r\n };\r\n /**\r\n * Animate pattern properties.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Pattern.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Adds an element to the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.addElement = function (element) {\r\n this._elements.push(element);\r\n this._disposers.push(element);\r\n };\r\n /**\r\n * Remove an element from the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.removeElement = function (element) {\r\n this._elements.removeValue(element);\r\n this.removeDispose(element);\r\n };\r\n Object.defineProperty(Pattern.prototype, \"elements\", {\r\n /**\r\n * Returns the list of SVG elements comprising the pattern.\r\n *\r\n * @return Pattern elements\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"fillOpacity\"];\r\n },\r\n /**\r\n * Pattern fill opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"fillOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fill\", {\r\n /**\r\n * @return Fill color\r\n */\r\n get: function () {\r\n return this.properties[\"fill\"];\r\n },\r\n /**\r\n * Fill color of the pattern.\r\n *\r\n * @param value Fill color\r\n */\r\n set: function (value) {\r\n this.properties[\"fill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundFill\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundFill\"];\r\n },\r\n /**\r\n * Pattern background fill color.\r\n *\r\n * @param value Background color\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundFill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundOpacity\", {\r\n /**\r\n * @return Background opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundOpacity\"];\r\n },\r\n /**\r\n * Pattern backgorund opacity. (0-1)\r\n *\r\n * @param value Background opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Pattern stroke (border) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeOpacity\"];\r\n },\r\n /**\r\n * Pattern stroke opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Stroke thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Pattern stroke thickness in pixels.\r\n *\r\n * @param value Stroke thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"shapeRendering\", {\r\n get: function () {\r\n return this.properties[\"shapeRendering\"];\r\n },\r\n /**\r\n * Shape rendering\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.properties[\"shapeRendering\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.properties[\"rotation\"];\r\n },\r\n /**\r\n * Pattern rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n this.properties[\"rotation\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"patternUnits\", {\r\n /**\r\n * @return Units\r\n */\r\n get: function () {\r\n return this.properties[\"patternUnits\"];\r\n },\r\n /**\r\n * Pattern measuring units.\r\n *\r\n * Available options: \"userSpaceOnUse\" | \"objectBoundingBox\".\r\n *\r\n * @param value Units\r\n */\r\n set: function (value) {\r\n this.properties[\"patternUnits\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"width\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Pattern width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"height\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Pattern height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"x\", {\r\n /**\r\n * @return X (px)\r\n */\r\n get: function () {\r\n return this.properties[\"x\"];\r\n },\r\n /**\r\n * X position. (pixels)\r\n *\r\n * @param value X (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"x\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"y\", {\r\n /**\r\n * @return Y (px)\r\n */\r\n get: function () {\r\n return this.properties[\"y\"];\r\n },\r\n /**\r\n * Y position (px).\r\n *\r\n * @param value Y (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"y\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instance to draw pattern in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another Pattern instance.\r\n *\r\n * @param source Source pattern\r\n */\r\n Pattern.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n $object.each(source.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Pattern.prototype, \"animations\", {\r\n /**\r\n * A list of animations currently running on the patter.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation list\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.properties[\"strokeDashArray\"];\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeDashArray\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Pattern.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.elements) && $type.isArray(config.elements)) {\r\n for (var i = 0, len = config.elements.length; i < len; i++) {\r\n var element = config.elements[i];\r\n if ($type.hasValue(element[\"type\"])) {\r\n var sprite = this.createEntryInstance(element);\r\n if (sprite instanceof BaseObject) {\r\n sprite.config = element;\r\n }\r\n this.addElement($type.hasValue(element[\"typeProperty\"])\r\n ? sprite[element[\"typeProperty\"]]\r\n : sprite.element);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return Pattern;\r\n}(BaseObject));\r\nexport { Pattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Pattern\"] = Pattern;\r\n//# sourceMappingURL=Pattern.js.map","/**\r\n * Contains code and logic for generating radial gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Percent } from \"../../utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Radial gradient class.\r\n */\r\nvar RadialGradient = /** @class */ (function (_super) {\r\n __extends(RadialGradient, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RadialGradient() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n _this.element = _this.paper.addGroup(\"radialGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n */\r\n RadialGradient.prototype.draw = function () {\r\n var _this = this;\r\n var gradientElement = this.element;\r\n if ($type.isNumber(this.cx)) {\r\n var value = this.cx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cx\": value });\r\n }\r\n if ($type.isNumber(this.cy)) {\r\n var value = this.cy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cy\": value });\r\n }\r\n if (this.fx) {\r\n var value = this.fx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fx\": value });\r\n }\r\n if (this.fy) {\r\n var value = this.fy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fy\": value });\r\n }\r\n gradientElement.removeChildNodes();\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n RadialGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n this.draw();\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cx\", {\r\n get: function () {\r\n return this._cx;\r\n },\r\n /**\r\n * Center x coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cy\", {\r\n get: function () {\r\n return this._cy;\r\n },\r\n /**\r\n * Center y coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fx\", {\r\n get: function () {\r\n return this._fx;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fy\", {\r\n get: function () {\r\n return this._fy;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RadialGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this.cx = source.cx;\r\n this.cy = source.cy;\r\n this.fx = source.fx;\r\n this.fy = source.fy;\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RadialGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n return RadialGradient;\r\n}(BaseObject));\r\nexport { RadialGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradient\"] = RadialGradient;\r\n//# sourceMappingURL=RadialGradient.js.map","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify radial gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar RadialGradientModifier = /** @class */ (function (_super) {\r\n __extends(RadialGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function RadialGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RadialGradientModifier\";\r\n _this.gradient = new RadialGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n RadialGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return RadialGradientModifier;\r\n}(GradientModifier));\r\nexport { RadialGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradientModifier\"] = RadialGradientModifier;\r\n//# sourceMappingURL=RadialGradientModifier.js.map","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Rectangular pattern\r\n */\r\nvar RectPattern = /** @class */ (function (_super) {\r\n __extends(RectPattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RectPattern() {\r\n var _this = _super.call(this) || this;\r\n _this.rectHeight = 1;\r\n _this.rectWidth = 1;\r\n _this._rect = _this.paper.add(\"rect\");\r\n _this.addElement(_this._rect);\r\n return _this;\r\n }\r\n /**\r\n * Draws the rectangular element.\r\n */\r\n RectPattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n if (this._rect) {\r\n this._rect.attr({ \"width\": this.rectWidth, \"height\": this.rectHeight, \"x\": (this.width - this.rectWidth) / 2, \"y\": (this.height - this.rectHeight) / 2 });\r\n }\r\n };\r\n Object.defineProperty(RectPattern.prototype, \"rectWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectWidth\"];\r\n },\r\n /**\r\n * Rectangle width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RectPattern.prototype, \"rectHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectHeight\"];\r\n },\r\n /**\r\n * Rectangle height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectHeight\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RectPattern;\r\n}(Pattern));\r\nexport { RectPattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RectPattern\"] = RectPattern;\r\n//# sourceMappingURL=RectPattern.js.map","/**\r\n * Module for \"Blur\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Blur\" filter.\r\n */\r\nvar BlurFilter = /** @class */ (function (_super) {\r\n __extends(BlurFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BlurFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BlurFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur value.\r\n *\r\n * The bigger the value, the blurrier the target element will become.\r\n *\r\n * @default 1.5\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BlurFilter;\r\n}(Filter));\r\nexport { BlurFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"BlurFilter\"] = BlurFilter;\r\n//# sourceMappingURL=BlurFilter.js.map","/**\r\n * Module for \"Colorize\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Colorize\" filter.\r\n */\r\nvar ColorizeFilter = /** @class */ (function (_super) {\r\n __extends(ColorizeFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorizeFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorizeFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n //this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.intensity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)applies colors to the already existing filter by modifying filyer's\r\n * color matrix element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ColorizeFilter.prototype.applyFilter = function () {\r\n var i = this.intensity;\r\n var ii = 1 - i;\r\n var r;\r\n var g;\r\n var b;\r\n var color = this.color;\r\n if (color && color.rgb) {\r\n r = color.rgb.r / 255 * i;\r\n g = color.rgb.g / 255 * i;\r\n b = color.rgb.b / 255 * i;\r\n }\r\n else {\r\n r = 0;\r\n g = 0;\r\n b = 0;\r\n }\r\n this.feColorMatrix.attr({ \"values\": ii + \" 0 0 0 \" + r + \" 0 \" + ii + \" 0 0 \" + g + \" 0 0 \" + ii + \" 0 \" + b + \" 0 0 0 1 0\" });\r\n };\r\n Object.defineProperty(ColorizeFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"color\"];\r\n },\r\n /**\r\n * Target color to apply to the element.\r\n *\r\n * Depending on the `intensity`, all colors of the target element will steer\r\n * towards this color.\r\n *\r\n * E.g. setting to `am4core.color(\"greener\")` will make all colors greener.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"color\"] = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorizeFilter.prototype, \"intensity\", {\r\n /**\r\n * @return Intensity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.intensity;\r\n },\r\n /**\r\n * Intensity of the color (0-1).\r\n *\r\n * The bigger the number the more of a `color` target's colors will become.\r\n *\r\n * 0 means the colors will remain as they are.\r\n * 1 means all colors will become the target `color`.\r\n *\r\n * @default 1\r\n * @param value Intensity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.intensity = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ColorizeFilter;\r\n}(Filter));\r\nexport { ColorizeFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorizeFilter\"] = ColorizeFilter;\r\n//# sourceMappingURL=ColorizeFilter.js.map","/**\r\n * Module for \"Desaturate\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Desaturate\" filter\r\n */\r\nvar DesaturateFilter = /** @class */ (function (_super) {\r\n __extends(DesaturateFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DesaturateFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DesaturateFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"saturate\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.width = 120;\r\n _this.height = 120;\r\n _this.saturation = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DesaturateFilter.prototype, \"saturation\", {\r\n /**\r\n * @return Saturation (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"saturation\"];\r\n },\r\n /**\r\n * Saturation.\r\n *\r\n * 0 - completely desaturated.\r\n * 1 - fully saturated (gray).\r\n *\r\n * @param value Saturation (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"saturation\"] = value;\r\n this.feColorMatrix.attr({ \"values\": value.toString() });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DesaturateFilter;\r\n}(Filter));\r\nexport { DesaturateFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DesaturateFilter\"] = DesaturateFilter;\r\n//# sourceMappingURL=DesaturateFilter.js.map","/**\r\n * Module for \"Drop Shadow\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Drop Shadow\" filter.\r\n */\r\nvar DropShadowFilter = /** @class */ (function (_super) {\r\n __extends(DropShadowFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DropShadowFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DropShadowFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.color = color(\"#000\");\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n _this.feOffset = _this.paper.add(\"feOffset\");\r\n _this.feOffset.attr({ \"result\": \"offsetBlur\" });\r\n _this.filterPrimitives.push(_this.feOffset);\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": _this.color });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"in2\": \"offsetBlur\", operator: \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feMerge = _this.paper.addGroup(\"feMerge\");\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\"));\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\").attr({ \"in\": \"SourceGraphic\" }));\r\n _this.filterPrimitives.push(_this.feMerge);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.dx = 3;\r\n _this.dy = 3;\r\n _this.opacity = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Shadow color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties.color = value;\r\n if (this.feFlood) {\r\n this.feFlood.attr({ \"flood-color\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.opacity;\r\n },\r\n /**\r\n * Opacity of the shadow. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.opacity = value;\r\n this.feFlood.attr({ \"flood-opacity\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dx;\r\n },\r\n /**\r\n * Horizontal offset in pixels.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dx = value;\r\n this.feOffset.attr({ \"dx\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dy;\r\n },\r\n /**\r\n * Vertical offset in pixels.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dy = value;\r\n this.feOffset.attr({ \"dy\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur.\r\n *\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [updateScale description]\r\n *\r\n * @todo Description\r\n */\r\n DropShadowFilter.prototype.updateScale = function () {\r\n this.dx = this.dx;\r\n this.dy = this.dy;\r\n this.blur = this.blur;\r\n };\r\n return DropShadowFilter;\r\n}(Filter));\r\nexport { DropShadowFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DropShadowFilter\"] = DropShadowFilter;\r\n//# sourceMappingURL=DropShadowFilter.js.map","/**\r\n * This module contains a base class for an SVG filter.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { List } from \"../../utils/List\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base filter class.\r\n *\r\n * This class while can be instantiated will not do anything. It is just a base\r\n * functionality for any other \"real\" filters to extend.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n *\r\n * @todo Example\r\n */\r\nvar Filter = /** @class */ (function (_super) {\r\n __extends(Filter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Filter() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link FilterProperties}\r\n */\r\n _this.properties = {};\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * [_scale description]\r\n *\r\n * @todo Description\r\n */\r\n _this._scale = 1;\r\n /**\r\n * [_nonScaling description]\r\n *\r\n * @todo Description\r\n */\r\n _this._nonScaling = true;\r\n _this.className = \"Filter\";\r\n // Create a list to hold primitives (effect elements)\r\n _this.filterPrimitives = new List();\r\n _this.properties.filterUnits = \"objectBoundingBox\";\r\n // Automatically add added primitives to `_disposers` so they are discarded\r\n // when Filter object is destroyed (disposed)\r\n _this.filterPrimitives.events.on(\"inserted\", function (ev) {\r\n _this._disposers.push(ev.newValue);\r\n });\r\n // Set default dimensions\r\n _this.width = 120;\r\n _this.height = 120;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Appends actual filter elements to the filter group.\r\n *\r\n * @ignore Exclude from docs\r\n * @param filterElement An SVG `` element to add filter element to\r\n */\r\n Filter.prototype.appendPrimitives = function (filterElement) {\r\n $iter.each(this.filterPrimitives.iterator(), function (filterPrimitive) {\r\n filterElement.add(filterPrimitive);\r\n });\r\n };\r\n /**\r\n * Uses Transitions filter's values from current to target. This is used to\r\n * smoothly appear filter, rather than it pop into effect.\r\n *\r\n * @ignore Exclude from docs\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Filter.prototype.animate = function (animationOptions, duration, easing) {\r\n var animation = new Animation(this, animationOptions, duration, easing).start();\r\n return animation;\r\n };\r\n Object.defineProperty(Filter.prototype, \"width\", {\r\n /**\r\n * @return Width (%)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Width of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"height\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Height of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Height (%)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another [[Filter]] object.\r\n *\r\n * @param filter Source [[Filter]] object\r\n */\r\n Filter.prototype.copyFrom = function (filter) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, filter);\r\n $object.each(filter.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Filter.prototype, \"paper\", {\r\n /**\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * Sets [[Paper]] instance to create filter's elements in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"animations\", {\r\n /**\r\n * All animations currently in play.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"scale\", {\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * [[Sprite]] uses this method to inform filter about it's scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n set: function (value) {\r\n this._scale = value;\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates filter properties which depend on scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Filter.prototype.updateScale = function () {\r\n // Dummy method for extending classes to override.\r\n };\r\n Object.defineProperty(Filter.prototype, \"filterUnits\", {\r\n /**\r\n * @return Filter units\r\n */\r\n get: function () {\r\n return this.properties.filterUnits;\r\n },\r\n /**\r\n * Which units are used when drawing filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying filters on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.properties.filterUnits = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"nonScaling\", {\r\n /**\r\n * @return Non scaling?\r\n */\r\n get: function () {\r\n return this._nonScaling;\r\n },\r\n /**\r\n * If a filter is non scaling, it will look the same even if the sprite is\r\n * scaled, otherwise filter will scale together with a [[Sprite]].\r\n *\r\n * @default false\r\n * @param value Non scaling?\r\n */\r\n set: function (value) {\r\n this._nonScaling = value;\r\n if (!value) {\r\n this._scale = 1;\r\n }\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"sprite\", {\r\n /**\r\n * A target element this filter is currently attached to.\r\n *\r\n * We need to keep track of it because one filter can be used for just one\r\n * element, so we have to remove it from the old \"parent\" when attaching to\r\n * the new one.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n this.setSprite(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n Filter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.filters.removeValue(this);\r\n }\r\n this._sprite = value;\r\n };\r\n return Filter;\r\n}(BaseObject));\r\nexport { Filter };\r\n//# sourceMappingURL=Filter.js.map","/**\r\n * Module for \"Focus\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Filter } from \"./Filter\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Focus\" filter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n */\r\nvar FocusFilter = /** @class */ (function (_super) {\r\n __extends(FocusFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function FocusFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"FocusFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": new InterfaceColorSet().getFor(\"primaryButtonHover\"), \"result\": \"base\" });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feMorphology = _this.paper.add(\"feMorphology\");\r\n _this.feMorphology.attr({ \"result\": \"bigger\", \"in\": \"SourceGraphic\", \"operator\": \"dilate\", \"radius\": \"2\" });\r\n _this.filterPrimitives.push(_this.feMorphology);\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"result\": \"mask\", \"in\": \"bigger\", \"type\": \"matrix\", \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"result\": \"drop\", \"in\": \"base\", \"in2\": \"mask\", \"operator\": \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feBlend = _this.paper.add(\"feBlend\");\r\n _this.feBlend.attr({ \"in\": \"SourceGraphic\", \"in2\": \"drop\", \"mode\": \"normal\" });\r\n _this.filterPrimitives.push(_this.feBlend);\r\n // Set default properties\r\n _this.width = 130;\r\n _this.height = 130;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(FocusFilter.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Stroke (outline) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.feFlood.attr({ \"flood-color\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Outline thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Outline thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.feMorphology.attr({ \"radius\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Outline opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"opacity\"];\r\n },\r\n /**\r\n * Opacity of the outline. (0-1)\r\n *\r\n * @param value Outline opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"opacity\"] = value;\r\n this.feColorMatrix.attr({ \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" + value + \" 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * In addition it also disables built-in focus outline on element this\r\n * filter is applied to.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n FocusFilter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.group.removeStyle(\"outline\");\r\n }\r\n value.group.addStyle({\r\n \"outline\": \"none\"\r\n });\r\n _super.prototype.setSprite.call(this, value);\r\n };\r\n return FocusFilter;\r\n}(Filter));\r\nexport { FocusFilter };\r\n//# sourceMappingURL=FocusFilter.js.map","/**\r\n * Module for \"Lighten\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Lighten\" filter.\r\n */\r\nvar LightenFilter = /** @class */ (function (_super) {\r\n __extends(LightenFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LightenFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LightenFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.lightness = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LightenFilter.prototype, \"lightness\", {\r\n /**\r\n * @return Lightness\r\n */\r\n get: function () {\r\n return this.properties[\"lightness\"];\r\n },\r\n /**\r\n * Lightness of the target colors.\r\n *\r\n * If `lightness` is a positive number, the filter will make all colors\r\n * lighter.\r\n *\r\n * If `lightness` is negative, colors will be darkened.\r\n *\r\n * @param value Lightness\r\n */\r\n set: function (value) {\r\n this.properties[\"lightness\"] = value;\r\n var v = value + 1;\r\n this.feColorMatrix.attr({ \"values\": v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 1 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LightenFilter;\r\n}(Filter));\r\nexport { LightenFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LightenFilter\"] = LightenFilter;\r\n//# sourceMappingURL=LightenFilter.js.map"],"names":["DateFormatter","_super","_this","call","this","_dateFormat","_inputDateFormat","_utc","timezoneMinutes","_firstDayOfWeek","months","monthsShort","weekdays","weekdaysShort","_outputFormat","capitalize","className","applyTheme","Object","defineProperty","prototype","get","_language","set","value","dateFormat","translate","enumerable","configurable","format","source","applyTimezone","formatted","date","language","sprite","parse","intlLocales","Intl","DateTimeFormat","undefined","e","info","parseFormat","timezoneOffset","setMinutes","getMinutes","getTimezoneOffset","timezone","getTime","applyFormat","replace","substr","toUpperCase","cached","getCache","chunks","chunk","i","length","type","text","match","matches","x","parts","push","template","setCache","fullYear","month","weekday","day","hours","minutes","seconds","milliseconds","res","offset","timestamp","utc","getUTCFullYear","getUTCMonth","getUTCDay","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","getFullYear","getMonth","getDay","getDate","getHours","getSeconds","getMilliseconds","len","Math","abs","toString","week","year","ceil","translateFunc","firstDayOfWeek","round","pow","tz","tzh","floor","tzm","toISOString","toUTCString","inputDateFormat","Date","reg","parsedIndexes","resValues","indexAdjust","index","year3","year2","year1","getStringList","join","monthLong","monthShort","yearDay","weekdayLong","weekdayShort","am","hour12Base1","hourBase0","hour12Base0","hourBase1","minute","second","millisecond","millisecondDigits","zone","iso","regex","RegExp","parseInt","val","resolveMonth","resolveShortMonth","hour","isAm","ts","resolveTimezoneOffset","UTC","dir","originalOffset","diff","indexOf","isDefault","translateAll","list","invalidateSprite","invalidate","_intlLocales","_timezoneOffset","_timezone","toLowerCase","DurationFormatter","_negativeBase","_baseUnit","_unitValues","_unitAliases","base","baseUnit","durationFormat","getFormat","details","Number","positive","negative","zero","color","split","part","item","parsed","partFormat","dirs","absolute","tstamp","toTimeStamp","unit","toTimeUnit","digits","ints","code","outputFormat","maxValue","maxUnit","getValueUnit","durationFormats","currentUnit","ms","key","num","_durationFormat","_durationFormats","NumberFormatter","_numberFormat","_smallNumberThreshold","_forceLTR","dispose","precision","NumberFormat","mod","decimals","active","forceLTR","translateEmpty","mods","modSpacing","a","thousands","passive","b","interval","pop","prefix","suffix","a_1","applyPrefix","bytePrefixes","a_2","smallNumberThreshold","smallNumberPrefixes","bigNumberPrefixes","ol","min","parseFloat","toPrecision","exp","toExponential","d","Array","ip","intsr","reverse","c","unshift","separator","decs","prefixes","force","newvalue","applied","k","number","_bigNumberPrefixes","_smallNumberPrefixes","_bytePrefixes","escape","unescape","formatter","TextFormatter","adapter","debug","output","styles","wrap","texts","t","apply","s","cleanUp","style","wrapHtml","translateStyleShortcuts","wrapSvg","getSvgElement","element","textContent","node","setAttribute","styleSvgToHtml","getHtmlElement","document","createElement","innerHTML","q","quotedBlocks","noFormatting","chunks2","i2","chunk2","isImage","getTextFormatter","Inertia","interaction","point","startPoint","animations","_disposers","handleMove","y","events","isEnabled","imev","target","shift","touch","dispatchImmediately","done","inertias","removeKey","processDragStop","Interaction","_globalEventsAdded","_pointerEvents","_usePointerEventsOnly","_useTouchEventsOnly","_addHoverEvents","_passiveSupported","_delayedEvents","out","overObjects","downObjects","trackedObjects","transformedObjects","pointers","inertiaOptions","hitOptions","hoverOptions","swipeOptions","keyboardOptions","mouseOptions","body","getInteraction","window","hasOwnProperty","pointerdown","pointerup","pointermove","pointercancel","pointerover","pointerout","matchMedia","navigator","userAgent","fullFF","wheel","onmousewheel","setKey","passiveSupported","addGlobalEvents","ev","handleGlobalPointerDown","handleGlobalPointerMove","handleGlobalPointerUp","relatedTarget","buttons","which","handleDocumentLeave","handleGlobalTouchStart","handleGlobalTouchMove","handleGlobalTouchEnd","handleGlobalKeyDown","handleGlobalKeyUp","processClickable","io","processTouchable","processContextMenu","contextMenuDisabled","eventDisposers","hasKey","preventDefault","getKey","processHoverable","hoverable","trackable","applyCursorOverStyle","handlePointerOut","handlePointerOver","disposer","processMovable","draggable","swipeable","resizable","isGlobalElement","isTouchProtected","prepElement","processTrackable","moveValue","removeValue","processDraggable","processSwipeable","processResizable","processWheelable","wheelable","handleMouseWheel","on","unlockWheel","lockWheel","processFocusable","focusable","tabindex","handleFocus","handleBlur","handleFocusBlur","clickable","handleTouchDown","handlePointerDown","isFocused","event","getHitOption","once","disableType","enableType","focusedObject","disposerKey","ko","directionY","directionX","showTooltipOn","pointer","getPointer","getPointerPoint","addBreadCrumb","handleGlobalMove","processDelayed","preventTouchAction","defaultPrevented","cancelled","handleGlobalUp","changedTouches","button","resetPointer","handleDown","handleOver","handleOut","deltaX","deltaY","deltaMode","getMouseOption","WheelEvent","Error","wheelDeltaX","wheelDeltaY","handleWheel","maybePreventDefault","handleHit","now","lastHit","lastHitPointer","soft","hoversPaused","shouldCancelHovers","areTransformed","moved","cancelAllHovers","overPointers","isRealHover","isHover","handleTrack","hasDelayedOut","old","behavior","getHoverOption","keepUntil","timeout","setTimeout","isDisposed","clear","delayedEvent","inert","stopInertia","downPointers","applyCursorDownStyle","isDown","processDragStart","processResizeStart","sorted","values","slice","sort","pos","compareDocumentPosition","Node","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","contains","handleUp","backwards","iterator","each","restoreCursorDownStyle","swiped","handleSwipe","handleInertia","processResizeStop","cancelable","getIndex","target_1","lastEvent","reset","swiping","handleTransform","skipCheck","handleMoveInertia","handleResizeInertia","inertia","ref","getTrailPoint","getInertiaOption","factor","animationOptions","animation","start","lastUpEvent","pointer2","point2","startPoint2","pointer1","point1","startPoint1","originalPosition","singlePoint","nextPointer","pointer1Moved","dragStartEvents","handleTransformMove","pointer2Moved","handleTransformResize","ctrlKey","pointerMoved","scale","dragTarget","getDragPointer","dragStart","lastDownEvent","dragStop","getPointerId","id","identifier","pointerId","clientX","clientY","isPointerTouch","lastPointer","Touch","PointerEvent","pointerType","MouseEvent","startTime","track","swipeCanceled","lockDocument","unlockDocument","restoreAllStyles","lockElement","unlockElement","addEventListener","wheelLockEvent","removeEventListener","isLocalElement","svg","doc","elementFromPoint","local","el","props","setTemporaryStyle","unprepElement","restoreStyle","option","getSwipeOption","getKeyboardOption","options","cursorOptions","overStyle","property","downStyle","setGlobalStyle","restoreGlobalStyle","tolerance","minTime","getShift","pointerExists","exists","replacedStyles","log","show","logTouch","TouchEvent","console","uid","except","count","ex","options_1","err","InteractionKeyboardObject","_disposed","keyboardEvent","_startedOn","update","speed","accelleration","accellerationDelay","shiftKey","accelleratedMs","accellerationFactor","InteractionObject","_eventDispatcher","_clickable","_contextMenuDisabled","_hoverable","_trackable","_draggable","_swipeable","_resizable","_wheelable","_inert","_isHover","_isHoverByTouch","_isDown","_isFocused","_isTouchProtected","_inertiaOptions","_hitOptions","_hoverOptions","_swipeOptions","_keyboardOptions","_mouseOptions","_cursorOptions","_element","isHoverByTouch","_overPointers","_downPointers","_focusable","_tabindex","_originalPosition","_originalScale","_originalAngle","_adapterO","copyFrom","setEventDisposer","f","InteractionObjectEventDispatcher","arguments","_domEvents","_addDOMEvent","listener","context","callback_1","increment","_dispatchKeyboardEvent","_on","callback","shouldClone","dispatch","disposers","MouseCursorStyle","grab","grabbing","default","horizontalResize","verticalResize","notAllowed","AMElement","_isDisposed","_x","_y","_rotationY","_rotationX","_rotation","_scale","createElementNS","removeNode","parentNode","removeChild","_transformString","transform","transfromString","rotateString","getBBox","bbox","width","height","svgbbox","moveTo","angle","removeAttr","attribute","removeAttribute","attr","attributes","attributeName","attributeValue","getAttr","getAttribute","attrNS","ns","setAttributeNS","getAttrNS","getAttributeNS","removeStyle","getStyle","addStyle","addClass","name","removeClass","setClass","removeChildNodes","childNodes","firstChild","Group","elementName","add","appendChild","addToBack","first","insertBefore","removeElement","hasChild","removeChildren","childNode","removeChildrenByTag","tag","remove","getElementsByTagName","Paper","container","defs","overflow","addGroup","groupName","append","appendDef","foreignObject","supportsForeignObject","implementation","hasFeature","ghostPaper","getGhostPaper","ghostDiv","hidden","position","zIndex","ghostSvgContainer","SVGContainer","polyline","points","path","lineTo","prevPoint","minStep","quadraticCurveTo","controlPoint","cubicCurveTo","controlPointA","controlPointB","closePath","arcTo","startAngle","arc","radius","radiusY","segments","l","pax","pay","cx","cy","endAngle","ax","ay","innerRadius","cornerRadius","innerCornerRadius","temp","crSin","innerRadiusY","cornerRadiusY","innerCornerRadiusY","crAngle","asin","crAngleY","crInnerAngle","crInnerAngleY","middleAngle","mPoint","a0","b0","c0","d0","b1","d1","arcToPoint","sweepFlag","largeArcFlag","xAxisRotation","Boolean","sweepFlagValue","largeArcFlagValue","rectangle","rectToPath","rect","ccw","L","svgContainers","htmlElement","ghost","autoResize","nonExportableSprites","cssScale","_printing","initSensor","svgContainer","resizeSensor","measure","maxWidth","maxHeight","checkTransform","_container","_modal","openModal","title","closeModal","modal","content","readerTitle","open","close","_popups","popupTemplate","openPopup","popup","popups","create","closeAllPopups","_readerAlertElement","div","opacity","top","readerAlert","readerAlertElement","getComputedStyle","matrix","getPropertyValue","sqrt","isNaN","HTMLElement","Tension","tensionX","tensionY","_tensionX","_tensionY","smooth","p0","p1","splice","last","closed","p2","p3","wavedLine","waveLength","waveHeight","tension","adjustWaveLength","x1","y1","x2","y2","distance","atan2","cos","sin","waveLengthX","waveLengthY","halfWaveCount","sign_1","Monotone","reversed","_reversed","_closed","_curve","x0","y0","t0","t1","dx","NaN","_a","slope2","slope3","sign","h","h0","h1","s0","s1","p","MonotoneX","MonotoneY","Basis","x3","x4","y3","y4","pushCurve","pushPoint","CirclePattern","properties","_circle","paper","addElement","shapeRendering","draw","ColorModifier","modify","GradientModifier","lightnesses","brightnesses","opacities","offsets","_lightnesses","_brightnesses","_opacities","_offsets","gradient","lightness","brightness","brighten","lighten","addColor","LinePattern","_line","rotation","w","gap","step","strokeWidth","LinearGradient","_stops","validate","PI","gradientElement","stop","gradientStop","_paper","stops","gradientUnits","LinearGradientModifier","clone","Pattern","_elements","patternUnits","interfaceColors","backgroundFill","getFor","backgroundOpacity","fillOpacity","fill","stroke","strokeOpacity","patternElement","background","hex","strokeDasharray","rotationX","rotationY","animate","duration","easing","removeDispose","_animations","processConfig","config","elements","createEntryInstance","RadialGradient","percent","fx","fy","_cx","_cy","_fx","_fy","RadialGradientModifier","RectPattern","rectHeight","rectWidth","_rect","BlurFilter","feGaussianBlur","filterPrimitives","blur","ColorizeFilter","feColorMatrix","intensity","applyFilter","r","g","ii","rgb","DesaturateFilter","saturation","DropShadowFilter","feOffset","feFlood","feComposite","operator","feMerge","dy","updateScale","Filter","isTemplate","_nonScaling","filterUnits","newValue","appendPrimitives","filterElement","filterPrimitive","filter","setSprite","_sprite","filters","FocusFilter","feMorphology","feBlend","group","LightenFilter","v"],"sourceRoot":""}