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./node_modules/@amcharts/amcharts4/.internal/core/Options.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/Registry.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/Sprite.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/SpriteEvents.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/SpriteState.js","webpack://rokk3rfuel/./node_modules/@amcharts/amcharts4/.internal/core/System.js"],"sourcesContent":["/**\r\n * Defines functionality for \"Data Item\"\r\n *\r\n * A Data Item can be any object that can hold data. For example [[LineSeries]]\r\n * holds a number of values, that comprise a line graph. Each of those values\r\n * (data points) is a {DataItem}.\r\n *\r\n * Furthermore the [[LineSeries]] itself can be represented as a entry in the\r\n * legend. Since legend needs access to Line Series' value, a DataItem is\r\n * created for the series.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $array from \"./utils/Array\";\r\n//import * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * DataItem represents single element in data, for example a data point in a\r\n * Serial Chart Series, e.g. a column.\r\n *\r\n * DataItem defines relationship between structured data, required for specific\r\n * chart type or task, and raw source data.\r\n *\r\n * It also implements required calculations, updates related visual elements,\r\n * etc.\r\n *\r\n * @todo Description\r\n * @important\r\n */\r\nvar DataItem = /** @class */ (function (_super) {\r\n __extends(DataItem, _super);\r\n /**\r\n * Constructor\r\n * @todo Adding events to disposers produces errors in some cases, which means that chart is using disposed Data Items which is not right\r\n */\r\n function DataItem() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * This Data Item is currently disabled.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._disabled = false;\r\n /**\r\n * Indicates whether Data Item has any properties set.\r\n *\r\n * If it does not have any, the code can use this property to check whether\r\n * they need to apply costly operation of re-applying properties, whenever\r\n * Data Item-related element is redrawn, e.g. series.\r\n */\r\n _this.hasProperties = false;\r\n /**\r\n * An object containing calculated values.\r\n */\r\n _this.values = {};\r\n /**\r\n * An object container current working values.\r\n */\r\n //public readonly workingValues: { [index: string]: { [index: string]: number } } = {};\r\n /**\r\n * An object containing categories.\r\n */\r\n _this.categories = {};\r\n /**\r\n * An object containing dates.\r\n */\r\n _this.dates = {};\r\n /**\r\n * An object containing locations for the Data Item.\r\n *\r\n * A location is a position within date or category, or, in some other cases,\r\n * where there is no single point but rather some period.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Data_item_locations} for info how data item locations work\r\n */\r\n _this.locations = {};\r\n /**\r\n * Current working locations.\r\n */\r\n _this.workingLocations = {};\r\n /**\r\n * An object containing Data Item specific appearance properties in key-value\r\n * pairs.\r\n *\r\n * Sometimes a single Data Item needs to apply different properties than the\r\n * rest of the data [[Series]] it is part of. E.g. a single column,\r\n * represented by a Data Item needs to be filled with a different color than\r\n * the reset of the [[ColumnSeries]] it belongs to.\r\n *\r\n * That's where Data Item's `properties` come into play.\r\n *\r\n * Please note that you should set Data Item-specific properties using\r\n * `setProperty()` method, rather than access `properties` object directly.\r\n */\r\n _this.properties = {};\r\n /**\r\n * A list of [[Sprite]] elements that are associated with this Data Item.\r\n *\r\n * E.g. an [[Axis]] Data Item has several separate elements associated with\r\n * it, like [[AxisTick]], [[AxisLabel]], and [[Grid]].\r\n *\r\n * Data Item keeps track of all of them, so it can toggle all related visual\r\n * elements when it itself is toggled.\r\n */\r\n _this.sprites = [];\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 * The current index within the dataItems\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._index = null;\r\n /**\r\n * Is Data Item currently visible?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._visible = true;\r\n /**\r\n * Is Data Item currently hidden?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._hidden = false;\r\n /**\r\n * Should this Data Item be used when calculating data ranges and scales?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ignoreMinMax = false;\r\n /**\r\n * Some of the Data Item's data fields may contain an array of children. This\r\n * property contains an object indicating which fields hold an array, so that\r\n * they can be processed properly.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.hasChildren = {};\r\n /**\r\n * Indicates whether Data Item is currently animiting from visible to hidden\r\n * state.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._valueAnimations = {};\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._locationAnimations = {};\r\n _this.className = \"DataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DataItem.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"index\", {\r\n /**\r\n * Data Item's position index in Component's data.\r\n *\r\n * @return Index\r\n */\r\n get: function () {\r\n if (this.component) {\r\n if (this._index != null) {\r\n return this._index;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else {\r\n return -1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"animations\", {\r\n /**\r\n * A list of [[Animations]] objects currently mutating Data Item's values.\r\n *\r\n * @return [description]\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(DataItem.prototype, \"visible\", {\r\n /**\r\n * Returns `true` if this Data Item is currently visible.\r\n *\r\n * @return Visible?\r\n */\r\n get: function () {\r\n if (this._hidden) {\r\n return false;\r\n }\r\n return this._visible;\r\n },\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.hidden = false;\r\n }\r\n if (this._visible != value) {\r\n this.setVisibility(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"hidden\", {\r\n /**\r\n * Returns `true` if this Data Item is currently hidden.\r\n *\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this._hidden;\r\n },\r\n /**\r\n * Sets hidden flag for data item. Mostly used to initially hide data item.\r\n *\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n if (this._hidden != value) {\r\n this._hidden = value;\r\n if (value) {\r\n this.setVisibility(false);\r\n }\r\n else {\r\n this.setVisibility(true, true);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"__disabled\", {\r\n /**\r\n * Is this Data Item currently disabled?\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n get: function () {\r\n return this._disabled;\r\n },\r\n /**\r\n * Disables all Sprites associated with this Data Item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n set: function (value) {\r\n //\tif (this._disabled != value) { // not good\r\n this._disabled = value;\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.__disabled = value;\r\n });\r\n //\t}\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Data Item\r\n */\r\n DataItem.prototype.setVisibility = function (value, noChangeValues) {\r\n $array.each(this.sprites, function (sprite) {\r\n if (value) {\r\n sprite.visible = sprite.defaultState.properties.visible;\r\n }\r\n else {\r\n if (sprite.hiddenState) {\r\n sprite.visible = sprite.hiddenState.properties.visible;\r\n }\r\n else {\r\n sprite.visible = false;\r\n }\r\n }\r\n });\r\n this._visible = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_1 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_1);\r\n }\r\n }\r\n };\r\n /**\r\n * Shows the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param fields A list of fields to set values of\r\n */\r\n DataItem.prototype.show = function (duration, delay, fields) {\r\n var _this = this;\r\n if (!this.hidden) {\r\n this.setVisibility(true, true);\r\n this.isHiding = false;\r\n if (this._hideDisposer) {\r\n this.removeDispose(this._hideDisposer);\r\n }\r\n var animation_1;\r\n if (fields) {\r\n $array.each(fields, function (field) {\r\n animation_1 = _this.setWorkingValue(field, _this.values[field].value, duration, delay);\r\n });\r\n }\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.show(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n return animation_1;\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n DataItem.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.dispose();\r\n });\r\n this.sprites = [];\r\n };\r\n /**\r\n * Hides the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param toValue A value to set to `fields` when hiding\r\n * @param fields A list of data fields to set value to `toValue`\r\n */\r\n DataItem.prototype.hide = function (duration, delay, toValue, fields) {\r\n var _this = this;\r\n this.isHiding = true;\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.hide(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n if ($type.isNumber(toValue) && fields) {\r\n var animation_2;\r\n $array.each(fields, function (field) {\r\n var anim = _this.setWorkingValue(field, toValue, duration, delay);\r\n if (anim) {\r\n animation_2 = anim;\r\n }\r\n });\r\n if (animation_2 && !animation_2.isFinished()) {\r\n this._hideDisposer = animation_2.events.on(\"animationended\", function () {\r\n _this.setVisibility(false, true);\r\n _this.isHiding = false;\r\n });\r\n this._disposers.push(this._hideDisposer);\r\n return animation_2;\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false, true);\r\n }\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false);\r\n }\r\n };\r\n /**\r\n * Returns a duration (ms) the Data Item should take to animate from one\r\n * value to another.\r\n *\r\n * If the duration is not specified via parameter, this method will try to\r\n * request a default duration from the related `Component`.\r\n *\r\n * @param duration Default duration (ms)\r\n * @return Duration (ms)\r\n */\r\n DataItem.prototype.getDuration = function (duration) {\r\n if (!$type.isNumber(duration)) {\r\n var component = this.component;\r\n if (component) {\r\n duration = component.interpolationDuration;\r\n }\r\n }\r\n if (duration != null) {\r\n if (!this._adapterO) {\r\n return duration;\r\n }\r\n else {\r\n return this._adapterO.apply(\"duration\", duration);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a numeric value for specific data field.\r\n *\r\n * If `calculated` is not set, it will return a raw value, as it is in\r\n * source data.\r\n *\r\n * If `calculated` is set, it will return a pre-calculated specific value.\r\n *\r\n * @param name Data field name\r\n * @param calculated A calculated value name\r\n * @return Value\r\n */\r\n DataItem.prototype.getValue = function (name, calculated) {\r\n if (name && this.component) {\r\n if (!calculated) {\r\n calculated = this.component.dataFields[name + \"Show\"];\r\n if (!calculated) {\r\n calculated = \"value\";\r\n }\r\n }\r\n var value = this.values[name][calculated];\r\n if (this._adapterO && this._adapterO.isEnabled(\"value\")) {\r\n return this._adapterO.apply(\"value\", {\r\n value: value,\r\n field: name\r\n }).value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a current working value for a specific data field.\r\n *\r\n * The actual value may differ from the one returned by `getValue()`. The\r\n * latter returns static values from the data source.\r\n *\r\n * `getWorkingValue()` returns current value, which is usually different if\r\n * Data Item is animating from one state to another.\r\n *\r\n * @param name Data field name\r\n * @return Value\r\n */\r\n DataItem.prototype.getWorkingValue = function (name) {\r\n if (name && this.component) {\r\n var realName = this.component.dataFields[name + \"Show\"];\r\n if (!realName) {\r\n realName = \"workingValue\";\r\n }\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"workingValue\", {\r\n workingValue: this.values[name][realName],\r\n field: name\r\n }).workingValue;\r\n }\r\n else {\r\n return this.values[name][realName];\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n * @return Value\r\n */\r\n DataItem.prototype.getActualWorkingValue = function (name) {\r\n return this.values[name].workingValue;\r\n };\r\n /**\r\n * Sets a numeric value for specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setValue = function (name, value, duration, delay) {\r\n var currentValue = this.values[name].value;\r\n var newDuration = this.getDuration(duration);\r\n value = $type.toNumber(value);\r\n if (currentValue !== value) {\r\n this.values[name].value = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"valuechanged\")) {\r\n var event_2 = {\r\n type: \"valuechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"valuechanged\", event_2);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name);\r\n }\r\n }\r\n this.setWorkingValue(name, value, newDuration, delay);\r\n };\r\n DataItem.prototype.setCalculatedValue = function (name, value, calculated) {\r\n var currentValue = this.values[name][calculated];\r\n if (currentValue !== value && $type.isNumber(value)) {\r\n this.values[name][calculated] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"calculatedvaluechanged\")) {\r\n var event_3 = {\r\n type: \"calculatedvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"calculatedvaluechanged\", event_3);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemCalculatedValueChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Set current working numeric value for a specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n * @return An [[Animation]] object used for transition to new values\r\n */\r\n DataItem.prototype.setWorkingValue = function (name, value, duration, delay) {\r\n if ($type.isNumber(this.values[name].value)) {\r\n var newDuration = this.getDuration(duration);\r\n var workingValue = this.values[name].workingValue;\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingValue) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingValue != value) {\r\n var animation = this.animate({ childObject: this.values[name], property: \"workingValue\", from: workingValue, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._valueAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n }\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_4 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_4);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, name);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a relative location for a data field.\r\n *\r\n * A location is always relative on a 0 to 1 scale, with 0 being beginning,\r\n * 0.5 middle and 1 end.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setLocation = function (name, value, duration, delay) {\r\n var currentLocation = this.locations[name];\r\n if (currentLocation !== value) {\r\n this.locations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"locationchanged\")) {\r\n var event_5 = {\r\n type: \"locationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"locationchanged\", event_5);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name); // correct\r\n }\r\n this.setWorkingLocation(name, value, duration, delay);\r\n }\r\n };\r\n /**\r\n * Sets a current working location for a data field.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setWorkingLocation = function (name, value, duration, delay) {\r\n var newDuration = this.getDuration(duration);\r\n var workingLocation = this.workingLocations[name];\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingLocation) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingLocation != value) {\r\n var animation = this.animate({ childObject: this.workingLocations, property: name, from: workingLocation, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._locationAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n }\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workinglocationchanged\")) {\r\n var event_6 = {\r\n type: \"workinglocationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workinglocationchanged\", event_6);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingLocationChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets Date value to a data field.\r\n *\r\n * @param name Data field name\r\n * @param date Date object\r\n * @param duration Duration (ms) to animate to new value to\r\n */\r\n DataItem.prototype.setDate = function (name, date, duration) {\r\n if (!$type.isDate(date) && this.component) {\r\n date = this.component.dateFormatter.parse(date);\r\n }\r\n var currentDate = this.dates[name];\r\n if (currentDate !== date) {\r\n this.dates[name] = date;\r\n this.setValue(name, date.getTime(), duration);\r\n }\r\n };\r\n /**\r\n * Returns a Date value of the data field.\r\n *\r\n * @param name Data field name\r\n * @return Date object\r\n */\r\n DataItem.prototype.getDate = function (name) {\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"date\", {\r\n date: this.dates[name],\r\n field: name\r\n }).date;\r\n }\r\n else {\r\n return this.dates[name];\r\n }\r\n };\r\n /**\r\n * Sets a Data Item-specific visual properties to apply to related elements.\r\n *\r\n * @param name Property name\r\n * @param value Property value\r\n */\r\n DataItem.prototype.setProperty = function (name, value) {\r\n if (this.properties[name] !== value) {\r\n this.hasProperties = true;\r\n this.properties[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_7 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: name,\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_7);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a related category for this Data Item.\r\n *\r\n * @todo Review description\r\n * @param name Data field name\r\n * @param value Category\r\n */\r\n DataItem.prototype.setCategory = function (name, value) {\r\n if (!$type.isString(value)) {\r\n value = $type.castString(value);\r\n }\r\n if (this.categories[name] !== value) {\r\n this.categories[name] = value;\r\n }\r\n };\r\n /**\r\n * Clones the Data Item, including all related data.\r\n *\r\n * @return New Data Item clone\r\n */\r\n //public clone(cloneId?: string): this {\r\n //\tlet dataItem: this = super.clone(cloneId);\r\n //\tdataItem.copyFrom(this);\r\n //\treturn dataItem;\r\n //}\r\n /**\r\n * Copies all properties and related data from different data item.\r\n *\r\n * @param object Source data item\r\n */\r\n DataItem.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.dataContext) {\r\n this.dataContext = $utils.copy(source.dataContext, {});\r\n }\r\n $utils.copyProperties(source.locations, this.locations);\r\n /*\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.categories, this.categories);\r\n $utils.copyProperties(source.values, this.values);\r\n $utils.copyProperties(source.dates, this.dates);\r\n\r\n $object.each(source.values, (name, value) => {\r\n this.values[name] = $object.copy(value);\r\n });*/\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //this.events.copyFrom(source.events); // because copied in Base\r\n this.component = source.component;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"opacity\", {\r\n /**\r\n * Sets opacity for all Data Item's related elements (Sprites).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.opacity = value;\r\n });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"ignoreMinMax\", {\r\n /**\r\n * Exclude from min/max calculations?\r\n * @return Exclude from min/max calculations?\r\n */\r\n get: function () {\r\n return this._ignoreMinMax;\r\n },\r\n /**\r\n * Sets whether this data point should not be included in the scale and\r\n * minimum/maximum calculations.\r\n *\r\n * E.g. some we may want to exclude a particular data point from influencing\r\n * [[ValueAxis]] scale.\r\n *\r\n * @param value Exclude from min/max calculations?\r\n */\r\n set: function (value) {\r\n this._ignoreMinMax = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_8 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: \"ignoreMinMax\",\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_8);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, \"ignoreMinMax\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and starts an [[Animation]] to interpolate (morph) Data Item's\r\n * properties and/or values.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Animation duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n DataItem.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Handles intermediate steps when Data Item is interpolating (morphing) from\r\n * one value to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n DataItem.prototype.handleInterpolationProgress = function (event) {\r\n var animation = event.target;\r\n // it's always only one options, no need cycle\r\n var animationOptions = animation.animationOptions[0];\r\n if (animationOptions) {\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_9 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: animationOptions.dummyData\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_9);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, animationOptions.dummyData);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether Data Item has values set for all of the data fields,\r\n * supplied via argument.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fields Field list to check\r\n * @return Has values for all fields?\r\n */\r\n DataItem.prototype.hasValue = function (fields) {\r\n // todo: what about categories?\r\n for (var i = 0, len = fields.length; i < len; i++) {\r\n var values = this.values[fields[i]];\r\n if (!values || !$type.hasValue(values.value)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"depth\", {\r\n /**\r\n * Depth of the Data Item.\r\n *\r\n * In nested data structures, like TreeMap, this indicates the level this\r\n * data point is at, in relation to the parent Data Item.\r\n *\r\n * @return Depth\r\n */\r\n get: function () {\r\n if (!this.parent) {\r\n return 0;\r\n }\r\n else {\r\n return this.parent.depth + 1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"dataContext\", {\r\n /**\r\n * Sets to a reference to an original object from Component's data.\r\n *\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._dataContext;\r\n },\r\n /**\r\n * A reference to an original object in Component's data, that this Data Item\r\n * is derived from.\r\n *\r\n * @param value Original data object\r\n */\r\n set: function (value) {\r\n this._dataContext = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * adds a sprite to dataItem.sprites array\r\n * @ignore\r\n */\r\n DataItem.prototype.addSprite = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem != this) {\r\n $array.remove(sprite.dataItem.sprites, sprite);\r\n }\r\n if (!this.visible) {\r\n sprite.hide(0);\r\n }\r\n if (this.isHiding) {\r\n sprite.hide();\r\n }\r\n this.sprites.push(sprite);\r\n sprite.dataItem = this;\r\n };\r\n return DataItem;\r\n}(BaseObjectEvents));\r\nexport { DataItem };\r\n//# sourceMappingURL=DataItem.js.map","/**\r\n * Global options.\r\n */\r\nexport var options = {\r\n verbose: true,\r\n commercialLicense: false,\r\n classNamePrefix: \"amcharts-\",\r\n autoSetClassName: false,\r\n minPolylineStep: 0.5,\r\n onlyShowOnViewport: false,\r\n queue: false,\r\n autoDispose: false,\r\n licenses: [],\r\n suppressErrors: false,\r\n suppressWarnings: false,\r\n animationsEnabled: true,\r\n nonce: \"\",\r\n deferredDelay: 100,\r\n disableHoverOnTransform: \"never\",\r\n pixelPerfectPrecision: 0\r\n};\r\n//# sourceMappingURL=Options.js.map","import { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $string from \"./utils/String\";\r\nimport * as $array from \"./utils/Array\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Registry is used to store miscellaneous system-wide information, like ids,\r\n * maps, themes, and registered classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Registry = /** @class */ (function () {\r\n function Registry() {\r\n var _this = this;\r\n /**\r\n * Event dispacther.\r\n */\r\n this.events = new EventDispatcher();\r\n /**\r\n * All currently applied themes. All new chart instances created will\r\n * automatically inherit and retain System's themes.\r\n */\r\n this.themes = [];\r\n /**\r\n * List of all loaded available themes.\r\n *\r\n * Whenever a theme loads, it registers itself in System's `loadedThemes`\r\n * collection.\r\n */\r\n this.loadedThemes = {};\r\n /**\r\n * An indeternal counter used to generate unique IDs.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._uidCount = 0;\r\n /**\r\n * Keeps register of class references so that they can be instnatiated using\r\n * string key.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.registeredClasses = {};\r\n /**\r\n * Holds all generated placeholders.\r\n */\r\n this._placeholders = {};\r\n /**\r\n * A list of invalid(ated) [[Sprite]] objects that need to be re-validated\r\n * during next cycle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidSprites = {};\r\n /**\r\n * Components are added to this list when their data provider changes to\r\n * a new one or data is added/removed from their data provider.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDatas = {};\r\n /**\r\n * Components are added to this list when values of their raw data change.\r\n * Used when we want a smooth animation from one set of values to another.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidRawDatas = [];\r\n /**\r\n * Components are added to this list when values of their data changes\r\n * (but not data provider itself).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataItems = [];\r\n /**\r\n * Components are added to this list when their data range (selection) is\r\n * changed, e.g. zoomed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataRange = [];\r\n /**\r\n * A list of [[Sprite]] objects that have invalid(ated) positions, that need\r\n * to be recalculated.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidPositions = {};\r\n /**\r\n * A list of [[Container]] objects with invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidLayouts = {};\r\n /**\r\n * An array holding all active (non-disposed) top level elemens.\r\n *\r\n * When, for example, a new chart is created, its instance will be added to\r\n * this array, and will be removed when the chart is disposed.\r\n */\r\n this.baseSprites = [];\r\n /**\r\n * An UID-based map of base sprites (top-level charts).\r\n */\r\n this.baseSpritesByUid = {};\r\n /**\r\n * Queued charts (waiting for their turn) to initialize.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Daisy_chaining_multiple_charts} for more information\r\n */\r\n this.queue = [];\r\n /**\r\n * An array of deferred charts that haven't been created yet.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n * @since 4.10.0\r\n */\r\n this.deferred = [];\r\n this.uid = this.getUniqueId();\r\n this.invalidSprites.noBase = [];\r\n this.invalidDatas.noBase = [];\r\n this.invalidLayouts.noBase = [];\r\n this.invalidPositions.noBase = [];\r\n // This is needed for Angular Universal SSR\r\n if (typeof addEventListener !== \"undefined\") {\r\n // This is needed to prevent charts from being cut off when printing\r\n addEventListener(\"beforeprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.setAttribute(\"viewBox\", \"0 0 \" + svg.clientWidth + \" \" + svg.clientHeight);\r\n });\r\n });\r\n addEventListener(\"afterprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.removeAttribute(\"viewBox\");\r\n });\r\n });\r\n }\r\n }\r\n /**\r\n * Generates a unique chart system-wide ID.\r\n *\r\n * @return Generated ID\r\n */\r\n Registry.prototype.getUniqueId = function () {\r\n var uid = this._uidCount;\r\n this._uidCount += 1;\r\n return \"id-\" + uid;\r\n };\r\n Object.defineProperty(Registry.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n Registry.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n Registry.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a unique placeholder suitable for the key.\r\n *\r\n * @param key Key\r\n * @return Random string to be used as placeholder\r\n */\r\n Registry.prototype.getPlaceholder = function (key) {\r\n if ($type.hasValue(this._placeholders[key])) {\r\n return this._placeholders[key];\r\n }\r\n this._placeholders[key] = \"__amcharts_\" + key + \"_\" + $string.random(8) + \"__\";\r\n return this._placeholders[key];\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.move(this.invalidDatas[component.baseId], component);\r\n }\r\n else {\r\n $array.move(this.invalidDatas[\"noBase\"], component);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.remove(this.invalidDatas[component.baseId], component);\r\n }\r\n $array.remove(this.invalidDatas[\"noBase\"], component);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidSprites[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidSprites[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidPositions[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidPositions[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidLayouts[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidLayouts[\"noBase\"], sprite);\r\n };\r\n return Registry;\r\n}());\r\nexport { Registry };\r\n/**\r\n * A singleton global instance of [[Registry]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var registry = new Registry();\r\n/**\r\n * Returns `true` if object is an instance of the class. It's the same as `instanceof` except it doesn't need to import the class.\r\n *\r\n * @param object Object\r\n * @param name Class name\r\n * @return Is instance of class\r\n */\r\nexport function is(object, name) {\r\n var x = registry.registeredClasses[name];\r\n return x != null && object instanceof x;\r\n}\r\n//# sourceMappingURL=Registry.js.map","/**\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n */\r\nimport { __extends, __values } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { SpriteEventDispatcher } from \"./SpriteEvents\";\r\nexport { SpriteEventDispatcher };\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter, globalAdapter } from \"./utils/Adapter\";\r\nimport { Dictionary, DictionaryTemplate, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { ListDisposer, List } from \"./utils/List\";\r\nimport { MultiDisposer, Disposer, MutableValueDisposer } from \"./utils/Disposer\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport { getGhostPaper } from \"./rendering/Paper\";\r\nimport { Container } from \"./Container\";\r\nimport { Pattern } from \"./rendering/fills/Pattern\";\r\nimport { LinearGradient } from \"./rendering/fills/LinearGradient\";\r\nimport { RadialGradient } from \"./rendering/fills/RadialGradient\";\r\nimport { Color, color, toColor } from \"./utils/Color\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"./interaction/Mouse\";\r\nimport { options } from \"./Options\";\r\nimport { registry } from \"./Registry\";\r\nimport { NumberFormatter } from \"./formatters/NumberFormatter\";\r\nimport { DateFormatter } from \"./formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"./formatters/DurationFormatter\";\r\nimport { getTextFormatter } from \"./formatters/TextFormatter\";\r\nimport { Language } from \"./utils/Language\";\r\nimport { Export } from \"./export/Export\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $strings from \"./utils/Strings\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport { system } from \"./System\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\n/**\r\n * Defines list ofvisual properties\r\n */\r\nexport var visualProperties = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeOpacity\", \"strokeWidth\", \"strokeDasharray\", \"strokeDashoffset\", \"strokeLinecap\", \"strokeLinejoin\"]; // do not add opacity here, as it is used for showing/hiding\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Sprite represents any displayable element.\r\n *\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n *\r\n * [[Sprite]] class represents the a hierarchical structure. Every object that\r\n * extends [[Sprite]] can have children, that would inherit their properties,\r\n * such as language, formatters, etc.\r\n *\r\n * @see {@link SpriteState}\r\n * @see {@link ISpriteEvents} for a list of available events\r\n * @see {@link ISpriteAdapters} for a list of available Adapters\r\n *\r\n * @todo Review child elements that need to go into `_disposers`\r\n * @important\r\n */\r\nvar Sprite = /** @class */ (function (_super) {\r\n __extends(Sprite, _super);\r\n /**\r\n * Constructor:\r\n * * Creates initial node\r\n * * Sets default properties\r\n * * Creates required default states\r\n * * Inits accessibility\r\n */\r\n function Sprite() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds values for Sprite's properties.\r\n */\r\n _this.properties = {};\r\n /**\r\n * @ignore\r\n */\r\n _this._eventDispatcher = new SpriteEventDispatcher(_this);\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._bindings = {};\r\n /**\r\n * Holds indicator if this Sprite is a \"template\" to be used for creating\r\n * other Sprites from and should not be treated as full-fledged element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isTemplate = false;\r\n _this._isPath = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._inited = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized and ready.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ready = false;\r\n /**\r\n * If `sprite.hide()` is called and we have \"hidden\" state and\r\n * `transitionDuration > 0`, we set `isHiding` flag to `true` in order to\r\n * avoid restarting animations in case `hide()` method is called multiple\r\n * times.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n _this._isHidden = false;\r\n /**\r\n * This property indicates if Sprite is currently being revealed from hidden\r\n * state. This is used to prevent multiple calls to `sprite.show()` to\r\n * restart reveal animation. (if enabled)\r\n */\r\n _this.isShowing = false;\r\n /**\r\n * Indicates if this element is a standalone instance. A \"standalone\r\n * instance\" means this is a autonomous object which maintains its own\r\n * set of controls like Preloader, Export, etc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.isStandaloneInstance = false;\r\n /**\r\n * Indicates if togglable Sprite is currently active (toggled on).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isActive = false;\r\n /**\r\n * A Sprite element to use as a mask for this Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._mask = new MutableValueDisposer();\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._positionPrecision = 3;\r\n /**\r\n * An instance of [[Language]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._language = new MutableValueDisposer();\r\n /**\r\n * Holds [[Export]] object.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._exporting = new MutableValueDisposer();\r\n /**\r\n * Should this Sprite be included when exporting?\r\n */\r\n _this._exportable = true;\r\n /**\r\n * Defines bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n /**\r\n * Indicates if this element is invalid and should be re-validated (redrawn).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.invalid = false;\r\n /**\r\n * Indicates if this elements position is invalid and should be repositioned\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.positionInvalid = false;\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * Can be set for each [[SpriteState]] individually to override default\r\n * bindings.\r\n *\r\n * @see {@link SpriteState}\r\n */\r\n _this.propertyFields = {};\r\n /**\r\n * Specifies if property changes on this object should be propagated to the\r\n * objects cloned from this object.\r\n *\r\n * This setting affects property changes *after* cloning, since at the moment\r\n * of cloning all of properties from source object are copied to the clone\r\n * anyway.\r\n *\r\n * @default false\r\n */\r\n _this.applyOnClones = false;\r\n // unrotated unscaled\r\n _this._measuredWidthSelf = 0;\r\n _this._measuredHeightSelf = 0;\r\n // read only, sprite extreme coordinates\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeft = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRight = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTop = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottom = 0;\r\n // not rotated and not scaled\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeftSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRightSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTopSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottomSelf = 0;\r\n _this._isDragged = false;\r\n _this._isResized = false;\r\n /**\r\n * @deprecated Moved to [[SpriteProperties]]\r\n */\r\n _this._disabled = false;\r\n _this._internalDisabled = false;\r\n _this._updateDisabled = false;\r\n _this._internalDefaultsApplied = false;\r\n /**\r\n * Time in milliseconds after which rollout event happens when user rolls-out of the sprite. This helps to avoid flickering in some cases.\r\n */\r\n _this.rollOutDelay = 0;\r\n /**\r\n * This flag is set to `true` for the initial sprite you create and place\r\n * to the div so that we could clear all additional\r\n * sprites/containers when this sprite is disposed.\r\n *\r\n * @ignore\r\n */\r\n _this.isBaseSprite = false;\r\n /**\r\n * Indicates whether this sprite should be cloned when cloning its parent\r\n * container. We set this to `false` in those cases when a sprite is created\r\n * by the class, so that when cloning a duplicate sprite would not appear.\r\n */\r\n _this.shouldClone = true;\r\n /**\r\n * A read-only flag which indicates if a sprite has completed its initial\r\n * animation (if `showOnInit = true`).\r\n *\r\n * In case `showOnInit = false`, `appeared` is set to `true` on init.\r\n *\r\n * @readonly\r\n */\r\n _this.appeared = false;\r\n /**\r\n * [ex description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ex = 0;\r\n /**\r\n * [ey description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ey = 0;\r\n /**\r\n * Indicates if the sprite can be moved around when resizing it with two fingers (will only work if draggable = false)\r\n * @ignore\r\n */\r\n _this.dragWhileResize = false;\r\n /**\r\n * @ignore\r\n */\r\n _this.measureFailed = false;\r\n /**\r\n * If this flag is set to true, calling show() will not reveal the sprite.\r\n *\r\n * @ignore\r\n */\r\n _this.preventShow = false;\r\n /**\r\n * When cloning a sprite, if the template has it's own tooltip assigned, this tooltip is also cloned by default.\r\n * This is not good for cpu and sometimes you might only need one single tooltip for all clones. Set this to false in order not to clone tooltip.\r\n */\r\n _this.cloneTooltip = true;\r\n _this.className = \"Sprite\";\r\n _this._disposers.push(_this._eventDispatcher);\r\n // Generate a unique ID\r\n $utils.used(_this.uid);\r\n // Create SVG group to hold everything in\r\n _this.group = _this.paper.addGroup(\"g\");\r\n // Set defaults\r\n // it is better to set defauls like this in order to save invaliation calls and events\r\n _this.setPropertyValue(\"scale\", 1);\r\n _this.setPropertyValue(\"rotation\", 0);\r\n _this.setPropertyValue(\"align\", \"none\");\r\n _this.setPropertyValue(\"valign\", \"none\");\r\n _this.setPropertyValue(\"pixelPerfect\", false);\r\n _this.setPropertyValue(\"visible\", true);\r\n _this.setPropertyValue(\"tooltipPosition\", \"fixed\");\r\n _this.setPropertyValue(\"verticalCenter\", \"none\");\r\n _this.setPropertyValue(\"horizontalCenter\", \"none\");\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"marginTop\", 0);\r\n _this.setPropertyValue(\"marginBottom\", 0);\r\n _this.setPropertyValue(\"marginLeft\", 0);\r\n _this.setPropertyValue(\"marginRight\", 0);\r\n _this.setPropertyValue(\"dx\", 0);\r\n _this.setPropertyValue(\"dy\", 0);\r\n _this.setPropertyValue(\"paddingTop\", 0);\r\n _this.setPropertyValue(\"paddingBottom\", 0);\r\n _this.setPropertyValue(\"paddingRight\", 0);\r\n _this.setPropertyValue(\"paddingLeft\", 0);\r\n _this.setPropertyValue(\"togglable\", false);\r\n _this.setPropertyValue(\"hidden\", false);\r\n _this.setPropertyValue(\"urlTarget\", \"_self\");\r\n _this.setPropertyValue(\"alwaysShowTooltip\", false);\r\n _this.setPropertyValue(\"showTooltipOn\", \"hover\");\r\n _this._prevMeasuredWidth = 0;\r\n _this._prevMeasuredHeight = 0;\r\n _this._measuredWidth = 0;\r\n _this._measuredHeight = 0;\r\n _this._isMeasured = true;\r\n // Invalidate the Sprite so that renderer knows it needs to be drawn\r\n _this.invalidate();\r\n //this.states.create(\"default\").properties.opacity = 1;\r\n // Apply the theme\r\n _this.applyTheme();\r\n //this._disposers.push(this._clickable);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n // @todo Think what to do here. We can't just apply the adapter value to\r\n // property since not all of those are for properties. Commented out for\r\n // now.\r\n /*this.adapter.events.on(\"inserted\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });\r\n this.adapter.events.on(\"removed\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });*/\r\n // Add disposable dependencies to `_disposers` so they are automatically\r\n // disposed of when this object is disposed\r\n _this._disposers.push(_this.events);\r\n _this._disposers.push(_this.group);\r\n _this._disposers.push(_this._mask);\r\n _this._disposers.push(_this._language);\r\n _this._disposers.push(_this._exporting);\r\n //this._disposers.push(this._parent);\r\n //this._disposers.push(this._modal);\r\n _this._disposers.push(new Disposer(function () {\r\n $object.each(_this._bindings, function (key, value) {\r\n value.dispose();\r\n });\r\n }));\r\n _this.setPropertyValue(\"interactionsEnabled\", true);\r\n return _this;\r\n }\r\n Object.defineProperty(Sprite.prototype, \"events\", {\r\n /**\r\n * Event dispatcher.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/event-listeners/} for more info about Events\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/adapters/} for more info about Adapters\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * ELEMENT VALIDATION, INIT, AND DRAWING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * We do this here so that we can apply class names as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyTheme = function () {\r\n _super.prototype.applyTheme.call(this);\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n };\r\n /**\r\n * Returns theme(s) used by this object either set explicitly on this\r\n * element, inherited from parent, or inherited from [[System]].\r\n *\r\n * @return An array of theme references\r\n */\r\n Sprite.prototype.getCurrentThemes = function () {\r\n var themes = this._themes;\r\n if (themes) {\r\n return themes;\r\n }\r\n else {\r\n var parent_1 = this._parent;\r\n if (parent_1) {\r\n return parent_1.getCurrentThemes();\r\n }\r\n else {\r\n return registry.themes;\r\n }\r\n }\r\n };\r\n /**\r\n * Called just before element's validation, this function allows setting\r\n * defaults.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyInternalDefaults = function () {\r\n // Nothing here, but extending classes might override this function\r\n // so that they can set their defaults\r\n this._internalDefaultsApplied = true;\r\n };\r\n /**\r\n * Invalidates element.\r\n *\r\n * Object will be redrawn during the next update cycle.\r\n *\r\n * Please note that in most cases elements will auto-invalidate when needed. If\r\n * everything works, DO NOT use this method. Use it only if some changes do\r\n * not take otherwise.\r\n */\r\n Sprite.prototype.invalidate = function () {\r\n if (this.disabled || this._isTemplate || this.__disabled) {\r\n return;\r\n }\r\n // We no longer reset this on each invalidate, so that they are applied\r\n // only once, and do not overwrite user-defined settings\r\n //this._internalDefaultsApplied = false;\r\n if (!this.invalid) {\r\n this.invalid = true;\r\n registry.addToInvalidSprites(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Validates element:\r\n * * Triggers events\r\n * * Redraws the element\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validate = function () {\r\n this.dispatchImmediately(\"beforevalidated\");\r\n // prevents from drawing if topparent is 0x0\r\n /*\r\n let topParent = this.topParent;\r\n\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n this._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidate, this));\r\n }\r\n }*/\r\n // Set internal defaults\r\n if (!this._internalDefaultsApplied) {\r\n this.applyInternalDefaults();\r\n }\r\n this.beforeDraw();\r\n this.draw();\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.afterDraw();\r\n };\r\n /**\r\n * Invalidates element's position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.invalidatePosition = function () {\r\n if (this.disabled || this._isTemplate) {\r\n return;\r\n }\r\n if (!this.positionInvalid) {\r\n this.positionInvalid = true;\r\n registry.addToInvalidPositions(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Transforms the element.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validatePosition = function () {\r\n var pixelX = this.pixelX;\r\n var pixelY = this.pixelY;\r\n var dx = this.dx;\r\n var dy = this.dy;\r\n var x = pixelX + dx;\r\n var y = pixelY + dy;\r\n if (this._updateDisabled) {\r\n if (this._internalDisabled) {\r\n this.group.attr({ \"display\": \"none\" });\r\n }\r\n else {\r\n if (!this.disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n }\r\n this._updateDisabled = false;\r\n }\r\n var sizeChanged = this.measure();\r\n //if (!this.invalid) {\r\n var prevGroupTransform = this.group.transformString;\r\n this.group.moveTo({ x: x, y: y });\r\n this.group.rotation = this.rotation;\r\n if (this.nonScaling) {\r\n this.group.scale = this.scale / this.globalScale;\r\n }\r\n else {\r\n this.group.scale = this.scale;\r\n }\r\n if (prevGroupTransform != this.group.transformString || sizeChanged) {\r\n // not yet sure, this is to avoid many transforms=>container layout invalidation on initial buid\r\n if (prevGroupTransform == null) {\r\n this.dispatch(\"transformed\");\r\n }\r\n else {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n // TODO clear existing positionchanged dispatches ?\r\n this.dispatch(\"positionchanged\");\r\n if (this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") {\r\n this.updateTooltipPosition();\r\n }\r\n }\r\n //}\r\n // it might happen that x and y changed again, so we only remove if they didn't\r\n if (pixelX + dx == x && pixelY + dy == y) {\r\n registry.removeFromInvalidPositions(this);\r\n this.positionInvalid = false;\r\n }\r\n var maskRectangle = this._maskRectangle;\r\n // todo: verify this\r\n if (maskRectangle) {\r\n this._clipElement.moveTo({ x: maskRectangle.x - pixelX, y: maskRectangle.y - pixelY });\r\n }\r\n };\r\n /**\r\n * A placeholder method that is called **before** element begins to be drawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.beforeDraw = function () {\r\n };\r\n /**\r\n * A placeholder method that draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.draw = function () {\r\n };\r\n /**\r\n * A placeholder method that is called **after** element finishes drawing\r\n * itself.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.afterDraw = function () {\r\n var e_1, _a;\r\n if (this.isMeasured || this.horizontalCenter !== \"none\" || this.verticalCenter !== \"none\") {\r\n this.measureElement();\r\n }\r\n //this.applyMask();\r\n if (!this._inited) {\r\n if (this._adapterO) {\r\n try {\r\n // used to be applySVGAttrbutes here, this is more efficient\r\n for (var _b = __values(this._adapterO.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var key = _c.value;\r\n switch (key) {\r\n case \"mask\":\r\n case \"fill\":\r\n case \"opacity\":\r\n case \"fillOpacity\":\r\n case \"stroke\":\r\n case \"strokeOpacity\":\r\n case \"strokeWidth\":\r\n case \"shapeRendering\":\r\n case \"strokeDasharray\":\r\n case \"strokeDashoffset\":\r\n case \"strokeLinecap\":\r\n case \"strokeLinejoin\":\r\n case \"textDecoration\":\r\n case \"fontSize\":\r\n case \"fontFamily\":\r\n case \"fontWeight\":\r\n //case \"focusable\":\r\n //case \"tabindex\":\r\n //case \"role\":\r\n this[key] = this[key];\r\n break;\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n this.applyFilters();\r\n this.visible = this.visible;\r\n this.interactionsEnabled = this.getPropertyValue(\"interactionsEnabled\"); // can't use .interactionsEnabled as it get's parent's\r\n this._inited = true;\r\n if (!this.showOnInit) {\r\n this.appeared = true;\r\n }\r\n if (this.hidden) {\r\n this.hide(0);\r\n }\r\n this.applyMask();\r\n this.dispatch(\"validated\");\r\n this.dispatch(\"inited\");\r\n this.dispatchReady();\r\n }\r\n else {\r\n this.dispatch(\"validated\");\r\n }\r\n if (this.showTooltipOn == \"always\") {\r\n if (this.visible && !this.disabled && !this.__disabled) {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches `\"ready\"` event. Sprite dispatches it right after `\"inited\"` event.\r\n *\r\n * @ignore\r\n */\r\n Sprite.prototype.dispatchReady = function () {\r\n if (!this.isReady()) {\r\n this._ready = true;\r\n this.dispatch(\"ready\");\r\n }\r\n };\r\n /**\r\n * Triggers a re-initialization of this element.\r\n *\r\n * Will result in complete redrawing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.reinit = function () {\r\n this._inited = false;\r\n this.setState(this.defaultState);\r\n this.invalidate();\r\n };\r\n /**\r\n * Handles the situation where parent element is resized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleGlobalScale = function () {\r\n this.dispatch(\"globalscalechanged\");\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n if (this.nonScaling) {\r\n this.validatePosition();\r\n }\r\n this.updateFilterScale();\r\n };\r\n /**\r\n * Updates filter properties which might depend on scale\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateFilterScale = function () {\r\n var _this = this;\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.scale = _this.globalScale;\r\n });\r\n };\r\n /**\r\n * Removes itself from system's invalid lists.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeFromInvalids = function () {\r\n registry.removeFromInvalidSprites(this);\r\n registry.removeFromInvalidPositions(this);\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source Sprite\r\n */\r\n Sprite.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n this.isMeasured = source.isMeasured;\r\n this.states.copyFrom(source.states);\r\n if (source.filters.length > 0) {\r\n source.filters.each(function (filter) {\r\n _this.filters.push(filter.clone());\r\n });\r\n }\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //helps to avoid calling getter which creates instance\r\n if (source[\"_interaction\"]) {\r\n this.interactions.copyFrom(source.interactions);\r\n }\r\n if (source[\"_plugins\"]) {\r\n this.plugins.copyFrom(source.plugins);\r\n }\r\n this.configField = source.configField;\r\n this.applyOnClones = source.applyOnClones;\r\n // this.numberFormatter = source.numberFormatter; // todo: this creates loose number formatter and copies it to all clones. somehow we need to know if source had numberFormatter explicitly created and not just because a getter was called.\r\n //this.mask = source.mask; need to think about this, generally this causes a lot of problems\r\n this.disabled = source.disabled;\r\n this.virtualParent = source.virtualParent;\r\n this.exportable = source.exportable;\r\n //@todo: create tooltip if it's on source but not on this?\r\n //const tooltip = this._tooltip;\r\n //if (tooltip) {\r\n //\ttooltip.copyFrom(source.tooltip);\r\n //}\r\n if (source._tooltip) {\r\n if (this._tooltip) {\r\n this._tooltip.copyFrom(source.tooltip);\r\n }\r\n else {\r\n if (source.cloneTooltip) {\r\n this.tooltip = source.tooltip.clone();\r\n }\r\n else {\r\n this._tooltip = source.tooltip;\r\n }\r\n }\r\n }\r\n //if ((source)[\"_tooltip\"] && !this._tooltip) {\r\n //\tthis._tooltip = (source)[\"_tooltip\"];\r\n //}\r\n this._showSystemTooltip = source.showSystemTooltip;\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n $utils.copyProperties(source.properties, this);\r\n if (source.fillModifier) {\r\n this.fillModifier = source.fillModifier.clone();\r\n }\r\n if (source.strokeModifier) {\r\n this.strokeModifier = source.strokeModifier.clone();\r\n }\r\n if (source.focusFilter) {\r\n this.focusFilter = source.focusFilter.clone();\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Sprite.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n if (this.showTooltipOn == \"always\" && this.tooltip) {\r\n this.tooltip.hide();\r\n }\r\n this.dispatchImmediately(\"beforedisposed\");\r\n if (this.isBaseSprite) {\r\n if (this.htmlContainer) {\r\n while (this.htmlContainer.childNodes.length > 0) {\r\n this.htmlContainer.removeChild(this.htmlContainer.firstChild);\r\n }\r\n }\r\n this.isBaseSprite = false;\r\n }\r\n _super.prototype.dispose.call(this);\r\n // Clear adapters\r\n if (this._adapterO) {\r\n this._adapterO.clear();\r\n }\r\n if (this.applyOnClones) {\r\n if (this._clones) {\r\n for (var i = this._clones.length - 1; i >= 0; i--) {\r\n var clone = this._clones.getIndex(i);\r\n clone.dispose();\r\n }\r\n }\r\n }\r\n if (this._svgContainer) {\r\n this._svgContainer.dispose();\r\n }\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n this.removeFromInvalids();\r\n if (this.element) {\r\n this.element.dispose();\r\n }\r\n if (this.group) {\r\n this.group.dispose();\r\n }\r\n if (this._numberFormatter) {\r\n this._numberFormatter.dispose();\r\n }\r\n if (this._focusFilter) {\r\n this._focusFilter.dispose();\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && !(stroke instanceof Color) && stroke.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.stroke == stroke) {\r\n // do nothing\r\n }\r\n else {\r\n stroke.dispose();\r\n }\r\n }\r\n // TODO a bit hacky\r\n var fill = this.fill;\r\n if (fill && !(fill instanceof Color) && fill.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.fill == fill) {\r\n // do nothing\r\n }\r\n else {\r\n fill.dispose();\r\n }\r\n }\r\n // remove from map\r\n if ($type.hasValue(this.id)) {\r\n this.map.removeKey(this.id);\r\n }\r\n this.parent = undefined;\r\n if (this._filters) {\r\n while (this._filters.length > 0) {\r\n var filter = this._filters.getIndex(0);\r\n filter.dispose();\r\n this._filters.removeValue(filter);\r\n }\r\n }\r\n this._alwaysShowDisposers = undefined;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isTemplate\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Is template?\r\n */\r\n get: function () {\r\n return this._isTemplate;\r\n },\r\n /**\r\n * Indicates if this element is a \"template\".\r\n *\r\n * Template Sprites act only as a holders for config for other \"real\"\r\n * elements to be cloned from.\r\n *\r\n * Templates are treated differently, as they are not validated, redrawn, or\r\n * otherwise are processed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Is template?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isTemplate != value) {\r\n this._isTemplate = value;\r\n if (this instanceof Container) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.isTemplate = value;\r\n });\r\n }\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showSystemTooltip\", {\r\n /**\r\n * @return Show system tooltip?\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._showSystemTooltip)) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.showSystemTooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.showSystemTooltip;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return this._showSystemTooltip;\r\n },\r\n /**\r\n * Indicates whether the element should attempt to construct itself in a way\r\n * so that system tooltip is shown if its `readerTitle` is set.\r\n *\r\n * @param value Show system tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._showSystemTooltip != value) {\r\n this._showSystemTooltip = value;\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"topParent\", {\r\n /**\r\n * ==========================================================================\r\n * HIERARCHY AND STRUCTURE RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sprites's top-level [[Container]].\r\n *\r\n * Please note that in most cases it won't be the chart element.\r\n *\r\n * To access base chart element, use `baseSprite` instead.\r\n *\r\n * @return Top-level ascendant\r\n */\r\n get: function () {\r\n if (this._topParent) {\r\n return this._topParent;\r\n }\r\n else {\r\n if (this._parent) {\r\n return this._parent.topParent;\r\n }\r\n }\r\n },\r\n /**\r\n * @ignore\r\n * @param value {Container} top parent of a sprite\r\n */\r\n set: function (value) {\r\n this._topParent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"parent\", {\r\n /**\r\n * @return Parent container\r\n */\r\n get: function () {\r\n return this._parent;\r\n },\r\n /**\r\n * Elements' parent [[Container]].\r\n *\r\n * @param parent Parent container\r\n */\r\n set: function (parent) {\r\n if (this._isTemplate) {\r\n return;\r\n }\r\n // TODO is this needed ?\r\n $utils.used(this.paper);\r\n var oldParent = this._parent;\r\n if (oldParent != parent) {\r\n if (oldParent) {\r\n oldParent.children.removeValue(this);\r\n }\r\n this._parent = parent;\r\n if (parent) {\r\n this.topParent = parent.topParent;\r\n if (parent.isTemplate) {\r\n this.isTemplate = true;\r\n }\r\n this.baseId = parent.baseId;\r\n parent.children.push(this);\r\n // insert handler at Container invalidates + invalidatesLayout + adds to group\r\n if (this._tooltip && !this._tooltipContainer) {\r\n this._tooltip.parent = parent.tooltipContainer;\r\n }\r\n if (!this._dataItem) {\r\n this.dataItem = parent.dataItem;\r\n }\r\n this.handleAlwaysShowTooltip();\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n this.dispatchImmediately(\"parentset\");\r\n }\r\n else {\r\n this.topParent = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShow = function () {\r\n this.showTooltip();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShowTooltip = function () {\r\n var sprite = this;\r\n var oldDisposers = this._alwaysShowDisposers;\r\n if (oldDisposers) {\r\n $array.each(oldDisposers, function (oldDisposer) {\r\n oldDisposer.dispose();\r\n });\r\n }\r\n this._alwaysShowDisposers = [];\r\n if (this.showTooltipOn == \"always\") {\r\n while (sprite != undefined) {\r\n var disposer = sprite.events.on(\"visibilitychanged\", this.handleAlwaysShow, this, false);\r\n this.addDisposer(disposer);\r\n this._alwaysShowDisposers.push(disposer);\r\n sprite = sprite.parent;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"virtualParent\", {\r\n /**\r\n * @return Virtual parent\r\n */\r\n get: function () {\r\n return this._virtualParent;\r\n },\r\n /**\r\n * Element's \"virtual\" parent.\r\n *\r\n * This is required in ordere to maintain proper inheritance (like\r\n * formatters).\r\n *\r\n * Sometimes an element is a \"logical\" parent, even though it's not a direct\r\n * ascendant.\r\n *\r\n * Example: a bullet is not a child of the axis, but it would make sense\r\n * for it to inherit series' formatters.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Virtual parent\r\n */\r\n set: function (value) {\r\n this._virtualParent = value;\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves `` to correct place in DOM.\r\n *\r\n * Some elements are initially created in \"ghost\" container. When moving\r\n * those into proper place in DOM, their respective `` need to be moved\r\n * as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.appendDefs = function () {\r\n if (this.filterElement) {\r\n this.paper.appendDef(this.filterElement);\r\n }\r\n var fill = this.fill;\r\n if (fill && fill.element) {\r\n this.paper.appendDef(fill.element);\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && stroke.element) {\r\n this.paper.appendDef(stroke.element);\r\n }\r\n if (this.fillModifier && this.fill instanceof Color) {\r\n var fill_1 = this.fillModifier.modify(this.fill);\r\n if (fill_1 && fill_1.element) {\r\n this.paper.appendDef(fill_1.element);\r\n }\r\n }\r\n if (this.strokeModifier && this.stroke instanceof Color) {\r\n var stroke_1 = this.strokeModifier.modify(this.stroke);\r\n if (stroke_1 && stroke_1.element) {\r\n this.paper.appendDef(stroke_1.element);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this.paper.appendDef(this._clipPath);\r\n }\r\n if (this._exportable === false) {\r\n this.exportable = false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"map\", {\r\n /**\r\n * Returns a [[Dictionary]] which maps object ids with their respective\r\n * objects.\r\n *\r\n * Can be used to retrieve any object by id, e.g.:\r\n *\r\n * ```TypeScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n * ```JavaScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n *\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.map;\r\n }\r\n else if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"delayedMap\", {\r\n /**\r\n * @ignore\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.delayedMap;\r\n }\r\n else if (!this._delayedMap) {\r\n this._delayedMap = new Dictionary();\r\n }\r\n return this._delayedMap;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"id\", {\r\n /**\r\n * @return ID\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Element's user-defined ID.\r\n *\r\n * Will throw an Error if there already is an object with the same ID.\r\n *\r\n * Please note that above check will be performed withing the scope of the\r\n * current chart instance. It will not do checks across other chart instances\r\n * or in globally in DOM.\r\n *\r\n * Make sure the IDs are unique.\r\n *\r\n * @param value ID\r\n */\r\n set: function (value) {\r\n if (this._id != value) {\r\n this._id = value;\r\n if (this.map.hasKey(value)) {\r\n throw Error(\"Duplicate id (\" + value + \") used on multiple objects.\");\r\n }\r\n else {\r\n this.map.setKey(value, this);\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dom\", {\r\n /**\r\n * ==========================================================================\r\n * ELEMENT AND DOM TREE MANIPULATION AND MEASURING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns DOM element reference associated with this element.\r\n *\r\n * @readonly\r\n * @return DOM element\r\n */\r\n get: function () {\r\n return this.group.node;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.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 else {\r\n var parent_2 = this._parent;\r\n if (parent_2) {\r\n return parent_2.paper;\r\n }\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instance to place elements on.\r\n *\r\n * If there's no Paper set for this element, it goes up the ascendant tree\r\n * until it finds one.\r\n *\r\n * This method is used by important `addChild()` method, so it's essential\r\n * to have a [[Paper]] instance.\r\n *\r\n * If this element has a separate `htmlContainer` set, it will have a\r\n * [[Paper]] instance itself.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n this.setPaper(paper);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Sprite.prototype.setPaper = function (paper) {\r\n var oldPaper = this._paper;\r\n if (oldPaper != paper) {\r\n this._paper = paper;\r\n this.appendDefs();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"htmlContainer\", {\r\n /**\r\n * @return HTML element\r\n */\r\n get: function () {\r\n if (this._htmlContainer) {\r\n return this._htmlContainer;\r\n }\r\n else {\r\n var parent_3 = this._parent;\r\n if (parent_3) {\r\n return parent_3.htmlContainer;\r\n }\r\n }\r\n },\r\n /**\r\n * An HTML element to be used when placing wrapper element (`
`)\r\n * for the whole chart.\r\n *\r\n * This is the same for **all** elements within the same chart.\r\n *\r\n * @param htmlContainer HTML element\r\n */\r\n set: function (htmlContainer) {\r\n this._htmlContainer = htmlContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"titleElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Title element\r\n */\r\n get: function () {\r\n if (!this._titleElement) {\r\n this._titleElement = this.paper.add(\"title\");\r\n this.group.add(this._titleElement);\r\n }\r\n return this._titleElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"descriptionElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `<desc>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Desc element\r\n */\r\n get: function () {\r\n if (!this._descriptionElement) {\r\n this._descriptionElement = this.paper.add(\"desc\");\r\n this.group.add(this._descriptionElement);\r\n }\r\n return this._descriptionElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"filters\", {\r\n /**\r\n * Returns list of SVG filters (effects) applied to element. If the filter\r\n * list is not yet initilized, creates and returns an empty one.\r\n * Note, not all filters combine well with one another. We recommend using one filter per sprite.\r\n *\r\n * @return List of filters\r\n */\r\n get: function () {\r\n if (!this._filters) {\r\n this._filters = new List();\r\n // TODO only add certain events ?\r\n this._disposers.push(this._filters.events.onAll(this.applyFilters, this));\r\n this._disposers.push(new ListDisposer(this._filters));\r\n }\r\n return this._filters;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets required SVG attributes. Must be called every time an element is\r\n * redrawn so that attributes are (re)applied.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setSVGAttributes = function () {\r\n this.fill = this.fill;\r\n this.opacity = this.opacity;\r\n this.fillOpacity = this.fillOpacity;\r\n this.stroke = this.stroke;\r\n this.strokeOpacity = this.strokeOpacity;\r\n this.shapeRendering = this.shapeRendering;\r\n this.strokeDasharray = this.strokeDasharray;\r\n this.strokeDashoffset = this.strokeDashoffset;\r\n this.strokeLinecap = this.strokeLinecap;\r\n this.strokeLinejoin = this.strokeLinejoin;\r\n this.focusable = this.focusable;\r\n this.tabindex = this.tabindex;\r\n this.role = this.role;\r\n };\r\n /**\r\n * Sets an attribute directly on an SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param attribute Attribute object\r\n */\r\n Sprite.prototype.setSVGAttribute = function (attribute) {\r\n this.group.attr(attribute);\r\n };\r\n /**\r\n * Removes an attribute directly from SVG element.\r\n *\r\n * @param attribute Attribute key to remove\r\n */\r\n Sprite.prototype.removeSVGAttribute = function (attribute) {\r\n this.group.removeAttr(attribute);\r\n };\r\n /**\r\n * Sets `class` attribute of the elements SVG node.\r\n *\r\n * Uses `am4core.options.classNamePrefix`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setClassName = function () {\r\n var className = this.className;\r\n var classNamePrefix = options.classNamePrefix;\r\n if (this.element) {\r\n this.element.addClass(classNamePrefix + className);\r\n }\r\n this.group.addClass(classNamePrefix + className + \"-group\");\r\n if ($type.hasValue(this.id)) {\r\n this.group.addClass(classNamePrefix + this.id);\r\n }\r\n if (this.userClassName) {\r\n this.group.addClass(this.userClassName);\r\n }\r\n };\r\n /**\r\n * Adds an `id` attribute the the element and returns the id.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Element's ID\r\n */\r\n Sprite.prototype.uidAttr = function () {\r\n this.setSVGAttribute({ \"id\": this.uid });\r\n return this.uid;\r\n };\r\n /**\r\n * [updateClipPath description]\r\n *\r\n * @todo Description\r\n */\r\n Sprite.prototype.updateClipPath = function () {\r\n var element = this._clipElement;\r\n if (element) {\r\n element.moveTo({ x: this.mask.pixelX, y: this.mask.pixelY });\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.createClipPath = function () {\r\n if (!this._clipPath) {\r\n this._clipPath = this.paper.addGroup(\"clipPath\");\r\n this.paper.appendDef(this._clipPath);\r\n this._disposers.push(this._clipPath);\r\n var id = registry.getUniqueId();\r\n this._clipPath.attr({ \"id\": id });\r\n this.group.attr({ \"clip-path\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n };\r\n /**\r\n * Applies the mask Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyMask = function () {\r\n var mask = this.mask;\r\n if (this._clipPath && mask) {\r\n // Container\r\n if (mask instanceof Container) {\r\n this._clipElement.attr({ \"width\": $math.max(0, mask.pixelWidth), \"height\": $math.max(0, mask.pixelHeight) });\r\n var point = $utils.spritePointToSprite({ x: mask.pixelX, y: mask.pixelY }, mask.parent, this);\r\n this._clipPath.x = point.x;\r\n this._clipPath.y = point.y;\r\n }\r\n // Sprite\r\n else {\r\n if (mask.element && mask.element != this._clipElement) {\r\n this._clipElement = mask.element;\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipPath.scale = mask.scale;\r\n this._clipPath.x = mask.pixelX;\r\n this._clipPath.y = mask.pixelY;\r\n this._clipPath.rotation = mask.rotation;\r\n }\r\n }\r\n };\r\n /**\r\n * Applies filters to the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyFilters = function () {\r\n var _this = this;\r\n // we create a separate filter for each sprite as otherwise it would be impossible to animate filter.\r\n // svg doesn't support multiple filters applied to one element, so we put all the primitives to one filterElement of a sprite.\r\n if (this._filters && this._filters.length > 0) {\r\n var width_1 = 100;\r\n var height_1 = 100;\r\n if (!this.filterElement) {\r\n this.filterElement = this.paper.addGroup(\"filter\");\r\n this._disposers.push(this.filterElement);\r\n }\r\n else {\r\n this.filterElement.removeChildNodes();\r\n }\r\n this.paper.appendDef(this.filterElement);\r\n var id = \"filter-\" + this.uid;\r\n this.filterElement.attr({ \"id\": id });\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.sprite = _this;\r\n filter.paper = _this.paper;\r\n _this.filterElement.attr({ filterUnits: filter.filterUnits });\r\n filter.appendPrimitives(_this.filterElement);\r\n if (filter.width > width_1) {\r\n width_1 = filter.width;\r\n }\r\n if (filter.height > height_1) {\r\n height_1 = filter.height;\r\n }\r\n filter.scale = _this.globalScale;\r\n });\r\n var w = width_1 + \"%\";\r\n var h = height_1 + \"%\";\r\n /* temporarily removed as it is breaking tooltips on Safari @todo come back to this\r\n if (this._measuredHeight <= 1) {\r\n h = height + \"\";\r\n }\r\n\r\n if (this._measuredWidth <= 1) {\r\n h = width + \"\";\r\n }*/\r\n this.filterElement.attr({ \"width\": w, \"height\": h, \"x\": -(width_1 - 100) / 2 + \"%\", \"y\": -(height_1 - 100) / 2 + \"%\" });\r\n this.group.attr({ \"filter\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n else if (this.filterElement) {\r\n this.group.removeAttr(\"filter\");\r\n this.filterElement.removeChildNodes();\r\n }\r\n };\r\n /**\r\n * [removeClipPath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Sprite.prototype.removeClipPath = function () {\r\n if (this._clipPath) {\r\n //this._clipPath.dispose();\r\n this.removeDispose(this._clipPath);\r\n this._clipPath = undefined;\r\n }\r\n };\r\n /**\r\n * [setElement description]\r\n *\r\n * @ignore\r\n * @todo Description\r\n * @param element [description]\r\n */\r\n Sprite.prototype.setElement = function (element) {\r\n this.element = element;\r\n this.setSVGAttributes();\r\n this.applyAccessibility();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * The main element for this Sprite, usually an SVG `<g>`.\r\n *\r\n * All other sub-elements are created in it.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n // Destroy previous element if there was one before\r\n this.removeElement();\r\n // Set new element\r\n this._element = element;\r\n // Add element to group\r\n // Since we are adding Element to group, which is already in the\r\n // `.disposers` it will be removed automatically when Sprite is disposed\r\n // of\r\n this.group.add(element);\r\n if (element.node instanceof SVGPathElement) {\r\n this._isPath = true;\r\n }\r\n // This is needed if someone is setting element not in draw method but\r\n // from outside\r\n if (!this.invalid) {\r\n this.validate();\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"svgContainer\", {\r\n /**\r\n * HTML container (`<div>`) which is used to place chart's `<svg>` element\r\n * in.\r\n *\r\n * @return Container for chart elements\r\n */\r\n get: function () {\r\n if (this._svgContainer) {\r\n return this._svgContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.svgContainer;\r\n }\r\n },\r\n /**\r\n * Sets HTML container to add SVG and other chart elements to.\r\n *\r\n * @param svgContainer Container for chart elements\r\n */\r\n set: function (svgContainer) {\r\n this._svgContainer = svgContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Measures main element.\r\n *\r\n * Saves measurements into private `_bbox` property.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.measureElement = function () {\r\n if (this.element) {\r\n if (this.definedBBox) {\r\n this._bbox = this.definedBBox;\r\n }\r\n else {\r\n var svgBBox = this.element.getBBox();\r\n this._bbox = { x: svgBBox.x, y: svgBBox.y, width: svgBBox.width, height: svgBBox.height };\r\n }\r\n }\r\n };\r\n /**\r\n * Positions element according its center settings.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateCenter = function () {\r\n if (this.element) {\r\n var prevElementTransform = this.element.transformString;\r\n var bbox = this.bbox;\r\n var ex = 0;\r\n var ey = 0;\r\n var elementX = bbox.x;\r\n var elementY = bbox.y;\r\n var elementWidth = bbox.width;\r\n var elementHeigth = bbox.height;\r\n var pixelPaddingLeft = this.pixelPaddingLeft;\r\n var pixelPaddingRight = this.pixelPaddingRight;\r\n var pixelPaddingTop = this.pixelPaddingTop;\r\n var pixelPaddingBottom = this.pixelPaddingBottom;\r\n // add padding to the measured size\r\n var measuredWidth = $math.max(elementWidth + pixelPaddingLeft + pixelPaddingRight, this.pixelWidth);\r\n var measuredHeight = $math.max(elementHeigth + pixelPaddingTop + pixelPaddingBottom, this.pixelHeight);\r\n // extremes\r\n var left = bbox.x;\r\n var right = bbox.x + measuredWidth;\r\n var top_1 = bbox.y;\r\n var bottom = bbox.y + measuredHeight;\r\n var horizontalCenter = this.horizontalCenter;\r\n var verticalCenter = this.verticalCenter;\r\n switch (horizontalCenter) {\r\n case \"none\":\r\n ex = elementX + pixelPaddingLeft;\r\n break;\r\n case \"left\":\r\n ex = pixelPaddingLeft;\r\n break;\r\n case \"middle\":\r\n ex = pixelPaddingLeft - (elementWidth + pixelPaddingRight + pixelPaddingLeft) / 2;\r\n break;\r\n case \"right\":\r\n ex = -pixelPaddingRight - elementWidth;\r\n break;\r\n }\r\n switch (verticalCenter) {\r\n case \"none\":\r\n ey = elementY + pixelPaddingTop;\r\n break;\r\n case \"top\":\r\n ey = pixelPaddingTop;\r\n break;\r\n case \"middle\":\r\n ey = pixelPaddingTop - (elementHeigth + pixelPaddingBottom + pixelPaddingTop) / 2;\r\n break;\r\n case \"bottom\":\r\n ey = -pixelPaddingBottom - elementHeigth;\r\n break;\r\n }\r\n this._measuredHeight = measuredHeight;\r\n this._measuredWidth = measuredWidth;\r\n var x = $math.round(ex - elementX, this._positionPrecision, true);\r\n var y = $math.round(ey - elementY, this._positionPrecision, true);\r\n this.ex = x - pixelPaddingLeft;\r\n this.ey = y - pixelPaddingTop;\r\n this.maxLeft = left + x - pixelPaddingLeft;\r\n this.maxRight = right + x - pixelPaddingLeft;\r\n this.maxTop = top_1 + y - pixelPaddingTop;\r\n this.maxBottom = bottom + y - pixelPaddingTop;\r\n if (this.pixelPerfect && options.pixelPerfectPrecision == 0) {\r\n x -= 0.5;\r\n y -= 0.5;\r\n }\r\n this.element.moveTo({ x: x, y: y });\r\n if (prevElementTransform != this.element.transformString) {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n }\r\n };\r\n /**\r\n * Measures the whole element.\r\n *\r\n * Returns `true` if the size has changed from the last measurement.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Did the size changed from the last measurement?\r\n */\r\n Sprite.prototype.measure = function () {\r\n this.updateCenter();\r\n var measuredWidth = this._measuredWidth;\r\n var measuredHeight = this._measuredHeight;\r\n // extremes\r\n var left = this.maxLeft;\r\n var right = this.maxRight;\r\n var top = this.maxTop;\r\n var bottom = this.maxBottom;\r\n // non-parent wise size\r\n this._measuredWidthSelf = measuredWidth;\r\n this._measuredHeightSelf = measuredHeight;\r\n var positionPrecision = this._positionPrecision;\r\n this.maxLeftSelf = this.maxLeft;\r\n this.maxRightSelf = this.maxRight;\r\n this.maxTopSelf = this.maxTop;\r\n this.maxBottomSelf = this.maxBottom;\r\n // if a sprite is rotated or scaled, calculate measured size after transformations\r\n if (this.rotation !== 0 || this.scale !== 1 || this.nonScaling) {\r\n // not good to handleGlobalScale here.\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n var svg = this.paper.svg;\r\n var matrix = svg.createSVGMatrix();\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n if (this.nonScaling) {\r\n scale = this.scale / this.globalScale;\r\n }\r\n matrix.a = $math.cos(rotation) * scale;\r\n matrix.c = -$math.sin(rotation) * scale;\r\n matrix.e = 0;\r\n matrix.b = $math.sin(rotation) * scale;\r\n matrix.d = $math.cos(rotation) * scale;\r\n matrix.f = 0;\r\n var p1 = svg.createSVGPoint();\r\n p1.x = left;\r\n p1.y = top;\r\n var p2 = svg.createSVGPoint();\r\n p2.x = right;\r\n p2.y = top;\r\n var p3 = svg.createSVGPoint();\r\n p3.x = right;\r\n p3.y = bottom;\r\n var p4 = svg.createSVGPoint();\r\n p4.x = left;\r\n p4.y = bottom;\r\n var pt1 = p1.matrixTransform(matrix);\r\n var pt2 = p2.matrixTransform(matrix);\r\n var pt3 = p3.matrixTransform(matrix);\r\n var pt4 = p4.matrixTransform(matrix);\r\n left = Math.min(pt1.x, pt2.x, pt3.x, pt4.x);\r\n right = Math.max(pt1.x, pt2.x, pt3.x, pt4.x);\r\n top = Math.min(pt1.y, pt2.y, pt3.y, pt4.y);\r\n bottom = Math.max(pt1.y, pt2.y, pt3.y, pt4.y);\r\n measuredWidth = right - left;\r\n measuredHeight = bottom - top;\r\n this.maxLeft = $math.round(left, positionPrecision, true);\r\n this.maxRight = $math.round(right, positionPrecision, true);\r\n this.maxTop = $math.round(top, positionPrecision, true);\r\n this.maxBottom = $math.round(bottom, positionPrecision, true);\r\n }\r\n this._measuredWidth = $math.round(measuredWidth, positionPrecision, true);\r\n this._measuredHeight = $math.round(measuredHeight, positionPrecision, true);\r\n // dispatch event\r\n if (this._measuredWidth != this._prevMeasuredWidth || this._measuredHeight != this._prevMeasuredHeight) {\r\n this._prevMeasuredHeight = this._measuredHeight;\r\n this._prevMeasuredWidth = this._measuredWidth;\r\n // TODO clear existing sizechanged dispatches ?\r\n this.dispatch(\"sizechanged\");\r\n if ((this.isHover || this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") && this.tooltip && this.tooltip.visible && ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML))) {\r\n this.updateTooltipPosition();\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * Insert this element before sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertBefore = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Insert this element after sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertAfter = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index + 1);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Removes the main SVG element.\r\n *\r\n * This does not destroy the whole Sprite element. To do that use\r\n * `dispose()` instead.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeElement = function () {\r\n // remove visual element\r\n if (this._element) {\r\n this.removeDispose(this._element);\r\n this._element = undefined;\r\n }\r\n };\r\n /**\r\n * Returns relative (percent) value of the X coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeX = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerWidth;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns relative (percent) value of the Y coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeY = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerHeight;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns an X coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return X coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelX = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerWidth * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Returns an Y coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Y coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelY = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerHeight * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Moves the element to a specified coordinates.\r\n *\r\n * Using this method is preferred method of moving element, as it saves some\r\n * CPU processing power over setting `x` and `y` properties separately.\r\n *\r\n * The method respects element's center settings. The element will be\r\n * positioned so that `point` coordinates come in whatever \"center\" of the\r\n * element is, as set in `horizontalCenter` and `verticalCenter`.\r\n *\r\n * Besides moving the element, you can also at the same time scale and\r\n * rotate the element.\r\n *\r\n * @param point New coordinates\r\n * @param rotation New rotation\r\n * @param scale New Scale\r\n */\r\n Sprite.prototype.moveTo = function (point, rotation, scale, isDragged) {\r\n if (this.isDragged && !isDragged) {\r\n return;\r\n }\r\n if (point) {\r\n if ($type.isNumber(point.x)) {\r\n this.setPropertyValue(\"x\", $math.round(point.x, this._positionPrecision, true));\r\n }\r\n if ($type.isNumber(point.y)) {\r\n this.setPropertyValue(\"y\", $math.round(point.y, this._positionPrecision, true));\r\n }\r\n }\r\n if ($type.isNumber(rotation)) {\r\n this.rotation = rotation;\r\n }\r\n if ($type.isNumber(scale)) {\r\n this.scale = scale;\r\n }\r\n // must leave this\r\n this.invalidatePosition();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"mask\", {\r\n /**\r\n * Returns [[Sprite]] element currently used as mask for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return A [[Sprite]] to use as mask\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._mask.get();\r\n }\r\n else {\r\n return this._adapterO.apply(\"mask\", this._mask.get());\r\n }\r\n },\r\n /**\r\n * Sets another [[Sprite]] element as this elements mask.\r\n *\r\n * @ignore Exclude from docs\r\n * @param mask A [[Sprite]] to use as mask\r\n */\r\n set: function (mask) {\r\n var _this = this;\r\n if (this._mask.get() !== mask) {\r\n // this is good\r\n if (mask) {\r\n this.createClipPath();\r\n if (!(mask instanceof Container)) {\r\n mask.isMeasured = false;\r\n if (mask.element) {\r\n this._clipElement = mask.element;\r\n }\r\n }\r\n else {\r\n this._clipElement = this.paper.add(\"rect\");\r\n }\r\n if (this._clipElement) {\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._mask.set(mask, new MultiDisposer([\r\n //mask.addEventListener(SpriteEvent.TRANSFORMED, this.applyMask, false, this);\r\n mask.events.on(\"maxsizechanged\", function () { if (_this.inited) {\r\n _this.applyMask();\r\n } }, undefined, false),\r\n mask.events.on(\"validated\", this.applyMask, this, false),\r\n mask.events.on(\"positionchanged\", this.applyMask, this, false)\r\n ]));\r\n this.applyMask();\r\n }\r\n else {\r\n this._mask.reset();\r\n this.group.removeAttr(\"clip-path\");\r\n this.removeClipPath();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maskRectangle\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Mask Rectangle\r\n */\r\n get: function () {\r\n return this._maskRectangle;\r\n },\r\n // you can set IRectangle as a mask instead o a sprite. Note, the changes of the object won't be monitored\r\n /**\r\n * Instead of creating a [[Sprite]] for mask, you can just use a\r\n * [[Rectangle]] by setting this accessor.\r\n *\r\n * Please note that the element will not monitor any changes to the mask\r\n * rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Mask Rectangle\r\n */\r\n set: function (rect) {\r\n if (rect) {\r\n this.createClipPath();\r\n if (!this._clipElement) {\r\n this._clipElement = this.paper.add(\"rect\");\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipElement.attr({ \"width\": rect.width, \"height\": rect.height });\r\n }\r\n else {\r\n this.removeClipPath();\r\n this._clipElement = undefined;\r\n }\r\n this._maskRectangle = rect;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isMeasured\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Was element already measured?\r\n */\r\n get: function () {\r\n return this._isMeasured;\r\n },\r\n /**\r\n * Indicates if this element was already measured.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Was element already measured?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (!value) {\r\n this._measuredWidth = 0;\r\n this._measuredHeight = 0;\r\n //this._pixelHeight = 0;\r\n //this._pixelWidth = 0;\r\n }\r\n if (this._isMeasured != value) {\r\n this._isMeasured = value;\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if the this element has any of its parts overlapping with another\r\n * element.\r\n *\r\n * @todo Description (review)\r\n * @param sprite Second element to test again\r\n * @return Overlapping?\r\n */\r\n Sprite.prototype.hitTest = function (sprite) {\r\n // validate, otherwise we will not know measuredWidth and measuredHeight\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (sprite.invalid) {\r\n sprite.validate();\r\n }\r\n var ax1 = this.pixelX + this.maxLeft;\r\n var ay1 = this.pixelY + this.maxTop;\r\n var ax2 = ax1 + this.maxRight;\r\n var ay2 = ay1 + this.maxBottom;\r\n var bx1 = sprite.pixelX + sprite.maxLeft;\r\n var by1 = sprite.pixelY + sprite.maxTop;\r\n var bx2 = bx1 + sprite.maxRight;\r\n var by2 = by1 + sprite.maxBottom;\r\n return !(bx1 > ax2 || bx2 < ax1 || by1 > ay2 || by2 < ay1);\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inited\", {\r\n /**\r\n * ==========================================================================\r\n * STATE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns `true` if Sprite has already finished initializing.\r\n *\r\n * @return Initialized?\r\n */\r\n get: function () {\r\n return this._inited;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns `true` if Sprite has already finished initializing and is ready.\r\n *\r\n * If this object is a [[Container]] it will wait for all of its children\r\n * are ready before becoming ready itself and firing a `\"ready\"` event.\r\n *\r\n * @return is ready?\r\n */\r\n Sprite.prototype.isReady = function () {\r\n return this._ready;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"states\", {\r\n /**\r\n * Returns a collection of element's available [[SpriteState]] entries.\r\n *\r\n * @see {@link SpriteState}\r\n * @return States\r\n */\r\n get: function () {\r\n if (!this._states) {\r\n var state = new SpriteState();\r\n // works\r\n this._states = new DictionaryTemplate(state);\r\n // TODO what about removeKey ?\r\n this._disposers.push(this._states.events.on(\"insertKey\", this.processState, this, false));\r\n this._disposers.push(this._states.events.on(\"setKey\", this.processState, this, false));\r\n this._disposers.push(new DictionaryDisposer(this._states));\r\n this._disposers.push(state);\r\n }\r\n return this._states;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hiddenState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"hidden\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"hidden\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"hidden\")) {\r\n var hiddenState = this.states.create(\"hidden\");\r\n hiddenState.properties.opacity = 0;\r\n hiddenState.properties.visible = false;\r\n }\r\n return this.states.getKey(\"hidden\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"defaultState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"default\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"default\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"default\")) {\r\n var defaultState = this.states.create(\"default\");\r\n defaultState.properties.opacity = 1;\r\n }\r\n return this.states.getKey(\"default\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if some key states are defined and updates Sprite properties\r\n * accordingly.\r\n *\r\n * For example if there's a state \"down\" defined for Sprite, we automatically\r\n * make it \"clickable\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param event An event which caused state list update\r\n */\r\n Sprite.prototype.processState = function (event) {\r\n var state = event.newValue;\r\n state.sprite = this;\r\n state.name = event.key;\r\n if (this.states.hasKey(\"hover\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.hoverable = true;\r\n }\r\n if (this.states.hasKey(\"down\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.clickable = true;\r\n }\r\n if (this.states.hasKey(\"focus\")) {\r\n this.focusable = true;\r\n }\r\n // Propagate the new state to clones\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_1 = clones.length;\r\n for (var i = 0; i < length_1; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n clone.states.setKey(state.name, state);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"animations\", {\r\n /**\r\n * Returns a list elements's animations currently being played.\r\n *\r\n * If the list has not been initialized it is created.\r\n *\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 /**\r\n * Converts element's local coordinates to the coordinates within the main\r\n * chart container.\r\n *\r\n * @param point Local point\r\n * @return Global point\r\n */\r\n Sprite.prototype.getSvgPoint = function (point) {\r\n try {\r\n // Calculate SVG point\r\n var bbox = this.htmlContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x - bbox.left,\r\n \"y\": point.y - bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n };\r\n /**\r\n * Creates and starts an [[Animation]] with given `animationOptions`.\r\n *\r\n * @see {@link Animation} for additional information about available options\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 Sprite.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Applies a [[SpriteState]] on this element.\r\n *\r\n * The first parameter can either be a name state or a [[SpriteState]]\r\n * instance.\r\n *\r\n * When run, this method will apply SVG properties defined in a\r\n * [[SpriteState]], but only those that are relevant to this particular\r\n * element, i.e. are in the `properties` array.\r\n *\r\n * @see {@link SpriteState}\r\n * @param value A state - name key or instance\r\n * @param transitionDuration Duration of the transition between current and new state\r\n * @param easing An easing function\r\n */\r\n Sprite.prototype.setState = function (value, transitionDuration, easing) {\r\n var state;\r\n if (value instanceof SpriteState) {\r\n this.states.setKey(value.name, value);\r\n state = value;\r\n }\r\n else {\r\n state = this.states.getKey(value);\r\n if (!state) {\r\n return;\r\n }\r\n }\r\n // stop previous transition\r\n // not good - foe expample, we are animating to some \"active\" state and in them middle \"hover\" state happens. then \"active\" stat won't be applied\r\n //if (this._transition) {\r\n //this._transition.stop();\r\n //}\r\n if (state.name == \"hover\") {\r\n if (this.isHidden) {\r\n return;\r\n }\r\n this.isHover = true;\r\n }\r\n if (state.name == \"hidden\") {\r\n this.isHiding = true;\r\n }\r\n else {\r\n if (!this.visible) {\r\n this.setVisibility(state.properties.visible || this.defaultState.properties.visible);\r\n }\r\n }\r\n if (state.name == \"active\") {\r\n this.isActive = true;\r\n }\r\n // we do not set isActive = false here if it's not active, but container does that if setStateOnChildren = true\r\n if (!$type.isNumber(transitionDuration)) {\r\n transitionDuration = state.transitionDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = state.transitionEasing;\r\n }\r\n return this.transitTo(state, transitionDuration, easing);\r\n };\r\n /**\r\n * Applies proper state based on the condition of the element. A condition is\r\n * deducted in this order:\r\n * * \"hover\" if Sprite has currently any pointers over it\r\n * * \"down\" if Sprite has any pointers (touch or mouse) currently pressed over it\r\n * * \"focus\" if Sprite has currently got focus (accessibility)\r\n * * \"hidden\" if Sprite is currently hidden\r\n *\r\n * Returns an [[Animation]] object, which is handling gradual transition from\r\n * current values of properties, to the new target state(s).\r\n *\r\n * @param duration Duration for the animation (ms)\r\n * @return [[Animation]] object which is handling the transition\r\n */\r\n Sprite.prototype.applyCurrentState = function (duration) {\r\n //if (!this.isHidden) { // this was done for hover state not to take effect if \"hidden\" is actually visible, need to think about it.\r\n var animation = this.setState(this.defaultState, duration);\r\n if (this.isHover) {\r\n animation = this.setState(\"hover\", duration);\r\n }\r\n if (this.isDown && this.interactions.downPointers.length) {\r\n animation = this.setState(\"down\", duration);\r\n }\r\n this.isFocused = this.isFocused;\r\n if (this.isActive) {\r\n animation = this.setState(\"active\", duration);\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n animation = this.setState(\"hoverActive\", duration);\r\n }\r\n }\r\n return animation;\r\n //}\r\n };\r\n /**\r\n * Starts an [[Animation]] of the properties to specific values as they are\r\n * set in `state`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param state Target State\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Transition Animation\r\n */\r\n Sprite.prototype.transitTo = function (state, duration, easing) {\r\n var _this = this;\r\n // Init\r\n var options = [], propValues = state.allValues, transition;\r\n // todo: do this for numeric/color properties only?\r\n // @todo use state.getPropertyValue instead\r\n $object.each(propValues, function (propertyName, finalValue) {\r\n var currentValue = _this[propertyName];\r\n // save current value to default state. this solves a big problem where values must be set both on sprite and default state\r\n if (finalValue != currentValue && _this.defaultState.properties[propertyName] == undefined) {\r\n _this.defaultState.properties[propertyName] = currentValue;\r\n }\r\n //if (finalValue != currentValue && $type.hasValue(finalValue)) {\r\n if (finalValue != \"__unset\") {\r\n var option = { from: currentValue, to: finalValue, property: propertyName };\r\n options.push(option);\r\n }\r\n });\r\n if (options.length > 0) {\r\n transition = this.animate(options, duration, easing);\r\n if (transition && !transition.isFinished()) {\r\n // TODO should this use events.once ?\r\n // TODO push onto _disposers array ?\r\n this._disposers.push(transition.events.on(\"animationended\", function () {\r\n _this.dispatchImmediately(\"transitionended\");\r\n }));\r\n }\r\n else {\r\n this.dispatchImmediately(\"transitionended\");\r\n }\r\n }\r\n // apply filters if set\r\n if (state.filters.length > 0) {\r\n var newFilters_1 = [];\r\n // check for the same filters\r\n $iter.each(state.filters.iterator(), function (stateFilter) {\r\n var newFilter = stateFilter.clone();\r\n newFilters_1.push(newFilter);\r\n var animationOptions = [];\r\n $iter.each(_this.filters.iterator(), function (currentFilter) {\r\n // if we have the same filters\r\n if (currentFilter.className == newFilter.className) {\r\n if (!$iter.contains(_this.defaultState.filters.iterator(), function (x) { return x.className === newFilter.className; })) {\r\n _this.defaultState.filters.push(currentFilter);\r\n }\r\n $object.each(newFilter.properties, function (propertyName, newValue) {\r\n var currentValue = currentFilter.properties[propertyName];\r\n // if values are not the same, push to animation options array\r\n if (currentValue != newValue) {\r\n animationOptions.push({ property: propertyName, from: currentValue, to: newValue });\r\n }\r\n });\r\n }\r\n });\r\n // animate to new value\r\n newFilter.animate(animationOptions, duration, easing);\r\n });\r\n this.filters.clear();\r\n this.filters.pushAll(newFilters_1);\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Returns `true` if Sprite is currently transiting from one state/value to\r\n * another.\r\n *\r\n * @return Is in transition?\r\n */\r\n Sprite.prototype.isInTransition = function () {\r\n return this.animations.length > 0;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHover\", {\r\n /**\r\n * @return Is hovered?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isHover;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has a mouse pointer currently hovering\r\n * over it, or if it has any touch pointers pressed on it.\r\n *\r\n * You can force element to be \"hovered\" manually, by setting this property\r\n * to `true`.\r\n *\r\n * @param value Is hovered?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value !== this.isHover) {\r\n if (this.isInteractive()) {\r\n this.interactions.isHover = value;\r\n if (value) {\r\n this.handleOver();\r\n }\r\n else {\r\n this.interactions.isRealHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDragged\", {\r\n /**\r\n * Returns indicator if this element is being dragged at the moment.\r\n *\r\n * @return Is dragged?\r\n */\r\n get: function () {\r\n return this._isDragged;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isResized\", {\r\n /**\r\n * Returns indicator if this element is being resized at the moment.\r\n *\r\n * @return Is resized?\r\n */\r\n get: function () {\r\n return this._isResized;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDown\", {\r\n /**\r\n * @return Is down?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isDown;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has any pointers (mouse or touch) pressing down\r\n * on it.\r\n *\r\n * @param value Is down?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isInteractive() && this.isDown != value) {\r\n this.interactions.isDown = value;\r\n if (value) {\r\n this.handleDown();\r\n }\r\n else {\r\n this.handleUp();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isFocused\", {\r\n /**\r\n * @return Is focused?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isFocused;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element is focused (possibly by tab navigation).\r\n *\r\n * @param value Is focused?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.focusable && this.isFocused != value) {\r\n if (this.isInteractive()) {\r\n this.interactions.isFocused = value;\r\n if (value === true) {\r\n this.handleFocus();\r\n }\r\n else {\r\n this.handleBlur();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isActive\", {\r\n /**\r\n * @return Is active?\r\n */\r\n get: function () {\r\n return this._isActive;\r\n },\r\n /**\r\n * Indicates if this element is currently active (toggled on) or not\r\n * (toggled off).\r\n *\r\n * @param value Is active?\r\n */\r\n set: function (value) {\r\n this.setActive(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setActive = function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isActive !== value) {\r\n this._isActive = value;\r\n if (value && this.states.hasKey(\"active\")) {\r\n this.setState(\"active\");\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n this.setState(\"hoverActive\");\r\n }\r\n }\r\n else {\r\n this.applyCurrentState();\r\n }\r\n this.dispatchImmediately(\"toggled\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"disabled\", {\r\n /**\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n //if(this._internalDisabled){\r\n //\treturn true;\r\n //}\r\n var current = this.getPropertyValue(\"disabled\");\r\n if ($type.hasValue(current)) {\r\n return current;\r\n }\r\n else {\r\n if (this.virtualParent) {\r\n return this.virtualParent.disabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.disabled;\r\n }\r\n }\r\n return false;\r\n },\r\n /**\r\n * Controls if element is disabled.\r\n *\r\n * A disabled element is hidden, and is removed from any processing, layout\r\n * calculations, and generally treated as if it does not exist.\r\n *\r\n * The element itself is not destroyed, though. Setting this back to `false`,\r\n * will \"resurrect\" the element.\r\n *\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n this.setDisabled(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setDisabled = function (value) {\r\n value = $type.toBoolean(value);\r\n var current = this.getPropertyValue(\"disabled\");\r\n if (current != value) {\r\n this.setPropertyValue(\"disabled\", value, true);\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n this.group.attr({ \"display\": \"none\" });\r\n this.dispatch(\"disabled\");\r\n }\r\n else {\r\n if (this._parent) {\r\n var group = this._parent.element;\r\n if (!group.hasChild(this.group)) {\r\n group.add(this.group);\r\n }\r\n }\r\n if (this instanceof Container) {\r\n this.deepInvalidate();\r\n if (this._background) {\r\n this._background.invalidate();\r\n }\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n if (!this.__disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n this.dispatch(\"enabled\");\r\n }\r\n this.dispatch(\"transformed\");\r\n system.requestFrame();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"__disabled\", {\r\n /**\r\n * @ignore\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n return this._internalDisabled;\r\n },\r\n /**\r\n * Internal disable method.\r\n *\r\n * Do not use it for disabling elements. Use `disabled` accessor instead.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n if (this._internalDisabled != value) {\r\n this._internalDisabled = value;\r\n this._updateDisabled = true;\r\n this.invalidatePosition(); // better use this instead of invalidate()\r\n if (!value) {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"numberFormatter\", {\r\n /**\r\n * @return A [[NumberFormatter]] instance to be used\r\n */\r\n get: function () {\r\n if (this._numberFormatter) {\r\n return this._numberFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.numberFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.numberFormatter;\r\n }\r\n this._numberFormatter = new NumberFormatter();\r\n this._numberFormatter.language = this.language;\r\n return this.numberFormatter;\r\n },\r\n /**\r\n * ==========================================================================\r\n * FORMATTERS AND OTHER EXTERNAL HELPERS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[NumberFormatter]] instance.\r\n *\r\n * This is used to format numbers.\r\n *\r\n * ```TypeScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JavaScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"numberFormatter\": {\r\n * \"numberFormat\": \"#,###.#####\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n *\r\n * @see {@link NumberFormatter} for more info on formatting numbers\r\n * @param value An instance of NumberFormatter\r\n */\r\n set: function (value) {\r\n this._numberFormatter = value;\r\n this._numberFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dateFormatter\", {\r\n /**\r\n * @return An instance of DateFormatter\r\n */\r\n get: function () {\r\n if (this._dateFormatter) {\r\n return this._dateFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.dateFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.dateFormatter;\r\n }\r\n this._dateFormatter = new DateFormatter();\r\n this._dateFormatter.language = this.language;\r\n return this.dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] instance.\r\n *\r\n * This is used to format dates, e.g. on a date axes, balloons, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JavaScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dateFormatter\": {\r\n * \"dateFormat\": \"yyyy-MM-dd\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DateFormatter} for more info on dates formatting\r\n * @param value An instance of DateFormatter\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n this._dateFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"durationFormatter\", {\r\n /**\r\n * @return An instance of DurationFormatter\r\n */\r\n get: function () {\r\n if (this._durationFormatter) {\r\n return this._durationFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.durationFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.durationFormatter;\r\n }\r\n this._durationFormatter = new DurationFormatter();\r\n this._durationFormatter.language = this.language;\r\n return this.durationFormatter;\r\n },\r\n /**\r\n * A [[DurationFormatter]] instance.\r\n *\r\n * This is used to format numbers as durations, e.g. on a value axes.\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DurationFormatter} for more info on durations\r\n * @param value An instance of DurationFormatter\r\n */\r\n set: function (value) {\r\n this._durationFormatter = value;\r\n this._durationFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"language\", {\r\n /**\r\n * @return An instance of Language\r\n */\r\n get: function () {\r\n var language = this._language.get();\r\n if (language) {\r\n return language;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.language;\r\n }\r\n else if (this._parent) {\r\n return this._parent.language;\r\n }\r\n language = new Language();\r\n this.language = language;\r\n return language;\r\n },\r\n /**\r\n * A [[Language]] instance to use for translations.\r\n *\r\n * Normally it is enough to set language for the top-most element - chart.\r\n *\r\n * All other element child elements will automatically re-use that language\r\n * object.\r\n *\r\n * @param value An instance of Language\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._language.get() !== value) {\r\n this._language.set(value, value.events.on(\"localechanged\", function (ev) {\r\n if (_this._numberFormatter) {\r\n _this._numberFormatter.language = _this.language;\r\n }\r\n if (_this._dateFormatter) {\r\n _this._dateFormatter.language = _this.language;\r\n }\r\n if (_this._durationFormatter) {\r\n _this._durationFormatter.language = _this.language;\r\n }\r\n if (_this._exporting.get()) {\r\n var exporting = _this._exporting.get();\r\n exporting.numberFormatter.language = _this.language;\r\n exporting.dateFormatter.language = _this.language;\r\n exporting.durationFormatter.language = _this.language;\r\n exporting.language = _this.language;\r\n }\r\n if (_this instanceof Container) {\r\n _this.deepInvalidate();\r\n }\r\n }));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * DATA-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Parses the string for meta tags `{tag}` and replaces them with a real\r\n * value. Supports straight up tags referring to the field in data, i.e.\r\n * `{value}` or tags with additional formatting info. E.g.:\r\n *\r\n * ```Text\r\n * {myfield.formatDate(\"yyyy-MM-dd\")}\r\n * {myfield.formatDate()}\r\n * {myfield.formatNumber(\"#,####.00\")}\r\n * {myfield.formatNumber()}\r\n * {myField.formatDuration(\"mm:ss\")}\r\n * ```\r\n *\r\n * Etc.\r\n *\r\n * This method Will automatically detect and use proper formatter for the\r\n * value.\r\n *\r\n * The source value will be looked up in various places: (in order)\r\n * * Sprite's own `dataItem`\r\n * * Sprite's properties\r\n * * Parent's `dataItem`\r\n * * Parent's properties\r\n *\r\n * @ignore Exclude from docs\r\n * @param string A string to format\r\n * @param dataItem DataItem\r\n * @return Formatted string\r\n */\r\n Sprite.prototype.populateString = function (string, dataItem) {\r\n if ($type.hasValue(string)) {\r\n string = $type.castString(string);\r\n string = getTextFormatter().escape(string);\r\n var tags = string.match(/\\{([^}]+)\\}/g);\r\n var i = void 0;\r\n if (tags) {\r\n for (i = 0; i < tags.length; i++) {\r\n var tag = tags[i].replace(/\\{([^}]+)\\}/, \"$1\");\r\n var value = this.getTagValue(tag, \"\", dataItem);\r\n if (!$type.hasValue(value)) {\r\n value = \"\";\r\n }\r\n string = string.split(tags[i]).join(value);\r\n }\r\n }\r\n string = getTextFormatter().unescape(string);\r\n }\r\n else {\r\n string = \"\";\r\n }\r\n if (!this._adapterO) {\r\n return string;\r\n }\r\n else {\r\n return this._adapterO.apply(\"populateString\", string);\r\n }\r\n };\r\n /**\r\n * Gets the value from data item and formats it according to specified format.\r\n *\r\n * If `format` is specified, it will use its contents to choose formatter for\r\n * the value. Otherwise it will select formatter accordingly to actual value\r\n * type.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Ability to force certain formatter on known numeric and date values\r\n * @see {@link NumberFormatter}\r\n * @see {@link DateFormatter}\r\n * @see {@link DurationFormatter}\r\n * @param tagName Tag name to replace\r\n * @param format Format to use\r\n * @param dataItem DataItem\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValue = function (tagName, format, dataItem) {\r\n var value;\r\n if (!$type.hasValue(dataItem)) {\r\n dataItem = this.dataItem;\r\n }\r\n // Parse parts\r\n var parts = [];\r\n var reg = /([^.]+)\\(([^)]*)\\)|([^.]+)/g;\r\n ;\r\n var matches;\r\n while (true) {\r\n matches = reg.exec(tagName);\r\n if (matches === null) {\r\n break;\r\n }\r\n if (matches[3]) {\r\n // Simple property\r\n parts.push({\r\n prop: matches[3]\r\n });\r\n }\r\n else {\r\n // Method\r\n // Parse parameters\r\n var params = [];\r\n if ($utils.trim(matches[2]) != \"\") {\r\n var reg2 = /'([^']*)'|\"([^\"]*)\"|([0-9\\-]+)/g;\r\n var matches2 = void 0;\r\n while (true) {\r\n matches2 = reg2.exec(matches[2]);\r\n if (matches2 === null) {\r\n break;\r\n }\r\n params.push(matches2[1] || matches2[2] || matches2[3]);\r\n }\r\n }\r\n parts.push({\r\n method: matches[1],\r\n params: params\r\n });\r\n }\r\n }\r\n // Check if we can retrieve the value from data item\r\n if (dataItem) {\r\n // Check values\r\n value = this.getTagValueFromObject(parts, dataItem.values);\r\n // Check properties\r\n if (!$type.hasValue(value) || $type.isObject(value)) { // isObject helps to solve problem with date axis, as for example dateX will get dateX from values object and won't get to the dateX date.\r\n value = this.getTagValueFromObject(parts, dataItem);\r\n }\r\n // Check data context\r\n var dataContext = dataItem.dataContext;\r\n if (!$type.hasValue(value) && dataContext) {\r\n value = this.getTagValueFromObject(parts, dataItem.dataContext);\r\n // Maybe it's a literal dot-separated name of the key in dataContext?\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject([{\r\n prop: tagName\r\n }], dataContext);\r\n }\r\n // scond data context level sometimes exist (tree map)\r\n if (!$type.hasValue(value) && dataContext.dataContext) {\r\n value = this.getTagValueFromObject(parts, dataContext.dataContext);\r\n }\r\n }\r\n // Check component's data item\r\n if (!$type.hasValue(value) && dataItem.component && dataItem.component.dataItem !== dataItem) {\r\n value = dataItem.component.getTagValue(tagName, format);\r\n }\r\n }\r\n // Check sprite's properties\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject(parts, this.populateStringFrom || this);\r\n }\r\n // Finally, check the parent\r\n if (!$type.hasValue(value) && this._parent) {\r\n value = this._parent.getTagValue(tagName, format);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Tries to retrieve values from properties of any object, then applies\r\n * proper formatting to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (improve)\r\n * @param parts Properties ant methods to access\r\n * @param object Source object\r\n * @param format A specific format to apply\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValueFromObject = function (parts, object, format) {\r\n var current = object;\r\n var formatApplied = false;\r\n for (var i = 0, len = parts.length; i < len; i++) {\r\n var part = parts[i];\r\n if (part.prop) {\r\n // Regular property\r\n current = current[part.prop];\r\n if (!$type.hasValue(current)) {\r\n // Not set, return undefined\r\n return;\r\n }\r\n }\r\n else {\r\n // Method\r\n switch (part.method) {\r\n case \"formatNumber\":\r\n var numberValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(numberValue)) {\r\n current = this.numberFormatter.format(numberValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDate\":\r\n var dateValue = void 0;\r\n if ($type.isString(current)) {\r\n dateValue = this.dateFormatter.parse(current);\r\n }\r\n else {\r\n dateValue = $utils.anyToDate(current);\r\n }\r\n if (!$type.isDate(dateValue) || $type.isNaN(dateValue.getTime())) {\r\n // Was not able to get date out of value, quitting and letting\r\n // calling method try another value\r\n return;\r\n }\r\n if ($type.hasValue(dateValue)) {\r\n current = this.dateFormatter.format(dateValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDuration\":\r\n var durationValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(durationValue)) {\r\n current = this.durationFormatter.format(durationValue, format || part.params[0] || undefined, part.params[1] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"urlEncode\":\r\n case \"encodeURIComponent\":\r\n current = encodeURIComponent(current);\r\n break;\r\n default:\r\n if (current[part.method]) {\r\n current[part.method].apply(this, part.params);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n // Apply default format if it wasn't applied explicitly\r\n if (!formatApplied) {\r\n var formatParts = [{\r\n method: \"\",\r\n params: format\r\n }];\r\n if (!$type.hasValue(format)) {\r\n // Format is not set\r\n // Determine from the type of the value\r\n if ($type.isNumber(current)) {\r\n formatParts[0].method = \"formatNumber\";\r\n formatParts[0].params = \"\";\r\n }\r\n else if ($type.isDate(current)) {\r\n formatParts[0].method = \"formatDate\";\r\n formatParts[0].params = \"\";\r\n }\r\n }\r\n else {\r\n // Format set\r\n // Try to determine formatter based on the format\r\n var formatterType = $utils.getFormat(format);\r\n // format\r\n if (formatterType === $strings.NUMBER) {\r\n formatParts[0].method = \"formatNumber\";\r\n }\r\n else if (formatterType === $strings.DATE) {\r\n formatParts[0].method = \"formatDate\";\r\n }\r\n else if (formatterType === $strings.DURATION) {\r\n formatParts[0].method = \"formatDuration\";\r\n }\r\n }\r\n // Apply format\r\n if (formatParts[0].method) {\r\n current = this.getTagValueFromObject(formatParts, current);\r\n }\r\n }\r\n return current;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"dataItem\", {\r\n /**\r\n * @return [[DataItem]]\r\n */\r\n get: function () {\r\n if (!this._dataItem) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.dataItem;\r\n }\r\n if (this._parent) {\r\n return this._parent.dataItem;\r\n }\r\n }\r\n return this._dataItem;\r\n },\r\n /**\r\n * A [[DataItem]] to use as element's data source.\r\n *\r\n * @todo Review type\r\n * @param dataItem DataItem\r\n */\r\n set: function (dataItem) {\r\n //an not use this[\"_dataItem\"] here, as we return parent data item if this sprite doesn't have one.\r\n // @todo:think about it\r\n this.setDataItem(dataItem);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets currently used [[DataItem]].\r\n *\r\n * If the element has also `configField` set, it will also look for any\r\n * config in DataItem's data context to apply to this element.\r\n *\r\n * @param dataItem DataItem\r\n */\r\n Sprite.prototype.setDataItem = function (dataItem) {\r\n var _this = this;\r\n if (this._dataItem != dataItem) {\r\n this._dataItem = dataItem;\r\n if (dataItem) {\r\n if (this.configField) {\r\n var dataContext_1 = dataItem.dataContext;\r\n if (dataContext_1) {\r\n this.config = dataContext_1[this.configField];\r\n if (!this.config && dataContext_1.dataContext) {\r\n this.config = dataContext_1.dataContext[this.configField];\r\n }\r\n }\r\n }\r\n var dataContext_2 = dataItem.dataContext;\r\n if (dataContext_2) {\r\n var dataContext2_1 = dataContext_2.dataContext;\r\n $object.each(this.propertyFields, function (propertyName, fieldValue) {\r\n if ($type.hasValue(dataContext_2[fieldValue])) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = dataContext_2[fieldValue];\r\n }\r\n else {\r\n if (dataContext2_1) {\r\n var value = dataContext2_1[fieldValue];\r\n if ($type.hasValue(value)) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = value;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n this.invalidate();\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * PROPERTY UTILITIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]].\r\n *\r\n * Will also apply any adapters bound to `propertyName`.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n Sprite.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n // Apply adapter\r\n if (!this._isTemplate) {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n propValue = globalAdapter.applyAll(this, propertyName, propValue);\r\n }\r\n return propValue;\r\n };\r\n Sprite.prototype.setColorProperty = function (property, value, invalidate) {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Color && currentValue instanceof Color && value.toString() == currentValue.toString()) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate);\r\n }\r\n };\r\n Sprite.prototype.setPercentProperty = function (property, value, invalidate, transform, precision, floor) {\r\n value = $type.toNumberOrPercent(value);\r\n if ($type.isNumber(value)) {\r\n if ($type.isNumber(precision)) {\r\n value = $math.round(value, precision, floor);\r\n }\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n else {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Percent && currentValue instanceof Percent && value.value == currentValue.value) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets elements's property value. Will also propagate the same property value\r\n * on all element's clones.\r\n *\r\n * @param property Property\r\n * @param value Value\r\n * @param invalidate Should the sprite be invalidated, cause it's re-rendering\r\n * @param transform Re-apply positioning of the element\r\n * @return Did the value change? It will return `true` if the new value and the old value of the property are not the same\r\n * @todo Review propagation to clones. Right now we simply check if clone is disposed before setting the same property on it. It's better to remove from clone list altogether.\r\n */\r\n Sprite.prototype.setPropertyValue = function (property, value, invalidate, transform) {\r\n if (this.properties[property] !== value && !this.isDisposed()) {\r\n this.properties[property] = value;\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_1 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: property\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_1);\r\n }\r\n if (invalidate) {\r\n this.invalidate();\r\n }\r\n if (transform) {\r\n this.invalidatePosition();\r\n }\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_2 = clones.length;\r\n for (var i = 0; i < length_2; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n //(<Sprite>clone).setPropertyValue(<any>property, value, invalidate, transform);\r\n clone[property] = value;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Sprite.prototype.bind = function (property, source, bindToProperty, modifier) {\r\n var _this = this;\r\n if (bindToProperty === void 0) { bindToProperty = property; }\r\n if ($type.hasValue(this._bindings[property])) {\r\n this._bindings[property].dispose();\r\n }\r\n // set current value\r\n this[property] = source[bindToProperty];\r\n //source.addEventListener(AMEvent.PROPERTY_CHANGED, this.handleBindings, false, this);\r\n this._bindings[property] = source.events.on(\"propertychanged\", function (event) {\r\n if (event.property === bindToProperty) {\r\n var value = source[bindToProperty];\r\n if (modifier) {\r\n value = modifier(value);\r\n }\r\n // TODO clonesById\r\n _this[property] = value;\r\n }\r\n });\r\n };\r\n /**\r\n * Sets up and obeserver function to monitor changes in particular property\r\n * or properties.\r\n *\r\n * @ignore Exclude from docs\r\n * @param property Element's property name\r\n * @param listener Handler function\r\n * @param context Context for handler function\r\n * @returns Event Disposer\r\n */\r\n Sprite.prototype.observe = function (property, listener, context, shouldClone) {\r\n var _this = this;\r\n return new MultiDisposer($array.map($array.toArray(property), function (prop) {\r\n return _this.events.on(\"propertychanged\", function (e) {\r\n if (e.property === prop) {\r\n listener.call(context, e);\r\n }\r\n }, context, shouldClone);\r\n }));\r\n };\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY-RELATED PROPERTIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies accessibility to the SVG element.\r\n *\r\n * Adds `<title>` and `<description>` elements as well as `aria-labelledby`\r\n * and `role` properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyAccessibility = function () {\r\n // Check if we need to add label and description\r\n var title = this.readerTitle, description = this.readerDescription, role = this.role, hidden = this.readerHidden, checked = this.readerChecked, controls = this.readerControls, live = this.readerLive, orientation = this.readerOrientation, valueNow = this.readerValueNow, valueText = this.readerValueText;\r\n // Init label/describe ids\r\n var labelledByIds = [];\r\n var describedByIds = [];\r\n var labelledBy = this.readerLabelledBy;\r\n if (labelledBy) {\r\n labelledByIds.push(labelledBy);\r\n }\r\n var describedBy = this.readerDescribedBy;\r\n if (describedBy) {\r\n describedByIds.push(describedBy);\r\n }\r\n // Add arial-label attribute if present\r\n // If not readerTitle and labelledBy is set we will use <title> element\r\n // instead of aria-label\r\n // TODO: should we check agains this.showSystemTooltip?\r\n if (title) {\r\n if (labelledByIds.length || this.showSystemTooltip) {\r\n var titleElement = this.titleElement;\r\n var titleId = this.uid + \"-title\";\r\n if (titleElement.node.textContent != title) {\r\n titleElement.node.textContent = title;\r\n titleElement.attr({ id: titleId });\r\n }\r\n labelledByIds.push(titleId);\r\n }\r\n else {\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n this.setSVGAttribute({\r\n \"aria-label\": title\r\n });\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-label\");\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n }\r\n // Add description\r\n if (description) {\r\n var descriptionElement = this.descriptionElement;\r\n var descriptionId = this.uid + \"-description\";\r\n if (descriptionElement.node.textContent != description) {\r\n descriptionElement.node.textContent = description;\r\n descriptionElement.attr({ id: descriptionId });\r\n }\r\n describedByIds.push(descriptionId);\r\n }\r\n else if (this._descriptionElement) {\r\n this.group.removeElement(this._descriptionElement);\r\n this._descriptionElement = undefined;\r\n }\r\n // Add label and described properties\r\n if (labelledByIds.length) {\r\n this.setSVGAttribute({ \"aria-labelledby\": labelledByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-labelledby\");\r\n }\r\n if (describedByIds.length) {\r\n this.setSVGAttribute({ \"aria-describedby\": describedByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-describedby\");\r\n }\r\n // Apply role\r\n if (role) {\r\n this.setSVGAttribute({ \"role\": role });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"role\");\r\n }\r\n // Apply aria-hidden\r\n if (hidden) {\r\n this.setSVGAttribute({ \"aria-hidden\": \"true\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-hidden\");\r\n }\r\n // Apply aria-checked\r\n if (checked) {\r\n this.setSVGAttribute({ \"aria-checked\": \"true\" });\r\n }\r\n else if (checked === false) {\r\n this.setSVGAttribute({ \"aria-checked\": \"false\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-checked\");\r\n }\r\n // Apply aria-controls\r\n if (controls) {\r\n this.setSVGAttribute({ \"aria-controls\": controls });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-controls\");\r\n }\r\n // Apply aria-live\r\n if (live) {\r\n this.setSVGAttribute({ \"aria-live\": live });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-live\");\r\n }\r\n // Apply aria-orientation\r\n if (orientation) {\r\n this.setSVGAttribute({ \"aria-orientation\": orientation });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-orientation\");\r\n }\r\n // Apply aria-valuenow\r\n if (valueNow) {\r\n this.setSVGAttribute({ \"aria-valuenow\": valueNow });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuenow\");\r\n }\r\n // Apply aria-valuetext\r\n if (valueText) {\r\n this.setSVGAttribute({ \"aria-valuetext\": valueText });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuetext\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"readerTitle\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n var title = this.getPropertyValue(\"readerTitle\");\r\n if ($type.hasValue(title) && this.dataItem) {\r\n return this.populateString(title);\r\n }\r\n return title;\r\n },\r\n /**\r\n * Screen reader title of the element.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerTitle\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescription\", {\r\n /**\r\n * @return Description\r\n */\r\n get: function () {\r\n var description = this.getPropertyValue(\"readerDescription\");\r\n if ($type.hasValue(description) && this.dataItem) {\r\n return this.populateString(description);\r\n }\r\n return this.getPropertyValue(\"readerDescription\");\r\n },\r\n /**\r\n * Screen reader description of the element.\r\n *\r\n * @param value Description\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescription\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"role\", {\r\n /**\r\n * @return Role\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"role\");\r\n },\r\n /**\r\n * A WAI-ARIA role for the element.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#role_definitions} for more information on WAI-ARIA roles\r\n * @param value Role\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"role\", value)) {\r\n this.applyAccessibility();\r\n if (value == \"slider\") {\r\n this.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n this.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerHidden\", {\r\n /**\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerHidden\");\r\n },\r\n /**\r\n * Controls if element should be hidden from screen readers.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-hidden} for more information\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerHidden\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerChecked\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Checked?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerChecked\");\r\n },\r\n /**\r\n * Controls if element is currently marked as \"checked\".\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-checked} for more information\r\n * @param value Checked?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerChecked\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerControls\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerControls\");\r\n },\r\n /**\r\n * A `uid` of an element this element controls.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-controls} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerControls\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLive\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLive\");\r\n },\r\n /**\r\n * Controls accessibility setting \"aria-live\" for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLive\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLabelledBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLabelledBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLabelledBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescribedBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerDescribedBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-describedby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescribedBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerOrientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerOrientation\");\r\n },\r\n /**\r\n * Orientation of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerOrientation\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueNow\", {\r\n /**\r\n * @return Current value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueNow\");\r\n },\r\n /**\r\n * Current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueNow\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueText\", {\r\n /**\r\n * @return Current value (text)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueText\");\r\n },\r\n /**\r\n * Text representation of the current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value (text)\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueText\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"keyboardOptions\", {\r\n /**\r\n * ==========================================================================\r\n * USER INTERACTIONS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns elements keyboard options.\r\n *\r\n * @return Keyboard options\r\n */\r\n get: function () {\r\n if (!this.interactions.keyboardOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.keyboardOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.keyboardOptions;\r\n }\r\n }\r\n return this.interactions.keyboardOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"mouseOptions\", {\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @return Mouse options\r\n */\r\n get: function () {\r\n if (!this.interactions.mouseOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.mouseOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.mouseOptions;\r\n }\r\n }\r\n return this.interactions.mouseOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"interactions\", {\r\n /**\r\n * Returns (creates if necessary) an [[InteractionObject]] associated with\r\n * this element.\r\n *\r\n * [[InteractionObject]] is used to attach all kinds of user-interactions to\r\n * the element, e.g. click/touch, dragging, hovering, and similar events.\r\n *\r\n * @return Interaction object\r\n */\r\n get: function () {\r\n if (!this._interaction) {\r\n var interaction = getInteraction().getInteraction(this.dom);\r\n this._interaction = interaction;\r\n this._interaction.clickable = this.clickable;\r\n this._interaction.hoverable = this.hoverable;\r\n this._interaction.trackable = this.trackable;\r\n this._interaction.draggable = this.draggable;\r\n this._interaction.swipeable = this.swipeable;\r\n this._interaction.resizable = this.resizable;\r\n this._interaction.wheelable = this.wheelable;\r\n this._interaction.contextMenuDisabled = this.contextMenuDisabled;\r\n this._interaction.inert = this.inert;\r\n this._interaction.sprite = this;\r\n this._disposers.push(this._interaction);\r\n }\r\n return this._interaction;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns true if interactions object was created. Mostly used just to avoid creating interactions object if not needed.\r\n * @return Is Sprite interactive?\r\n */\r\n Sprite.prototype.isInteractive = function () {\r\n if (this._interaction) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusable\", {\r\n /**\r\n * @return Can element be focused?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"focusable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * ELEMENT FOCUS-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Controls if the element can gain focus.\r\n *\r\n * Focusable element will be selectable via TAB key.\r\n *\r\n * Please note, clicking it with a mouse or touching will not add focus to\r\n * it.\r\n *\r\n * Focused element will show a system-specific highlight, which might ruin\r\n * the overal look. This is why we don't focus element on click/touch.\r\n *\r\n * A default setting varies for different elements. By default all elements\r\n * are not focusable, except certain items like buttons, legend items, etc.\r\n *\r\n * @default undefined (auto)\r\n * @param value Can element be focused?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"focusable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.interactions.focusable = value;\r\n if (value) {\r\n this.setSVGAttribute({ \"focusable\": value });\r\n if (!$type.hasValue(this._tabindex)) {\r\n this.tabindex = 0;\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"focusable\");\r\n this.tabindex = undefined;\r\n }\r\n // Set focus events that would apply \"focus\" state\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-focusable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"blur\", _this.handleBlur, _this, false),\r\n _this.events.on(\"focus\", _this.handleFocus, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies filters (if set) when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleFocus = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = true;\r\n this.topParent.focusedElement = this;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.push(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a hover event as well\r\n this.isHover = true;\r\n this.handleOver();\r\n }\r\n }\r\n };\r\n /**\r\n * Removes focus filter (if set) when elementloses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleBlur = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = false;\r\n this.topParent.focusedElement = undefined;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.removeValue(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a out event as well\r\n this.isHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusFilter\", {\r\n /**\r\n * A reference to a [[Filter]] to apply to element when it gains focus.\r\n *\r\n * Normally, browsers will draw a default ugly square around focused element,\r\n * which totally makes sense because its purpose is to help identify active\r\n * element for visually impaired people.\r\n *\r\n * However, if you would rather apply a filter, so you can modify how focused\r\n * element looks like, use `focusFilter`.\r\n *\r\n * Simply set it to an anstance of [[FocusFilter]], or any other filter\r\n * object.\r\n *\r\n * ```TypeScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JavaScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"focusFilter\": {\r\n * \"type\": \"FocusFilter\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link Filter}\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 * @ignore Exclude from docs\r\n * @return Focused element filter\r\n */\r\n get: function () {\r\n /*if (!this._focusFilter) {\r\n this._focusFilter = new FocusFilter();\r\n this._disposers.push(this._focusFilter);\r\n }*/\r\n //return this._focusFilter;\r\n var focusFilter = this._focusFilter;\r\n if (focusFilter) {\r\n return focusFilter;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.focusFilter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.focusFilter;\r\n }\r\n //this._focusFilter = new FocusFilter();\r\n //this._disposers.push(this._focusFilter);\r\n },\r\n /**\r\n * @see {@link Filter}\r\n * @ignore Exclude from docs\r\n * @todo This is still experimental, don't use it\r\n */\r\n set: function (value) {\r\n this._focusFilter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOnFocus\", {\r\n /**\r\n * @return Trigger hover on focus?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverOnFocus\");\r\n },\r\n /**\r\n * If set to `true`, this element will also trigger `\"over\"` event with all\r\n * the related consequences, like \"hover\" state being applied and tooltip\r\n * being shown.\r\n *\r\n * Useful as an accessibility feature to display rollover tooltips on items\r\n * selected via keyboard.\r\n *\r\n * @param value Trigger hover on focus?\r\n * @default false\r\n */\r\n set: function (value) {\r\n if (value !== this.hoverOnFocus) {\r\n this.setPropertyValue(\"hoverOnFocus\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tabindex\", {\r\n /**\r\n * @return TAB index\r\n */\r\n get: function () {\r\n var index = this._tabindex;\r\n if (index != null) {\r\n return index;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tabindex;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tabindex;\r\n }\r\n },\r\n /**\r\n * Sets or returns TAB index.\r\n *\r\n * Tab index maintains the order in which focusable elements gain focus when\r\n * TAB key is pressed.\r\n *\r\n * Please note, tab index is not local to the chart. It affects the whole\r\n * of the page, including non-SVG elements. Maintain extreme causion when\r\n * setting tab indexes, as it affects the user experience for the whole\r\n * web page.\r\n *\r\n * @param value TAB index\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"tabindex\", value) && $type.isNumber(value)) {\r\n this.interactions.tabindex = value;\r\n this.setSVGAttribute({ \"tabindex\": value });\r\n this._tabindex = value;\r\n this.focusable = true;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"inertiaOptions\", {\r\n /**\r\n * ==========================================================================\r\n * DRAGGING AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's options to be used for inertia. This setting is\r\n * inheritable, meaning that if not set directly, it will search in all its\r\n * ascendants until very top.\r\n *\r\n * Inertia is used only if element's `inert` is set to `true`.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * Check [[IInertiaOptions]] for how you tweak inertia animations.\r\n *\r\n * @return Inertia options\r\n */\r\n get: function () {\r\n if (!this.interactions.inertiaOptions) {\r\n if (this._parent) {\r\n return this._parent.inertiaOptions;\r\n }\r\n }\r\n return this.interactions.inertiaOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"draggable\", {\r\n /**\r\n * @return `true` if element can be dragged\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"draggable\");\r\n },\r\n /**\r\n * Controls if the element is draggable.\r\n *\r\n * @param value `true` if element can be dragged\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"draggable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.draggable = value;\r\n //interaction.processDraggable(this);\r\n // Add events\r\n // @todo Maybe attach to InteractionObject's multidisposer so that\r\n // sprites events get disposed together with them?\r\n // this.interactions.disposers.getItem(\"movable\")\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-draggable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"dragstart\", _this.handleDragStart, _this, false),\r\n _this.events.on(\"drag\", _this.handleDragMove, _this, false),\r\n _this.events.on(\"dragstop\", _this.handleDragStop, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Executes when dragged element is being started to drag.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStart = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this._isDragged = true;\r\n this.hideTooltip(0);\r\n }\r\n };\r\n /**\r\n * Tell this element to start being dragged. This is useful if you want to\r\n * drag items by interactions performed not directly on the target element.\r\n *\r\n * Parameter `pointer` is highly recommended. By passing in the Pointer you\r\n * will ensure that movement is tracked for the pointer that you want. If not\r\n * supplied, the system will try to determine the most logical pointer.\r\n *\r\n * However this may fail if you have more than one pointer active, which\r\n * might happen if you have several objects being dragged on a touch device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use for movement\r\n */\r\n Sprite.prototype.dragStart = function (pointer) {\r\n //this.dragStop(pointer);\r\n //this.draggable = true;\r\n this._isDragged = true;\r\n getInteraction().dragStart(this.interactions, pointer);\r\n };\r\n /**\r\n * Executes when dragged element is being dropped.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStop = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isDragged = false;\r\n this.showTooltip();\r\n this.interactions.originalPosition = undefined;\r\n }\r\n };\r\n /**\r\n * Stops manually initiated dragging of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use as a reference\r\n */\r\n Sprite.prototype.dragStop = function (pointer, cancelled) {\r\n //this.draggable = false;\r\n this._isDragged = false;\r\n getInteraction().dragStop(this.interactions, pointer, cancelled);\r\n //this.handleDragStop();\r\n };\r\n /**\r\n * Executes when {Sprite} is being dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @todo Implement parent position offset calculation\r\n */\r\n Sprite.prototype.handleDragMove = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n var point = this.interactions.originalPosition;\r\n if (point && this._isDragged) {\r\n var globalScale = this._parent.globalScale * this.svgContainer.cssScale;\r\n this.moveTo({ x: point.x + ev.shift.x / globalScale, y: point.y + ev.shift.y / globalScale }, undefined, undefined, true);\r\n }\r\n this.dispatchImmediately(\"dragged\", ev);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inert\", {\r\n /**\r\n * @return `true` if element should use inertia when animated\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inert\");\r\n },\r\n /**\r\n * Controls if the element should use inertia when interacted with.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * @default false\r\n * @param value `true` if element should use inertia when animated\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"inert\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.inert = value;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOptions\", {\r\n /**\r\n * ==========================================================================\r\n * HOVERING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's hover options.\r\n *\r\n * @see {@link IHoverOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hoverOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hoverOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hoverOptions;\r\n }\r\n }\r\n return this.interactions.hoverOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverable\", {\r\n /**\r\n * @return `true` if element is hoverable\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverable\");\r\n },\r\n /**\r\n * Controls if the element is hoverable (hover events are registered).\r\n *\r\n * Use `over` and `out` events, to watch for those respective actions.\r\n *\r\n * @default false\r\n * @param value `true` if element can be hovered\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"hoverable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.hoverable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-hoverable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"over\", _this.handleOver, _this, false),\r\n _this.events.on(\"out\", _this.handleOut, _this, false),\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles tasks when element becomes hovered:\r\n * * Shows [[Tooltip]] if applicable\r\n * * Applies \"hover\" state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleOver = function (ev) {\r\n if (this._outTimeout) {\r\n this._outTimeout.dispose();\r\n }\r\n if (this.isHover) {\r\n if (this.states.hasKey(\"hover\")) {\r\n //this.setState(\"hover\");\r\n // This will check `isHover` and will set \"hover\" state\r\n if (!this.isHidden) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n var point = void 0;\r\n if (ev && ev.pointer) {\r\n point = $utils.documentPointToSvg(ev.pointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.showTooltip(point);\r\n }\r\n }\r\n else {\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n if (!this.isHidden && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n };\r\n /**\r\n * Handles tasks when element loses hover:\r\n *\r\n * * Hides [[Tooltip]]\r\n * * Applies default state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev [description]\r\n */\r\n Sprite.prototype.handleOut = function (ev) {\r\n var _this = this;\r\n if (this.tooltip && this.tooltip.targetSprite == this && this.tooltip.keepTargetHover) {\r\n this._outTimeout = this.setTimeout(function () {\r\n if (!_this.tooltip.isHover) {\r\n if (_this.tooltip.targetSprite == _this) {\r\n _this.hideTooltip();\r\n }\r\n _this._outTimeout = _this.setTimeout(_this.handleOutReal.bind(_this), _this.rollOutDelay);\r\n }\r\n }, 10);\r\n return;\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n this._outTimeout = this.setTimeout(this.handleOutReal.bind(this), this.rollOutDelay);\r\n };\r\n /**\r\n * [handleOutReal description]\r\n *\r\n * @ignore\r\n * @todo description\r\n */\r\n Sprite.prototype.handleOutReal = function () {\r\n if (!this.isHidden && !this.isHiding && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hitOptions\", {\r\n /**\r\n * ==========================================================================\r\n * CLICKING/TAPPING AND TOGGLING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's click (hit) options.\r\n *\r\n * Click (hit) options control things like double-click, timeouts, etc.\r\n *\r\n * @see {@link IHitOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hitOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hitOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hitOptions;\r\n }\r\n }\r\n return this.interactions.hitOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares element's after `down` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleDown = function (ev) {\r\n if (this.interactions.downPointers.length === 1) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this.interactions.originalAngle = this.rotation;\r\n this.interactions.originalScale = this.scale;\r\n if (this.states.hasKey(\"down\")) {\r\n this.setState(\"down\");\r\n }\r\n }\r\n };\r\n /**\r\n * Prepares element's after `up` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleUp = function (ev) {\r\n var _this = this;\r\n /*if (!this.isDown) {\r\n this.interactions.originalPosition = null;\r\n this.interactions.originalAngle = null;\r\n this.interactions.originalScale = null;\r\n }*/\r\n this._isResized = false;\r\n if (this.states.hasKey(\"down\")) {\r\n this.applyCurrentState();\r\n }\r\n if (this.showTooltipOn == \"hit\") {\r\n this.updateTooltipPosition(ev.pointer ? ev.pointer.point : undefined);\r\n this._disposers.push(registry.events.once(\"exitframe\", function () {\r\n _this.showTooltip();\r\n }));\r\n this._disposers.push(getInteraction().body.events.once(\"down\", function (ev) {\r\n _this.hideTooltip();\r\n }));\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"clickable\", {\r\n /**\r\n * @return {boolean}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"clickable\");\r\n },\r\n /**\r\n * Indicates if the element is clickable.\r\n *\r\n * Some type of the elements, like buttons are clickable by default.\r\n *\r\n * Most of the elements are not clickable by default.\r\n *\r\n * Use `hit`, `doublehit`, `up`, `down`, `toggled` events to watch for\r\n * respective click/touch actions.\r\n *\r\n * @param value `true` if element can be clicked\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"clickable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.clickable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-clickable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"up\", _this.handleUp, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"togglable\", {\r\n /**\r\n * @return Is togglable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"togglable\");\r\n },\r\n /**\r\n * Indicates if element can be toggled on and off by subsequent clicks/taps.\r\n *\r\n * Togglable element will alternate its `isActive` property between `true`\r\n * and `false` with each click.\r\n *\r\n * @param value Is togglable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"togglable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-togglable\", value, function () { return _this.events.on(\"hit\", _this.handleToggle, _this, false); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles toggling of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleToggle = function (ev) {\r\n this.isActive = !this.isActive;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contextMenuDisabled\");\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"contextMenuDisabled\", value)) {\r\n this.interactions.contextMenuDisabled = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"url\", {\r\n /**\r\n * @return URL\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"url\");\r\n },\r\n /**\r\n * Click-through URL for this element.\r\n *\r\n * If set, clicking/tapping this element will open the new URL in a target\r\n * window/tab as set by `urlTarget`.\r\n *\r\n * Please note that URL will be parsed by data placeholders in curly\r\n * brackets, to be populated from data. E.g.:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"url\": \"https://www.google.com/search?q={category.urlEncode()}\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @param value URL\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"url\", value)) {\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n // If URL is not empty, set up events\r\n if ($utils.isNotEmpty(value)) {\r\n this._urlDisposer = this.events.on(\"hit\", this.urlHandler, this, false);\r\n // Set other required parameters\r\n this.clickable = true;\r\n this.cursorOverStyle = MouseCursorStyle.pointer;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"baseId\", {\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this._baseId && this._parent) {\r\n this.baseId = this._parent.baseId;\r\n }\r\n return this._baseId;\r\n },\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setBaseId(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setBaseId = function (value) {\r\n if (value != this._baseId) {\r\n if (this.invalid) {\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.invalidate();\r\n }\r\n this._baseId = value;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"baseSprite\", {\r\n /**\r\n * Returns the mail chart object that this element belongs to.\r\n *\r\n * In most cases it will mean the chart object.\r\n *\r\n * Can be used to retrieve chart object in various events and adapters.\r\n *\r\n * ```TypeScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"seriesContainer\": {\r\n * \"events\": {\r\n * \"hit\": function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @readonly\r\n * @return Base chart object\r\n */\r\n get: function () {\r\n if (this.isBaseSprite) {\r\n return this;\r\n }\r\n else if (this._parent) {\r\n return this._parent.baseSprite;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"urlTarget\", {\r\n /**\r\n * @return URL target\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"urlTarget\");\r\n },\r\n /**\r\n * Target to use for URL clicks:\r\n *\r\n * * _blank\r\n * * _self (default)\r\n * * _parent\r\n * * _top\r\n * * Name of the window/frame\r\n *\r\n * Ignored if `url` is not set.\r\n *\r\n * @param value URL target\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"urlTarget\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles URL transition on element click.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An event object\r\n */\r\n Sprite.prototype.urlHandler = function (ev) {\r\n // Is URL set?\r\n if ($utils.isNotEmpty(this.url)) {\r\n // Proceed to the URL\r\n var url = this.populateString(this.url);\r\n if (this.urlTarget === \"_self\") {\r\n window.location.href = url;\r\n }\r\n else {\r\n window.open(url, this.urlTarget);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"swipeOptions\", {\r\n /**\r\n * ==========================================================================\r\n * SWIPING GESTURE TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's swipe gesture options.\r\n *\r\n * @return Swipe gesture options\r\n */\r\n get: function () {\r\n if (!this.interactions.swipeOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.swipeOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.swipeOptions;\r\n }\r\n }\r\n return this.interactions.swipeOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"swipeable\", {\r\n /**\r\n * @return Element swipable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"swipeable\");\r\n },\r\n /**\r\n * Controls if element is swipeable.\r\n *\r\n * Swipable element will invoke `swipe`, `swipeleft` and `swiperight` events,\r\n * when quick horizontal drag action is performed with either mouse or touch.\r\n *\r\n * Please note that combining swipe and drag is possible, however will incur\r\n * a slight but noticeable delay in drag start.\r\n *\r\n * @param value Element swipable?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"swipeable\", value)) {\r\n this.applyCursorStyle();\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.swipeable = value;\r\n }\r\n //interaction.processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"trackable\", {\r\n /**\r\n * @return Track cursor movement over element?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"trackable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POINTER TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element is trackable (mouse position over it is reported to\r\n * event listeners).\r\n *\r\n * Will invoke `track` events whenever pointer (cursor) changes position\r\n * while over element.\r\n *\r\n * Please note, touch devices will also invoke `track` events when touch\r\n * point is moved while holding down on a trackable element.\r\n *\r\n * @param value Track cursor movement over element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"trackable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.trackable = value;\r\n }\r\n //interaction.processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"wheelable\", {\r\n /**\r\n * @return Mouse wheel events enabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wheelable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * MOUSE-WHEEL RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element can be interacted with mouse wheel.\r\n *\r\n * Will invoke `wheel`, `wheelup`, `wheeldown`, `wheelleft`, and `wheelright`\r\n * events when using mouse wheel over the element.\r\n *\r\n * @param value Mouse wheel events enabled?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"wheelable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.wheelable = value;\r\n }\r\n //interaction.processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"resizable\", {\r\n /**\r\n * @return Element resizable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"resizable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * RESIZE\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if this element is resizable.\r\n *\r\n * Enabling resize will turn on various interactions on the element. Their\r\n * actual functionality will depend on other properties.\r\n *\r\n * If the element also `draggable`, resize will only happen with two points\r\n * of contact on a touch device.\r\n *\r\n * If the element is not draggable, resize can be performed with just one\r\n * point of contact, touch or mouse.\r\n *\r\n * Will invoke `resize` event every time the size of the element changes.\r\n *\r\n * @param value Element resizable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"resizable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.resizable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-resizable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"resize\", _this.handleResize, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles resize intermediate step.\r\n *\r\n * By default this method resizes actual element. Each element, can override\r\n * this method to implement their own resize logic.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleResize = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isResized = true;\r\n this.scale = this.interactions.originalScale * ev.scale;\r\n this.validatePosition();\r\n /*center: (io.draggable\r\n ? $math.getMidPoint(point1, point2)\r\n : {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n })*/\r\n //this.moveTo(this.originalPosition.x + ev.shift.x, this.originalPosition.y + ev.shift.y);\r\n if (this.draggable || this.dragWhileResize) {\r\n this._isDragged = false;\r\n var svgPoint1 = $utils.documentPointToSvg(ev.point1, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgPoint2 = $utils.documentPointToSvg(ev.point2, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgMidPoint = $math.getMidPoint(svgPoint1, svgPoint2);\r\n var parentPoint1 = $utils.documentPointToSprite(ev.startPoint1, this._parent);\r\n var parentPoint2 = $utils.documentPointToSprite(ev.startPoint2, this._parent);\r\n var originalPosition = this.interactions.originalPosition;\r\n var originalScale = this.interactions.originalScale;\r\n if (originalPosition) {\r\n var spritePoint1 = { x: (parentPoint1.x - originalPosition.x) / originalScale, y: (parentPoint1.y - originalPosition.y) / originalScale };\r\n var spritePoint2 = { x: (parentPoint2.x - originalPosition.x) / originalScale, y: (parentPoint2.y - originalPosition.y) / originalScale };\r\n var spriteMidPoint = $math.getMidPoint(spritePoint1, spritePoint2);\r\n var parentPoint = $utils.svgPointToSprite(svgMidPoint, this._parent);\r\n this.moveTo({ x: parentPoint.x - spriteMidPoint.x * this.scale, y: parentPoint.y - spriteMidPoint.y * this.scale }, undefined, undefined, true);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"cursorOptions\", {\r\n /**\r\n * ==========================================================================\r\n * MOUSE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's cursor options.\r\n *\r\n * Cursor options usually define cursor style for various states of the\r\n * hovered element.\r\n *\r\n * Elements inherit `cursorOptions` from their parents if they don't have\r\n * them set explicitly.\r\n *\r\n * @see {@link ICursorOptions} for a list of available options\r\n * @return Cursor options\r\n */\r\n get: function () {\r\n if (!this.interactions.cursorOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.cursorOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.cursorOptions;\r\n }\r\n }\r\n return this.interactions.cursorOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorOverStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor on hover.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorOverStyle\": \"pointer\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n if (!this.cursorOptions.overStyle) {\r\n this.interactions.cursorOptions = {\r\n defaultStyle: this.cursorOptions.defaultStyle\r\n };\r\n }\r\n this.cursorOptions.overStyle = style;\r\n getInteraction().applyCursorOverStyle(this.interactions);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorDownStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor when button is pressed down.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorDownStyle\": \"grabbing\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n this.cursorOptions.downStyle = style;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies default cursor styles for interactable elements.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Determine if this is necessary. Maybe let's not apply any cursor styles by default\r\n */\r\n Sprite.prototype.applyCursorStyle = function () {\r\n // Draggable styles\r\n /*if (this.draggable) {\r\n\r\n if (!$type.hasValue(this.cursorOptions.overStyle)) {\r\n this.cursorOptions.overStyle = MouseCursorStyle.grab;\r\n }\r\n\r\n if (!$type.hasValue(this.cursorOptions.downStyle)) {\r\n this.cursorOptions.downStyle = MouseCursorStyle.grabbing;\r\n }\r\n }*/\r\n };\r\n Object.defineProperty(Sprite.prototype, \"interactionsEnabled\", {\r\n /**\r\n * @return Is interaction enabled for this element?\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"interactionsEnabled\");\r\n if (value === false) {\r\n return false;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.interactionsEnabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.interactionsEnabled;\r\n }\r\n return true;\r\n },\r\n /**\r\n * Setting this to `false` will effectively disable all interactivity on the\r\n * element.\r\n *\r\n * @param value Is interaction enabled for this element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"interactionsEnabled\", value)) {\r\n var pointerEvents = null; // must be null, not \"null\"!\r\n if (!value) {\r\n pointerEvents = \"none\";\r\n }\r\n else {\r\n // this is for IE\r\n this.group.node.style.pointerEvents = \"\";\r\n }\r\n this.group.node.style.pointerEvents = pointerEvents;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"exporting\", {\r\n /**\r\n * @return Export instance\r\n */\r\n get: function () {\r\n return this.getExporting();\r\n },\r\n /**\r\n * ==========================================================================\r\n * EXPORT-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * An [[Export]] instance.\r\n *\r\n * Used to access API of the chart export functionality.\r\n *\r\n * If `exporting` is not set, the element inherits [[Export]] instance from\r\n * its parents.\r\n *\r\n * Upon request, if no parent has such instance, a new one is created, using\r\n * default settings, what in most cases is just enough.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/} for more info about exporting\r\n * @param exp Export\r\n */\r\n set: function (exp) {\r\n this._exporting.set(exp, exp);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * This is here as a method so that inheriting classes could override it.\r\n *\r\n * @return Export instance\r\n */\r\n Sprite.prototype.getExporting = function () {\r\n var _export = this._exporting.get();\r\n if (_export) {\r\n return _export;\r\n }\r\n else {\r\n if (this.isStandaloneInstance || !this._parent) {\r\n _export = new Export(this.svgContainer.SVGContainer);\r\n _export.sprite = this;\r\n _export.language = this.language;\r\n _export.numberFormatter = this.numberFormatter;\r\n _export.dateFormatter = this.dateFormatter;\r\n _export.durationFormatter = this.durationFormatter;\r\n this._exporting.set(_export, _export);\r\n }\r\n else {\r\n return this._parent.exporting;\r\n }\r\n }\r\n return _export;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"exportable\", {\r\n /**\r\n * @return Export?\r\n */\r\n get: function () {\r\n return this._exportable;\r\n /*const svgContainer = this.svgContainer;\r\n return !svgContainer || $array.indexOf(svgContainer.nonExportableSprites, this) == -1;*/\r\n },\r\n /**\r\n * If set to `false` this element will be omitted when exporting the chart\r\n * to an image.\r\n *\r\n * @default true\r\n * @param value Export?\r\n */\r\n set: function (value) {\r\n var svgContainer = this.svgContainer;\r\n this._exportable = value;\r\n if (svgContainer) {\r\n if (value) {\r\n $array.remove(svgContainer.nonExportableSprites, this);\r\n }\r\n else if ($array.indexOf(svgContainer.nonExportableSprites, this) == -1) {\r\n svgContainer.nonExportableSprites.push(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Private method to be used for \"classPrefix\" adapter for modals/popups.\r\n *\r\n * @param value Prefix\r\n */\r\n Sprite.prototype.modalPrefix = function (value) {\r\n value = options.classNamePrefix + value;\r\n return value;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"modal\", {\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var modal = svgContainer.modal;\r\n if (!modal.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n modal.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return modal;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n Sprite.prototype.openModal = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openModal(text, title);\r\n }\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n Sprite.prototype.closeModal = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeModal();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var popups = svgContainer.popups;\r\n popups.template.sprite = this;\r\n if (!popups.template.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n popups.template.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return popups;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n Sprite.prototype.openPopup = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openPopup(text, title);\r\n }\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n Sprite.prototype.closeAllPopups = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeAllPopups();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"x\", {\r\n /**\r\n * @return X coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"x\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POSITIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Element's absolute or relative X coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value X coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"x\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelX\", {\r\n /**\r\n * Returns element's current absolute X coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelX(this.x), this.minX, this.maxX);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelX\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeX\", {\r\n /**\r\n * Returns element's current relative X coordinate in [[Percent]].\r\n *\r\n * @return X coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.x);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeX\", this.getRelativeX(this.x));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minX\");\r\n },\r\n /**\r\n * The smallest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxX\");\r\n },\r\n /**\r\n * The biggest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"y\");\r\n },\r\n /**\r\n * Element's absolute or relative Y coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value Y coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"y\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelY\", {\r\n /**\r\n * Returns element's current absolute Y coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelY(this.y), this.minY, this.maxY);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelY\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeY\", {\r\n /**\r\n * Returns element's current relative Y coordinate in [[Percent]].\r\n *\r\n * @readonly\r\n * @return Y coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.y);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeY\", this.getRelativeX(this.y));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minY\");\r\n },\r\n /**\r\n * The smallest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxY\");\r\n },\r\n /**\r\n * The biggest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dx\");\r\n },\r\n /**\r\n * A horizontal offset for the element in pixels.\r\n *\r\n * Can be negative value for offset to the left.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dx\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dy\");\r\n },\r\n /**\r\n * A vertical offset for the element in pixels.\r\n *\r\n * Can be negative value for offset upwards.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dy\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation (0-360)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"rotation\");\r\n },\r\n /**\r\n * Rotation of the element in degrees. (0-360)\r\n *\r\n * Note: For convenience purposes, negative values (for counter-clockwise\r\n * rotation) and values exceeding 360 can also be used.\r\n *\r\n * @param value Rotation (0-360)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"rotation\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"align\", {\r\n /**\r\n * @return Horizontal align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"align\");\r\n },\r\n /**\r\n * Controls horizontal alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Horizontal align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"align\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"valign\", {\r\n /**\r\n * @return Vertical align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"valign\");\r\n },\r\n /**\r\n * Controls vertical alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Vertical align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"valign\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"horizontalCenter\", {\r\n /**\r\n * @return Horizontal center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"horizontalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a horizontal center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Horizontal center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"horizontalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"verticalCenter\", {\r\n /**\r\n * @return Vertical center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"verticalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a vertical center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Vertical center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"verticalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxWidth\", {\r\n /**\r\n * @return Maximum width (px)\r\n */\r\n get: function () {\r\n var maxWidth = this.getPropertyValue(\"maxWidth\");\r\n if (!$type.isNumber(maxWidth)) {\r\n if (this._parent) {\r\n var parentWidth = this._parent.maxWidth;\r\n if (this._parent.layout != \"absolute\" && this.align != \"none\" && this.align != undefined) {\r\n parentWidth = parentWidth - this.pixelMarginLeft - this.pixelMarginRight;\r\n }\r\n return parentWidth;\r\n }\r\n }\r\n return maxWidth;\r\n },\r\n /**\r\n * ==========================================================================\r\n * DIMENSIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Maximum allowed width for the element in pixels.\r\n *\r\n * @param value Maximum width (px)\r\n */\r\n set: function (value) {\r\n this.setMaxWidth(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxWidth = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxWidth\", value)) {\r\n if ($type.isNumber(this.relativeWidth)) {\r\n this.invalidate();\r\n }\r\n var event_2 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_2);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"maxHeight\", {\r\n /**\r\n * @return Maximum height (px)\r\n */\r\n get: function () {\r\n var maxHeight = this.getPropertyValue(\"maxHeight\");\r\n if (!$type.isNumber(maxHeight)) {\r\n if (this._parent) {\r\n var parentHeight = this._parent.maxHeight;\r\n if (this._parent.layout != \"absolute\" && this.valign != \"none\" && this.valign != undefined) {\r\n parentHeight = parentHeight - this.pixelMarginTop - this.pixelMarginBottom;\r\n }\r\n return parentHeight;\r\n }\r\n }\r\n return maxHeight;\r\n },\r\n /**\r\n * Maximum allowed height for the element in pixels.\r\n *\r\n * @param value Maximum height (px)\r\n */\r\n set: function (value) {\r\n this.setMaxHeight(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxHeight = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxHeight\", value)) {\r\n if ($type.isNumber(this.relativeHeight)) {\r\n this.invalidate();\r\n }\r\n var event_3 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_3);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"minWidth\", {\r\n /**\r\n * @return Minimum width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minWidth\");\r\n },\r\n /**\r\n * Minimum width of the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum width (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minWidth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minHeight\", {\r\n /**\r\n * @return Minimum height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minHeight\");\r\n },\r\n /**\r\n * Minimum height for the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minHeight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"width\", {\r\n /**\r\n * @return Width (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"width\");\r\n },\r\n /**\r\n * Element's absolute or relative width.\r\n *\r\n * The width can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative width will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `width` is an accessor, which allows setting width in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelWidth` or `percentWidth`, so if\r\n * you need to add an adapter for width add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Width (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"width\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentWidth = undefined;\r\n this.relativeWidth = undefined;\r\n if (value instanceof Percent) {\r\n this.percentWidth = value.percent;\r\n if ($type.isNumber(this._pixelWidth)) {\r\n this.maxWidth = undefined;\r\n }\r\n this._pixelWidth = undefined;\r\n }\r\n else {\r\n this._pixelWidth = Number(value);\r\n //this._measuredWidth = this._pixelWidth;\r\n this.maxWidth = this._pixelWidth;\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"height\", {\r\n /**\r\n * @return height (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"height\");\r\n },\r\n /**\r\n * Element's absolute or relative height.\r\n *\r\n * The height can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative height will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `height` is an accessor, which allows setting height in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelHeight` or `percentHeight`, so if\r\n * you need to add an adapter for height add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Height (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"height\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentHeight = undefined;\r\n this._relativeHeight = undefined;\r\n if (value instanceof Percent) {\r\n this.percentHeight = value.percent;\r\n if ($type.isNumber(this._pixelHeight)) {\r\n this.maxHeight = undefined;\r\n }\r\n this._pixelHeight = undefined;\r\n }\r\n else {\r\n this._pixelHeight = Number(value);\r\n //this._measuredHeight = this._pixelHeight;\r\n this.maxHeight = this._pixelHeight; // yes, we reset maxWidth\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelWidth\", {\r\n /**\r\n * Returns element's width in pixels, if width was set. For actual width use measuredWidth property.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n var width;\r\n if ($type.isNumber(this.percentWidth)) {\r\n width = this.maxWidth;\r\n }\r\n else if ($type.isNumber(this._pixelWidth)) {\r\n width = this._pixelWidth;\r\n }\r\n else {\r\n width = 0;\r\n }\r\n var minWidth = this.minWidth;\r\n if (minWidth != null && width < minWidth) {\r\n width = minWidth;\r\n }\r\n var value = $math.round(width, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelHeight\", {\r\n /**\r\n * Returns element's height in pixels. For actual height use measuredHeight property.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n var height;\r\n if ($type.isNumber(this.percentHeight)) {\r\n height = this.maxHeight;\r\n }\r\n else if ($type.isNumber(this._pixelHeight)) {\r\n height = this._pixelHeight;\r\n }\r\n else {\r\n height = 0; //this._measuredHeightSelf;\r\n }\r\n var minHeight = this.minHeight;\r\n if (minHeight != null && height < minHeight) {\r\n height = minHeight;\r\n }\r\n var value = $math.round(height, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeWidth\", {\r\n /**\r\n * @return Relative width\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeWidth = this._relativeWidth;\r\n if ($type.isNumber(relativeWidth)) {\r\n if (!this._adapterO) {\r\n return relativeWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeWidth\", relativeWidth);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative width in [[Percent]].\r\n * @ignore\r\n *\r\n * @param value Relative width\r\n */\r\n set: function (value) {\r\n if (this._relativeWidth != value) {\r\n this._relativeWidth = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeHeight\", {\r\n /**\r\n * @return Relative height\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeHeight = this._relativeHeight;\r\n if ($type.isNumber(relativeHeight)) {\r\n if (!this._adapterO) {\r\n return relativeHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeHeight\", relativeHeight);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative height in [[Percent]].\r\n *\r\n * @param value Relative height\r\n * @ignore\r\n */\r\n set: function (value) {\r\n if (this._relativeHeight != value) {\r\n this._relativeHeight = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredWidth\", {\r\n /**\r\n * Returns element's measured width in pixels.\r\n *\r\n * A measured width is actual width of contents plus `paddingRight` and* `paddingLeft`, relative to sprite parent, meaning that\r\n * rotation and scale is taken into account.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n if (!this._adapterO) {\r\n return this._measuredWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredWidth\", this._measuredWidth);\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredWidth\", $math.fitToRange(this._measuredWidth, this.minWidth, this.maxWidth));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredHeight\", {\r\n /**\r\n * Returns elements's measured height in pixels.\r\n *\r\n * A measured height is actual height of contents plus `paddingTop` and `paddingBottom`, relative to sprite parent, meaning that\r\n * rotation and scale taken into account.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredHeight\", $math.fitToRange(this._measuredHeight, this.minHeight, this.maxHeight));\r\n if (!this._adapterO) {\r\n return this._measuredHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredHeight\", this._measuredHeight);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerWidth\", {\r\n /**\r\n * Returns element's measured width plus its left and right margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer width (px)\r\n */\r\n get: function () {\r\n var value = this.pixelWidth + this.pixelMarginRight + this.pixelMarginLeft;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerHeight\", {\r\n /**\r\n * Returns element's measured height plus its top and bottom margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer height (px)\r\n */\r\n get: function () {\r\n var value = this.pixelHeight + this.pixelMarginTop + this.pixelMarginBottom;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerWidth\", {\r\n /**\r\n * Returns element's measured inner width in pixels.\r\n *\r\n * Inner width is actual available space for content, e.g. element's width\r\n * minus horizontal padding.\r\n *\r\n * @readonly\r\n * @return Inner width (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelWidth - this.pixelPaddingRight - this.pixelPaddingLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerHeight\", {\r\n /**\r\n * Returns element's measured inner height in pixels.\r\n *\r\n * Inner height is actual available space for content, e.g. element's height\r\n * minus vertical padding.\r\n *\r\n * @readonly\r\n * @return Inner height (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"globalScale\", {\r\n /**\r\n * Returns element's current \"global\" scale.\r\n *\r\n * Scale values accumulate over hierarchy of elements.\r\n *\r\n * E.g. if a [[Container]] has `scale = 2` and it's child has a `scale = 2`,\r\n * the child's `globalScale` will be 4. (a multitude of `2 x 2`)\r\n *\r\n * @readonly\r\n * @return Global scale\r\n */\r\n get: function () {\r\n var scale = this.scale;\r\n if (this._parent) {\r\n scale = scale * this._parent.globalScale;\r\n }\r\n if (!this._adapterO) {\r\n return scale;\r\n }\r\n else {\r\n return this._adapterO.apply(\"globalScale\", scale);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"scale\", {\r\n /**\r\n * @return Scale (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"scale\");\r\n },\r\n /**\r\n * Scale of the element.\r\n *\r\n * The scale is set from 0 (element reduced to nothing) to 1 (default size).\r\n * * 2 will mean element is increased twice.\r\n * * 0.5 - reduced by 50%.\r\n *\r\n * Etc.\r\n *\r\n * @param value Scale (0-1)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n if (value != this.getPropertyValue(\"scale\")) {\r\n this.setPropertyValue(\"scale\", value, false, true);\r\n this.handleGlobalScale();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets all four margins for the element at once.\r\n *\r\n * Margins are set in pixels.\r\n *\r\n * @param top Top margin\r\n * @param right Right margin\r\n * @param bottom Bottom margin\r\n * @param left Left margin\r\n * @return Current element\r\n */\r\n Sprite.prototype.margin = function (top, right, bottom, left) {\r\n this.marginTop = top;\r\n this.marginRight = right;\r\n this.marginBottom = bottom;\r\n this.marginLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"marginLeft\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginLeft\");\r\n },\r\n /**\r\n * Left margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginRight\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginRight\");\r\n },\r\n /**\r\n * Right margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginTop\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginTop\");\r\n },\r\n /**\r\n * Top margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginBottom\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginBottom\");\r\n },\r\n /**\r\n * Bottom margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginRight\", {\r\n /**\r\n * Returns current right margin in pixels.\r\n *\r\n * @readonly\r\n * @return Right margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginRight\", {\r\n /**\r\n * Returns current relative right margin.\r\n *\r\n * @readonly\r\n * @return Relative right margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginLeft\", {\r\n /**\r\n * Returns current left margin in pixels.\r\n *\r\n * @readonly\r\n * @return Left margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginLeft\", {\r\n /**\r\n * Returns current relative left margin.\r\n *\r\n * @readonly\r\n * @return Relative left margin\r\n */\r\n get: function () {\r\n //@todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginTop\", {\r\n /**\r\n * Returns current top margin in pixels.\r\n *\r\n * @readonly\r\n * @return Top margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginTop\", {\r\n /**\r\n * Returns current relative top margin.\r\n *\r\n * @readonly\r\n * @return Relative top margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginBottom\", {\r\n /**\r\n * Returns current bottom margin in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginBottom\", {\r\n /**\r\n * Returns current relative bottom margin.\r\n *\r\n * @readonly\r\n * @return Relative bottom margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets padding for the element in pixels.\r\n *\r\n * @param top Top padding (px)\r\n * @param right Right padding (px)\r\n * @param bottom Bottom padding (px)\r\n * @param left Left padding (px)\r\n * @return Element\r\n */\r\n Sprite.prototype.padding = function (top, right, bottom, left) {\r\n this.paddingTop = top;\r\n this.paddingRight = right;\r\n this.paddingBottom = bottom;\r\n this.paddingLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"paddingLeft\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingLeft\");\r\n },\r\n /**\r\n * Left padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingRight\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingRight\");\r\n },\r\n /**\r\n * Right padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingTop\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingTop\");\r\n },\r\n /**\r\n * Top padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingBottom\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingBottom\");\r\n },\r\n /**\r\n * Bottom padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingRight\", {\r\n /**\r\n * Returns current right padding in pixels.\r\n *\r\n * @readonly\r\n * @return Right padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingRight\", {\r\n /**\r\n * Returns current relative right padding.\r\n *\r\n * @readonly\r\n * @return Relative right padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingLeft\", {\r\n /**\r\n * Returns current left padding in pixels.\r\n *\r\n * @readonly\r\n * @return Left padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingLeft\", {\r\n /**\r\n * Returns current relative left padding.\r\n *\r\n * @readonly\r\n * @return Relative left padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingTop\", {\r\n /**\r\n * Returns current top padding in pixels.\r\n *\r\n * @readonly\r\n * @return Top padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingTop\", {\r\n /**\r\n * Returns current relative top padding.\r\n *\r\n * @readonly\r\n * @return Relative top padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingBottom\", {\r\n /**\r\n * Returns current bottom padding in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingBottom\", {\r\n /**\r\n * Returns current relative bottom padding.\r\n *\r\n * @readonly\r\n * @return Relative bottom padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"path\", {\r\n /**\r\n * @return Path of a Sprite element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"path\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * APPEARANCE-RELATED PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Path of Sprite element\r\n */\r\n set: function (value) {\r\n this.setPath(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setPath = function (value) {\r\n if (this.setPropertyValue(\"path\", value)) {\r\n if (this._adapterO) {\r\n value = this._adapterO.apply(\"path\", value);\r\n }\r\n if (!this._isPath) {\r\n if (!this.element || (this.element.node && !(this.element.node instanceof SVGPathElement))) {\r\n this.element = this.paper.add(\"path\");\r\n }\r\n this._isPath = true;\r\n }\r\n if ($type.hasValue(value)) {\r\n this.element.attr({ \"d\": value });\r\n }\r\n else {\r\n this.element.removeAttr(\"d\");\r\n }\r\n this.invalidatePosition();\r\n // otherwise is 0x0\r\n if (!this.inited) {\r\n this.events.once(\"inited\", this.validatePosition, this, false);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"fillModifier\", {\r\n /**\r\n * @return Fill color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's fill, e.g. create gradients.\r\n *\r\n * @param value Fill color modifiier\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fillModifier\", value)) {\r\n this.setFill(this.fill);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeModifier\", {\r\n /**\r\n * @return Stroke color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's stroke (outline), e.g. create gradients.\r\n *\r\n * @param value Stroke color modifier\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"strokeModifier\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-9)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillOpacity\");\r\n },\r\n /**\r\n * Element's fill opacity.\r\n *\r\n * Opacity ranges from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"fillOpacity\", value)) {\r\n this.setSVGAttribute({ \"fill-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fill\", {\r\n /**\r\n * @return Fill\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fill\");\r\n },\r\n /**\r\n * Element's fill color or pattern.\r\n *\r\n * @param value Fill\r\n */\r\n set: function (value) {\r\n this.setFill(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Sprite.prototype.setFill = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"fill\", value) || this.fillModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.fillModifier) {\r\n value = this.fillModifier.modify(value);\r\n }\r\n }\r\n this.realFill = value;\r\n // todo: review this place when some Color type will be added\r\n if (value instanceof Color) {\r\n this.setSVGAttribute({ \"fill\": value.toString() });\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"fill\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var fill = value;\r\n fill.paper = this.paper;\r\n this.setSVGAttribute({ \"fill\": \"url(\\\"\" + $utils.getBaseURI() + fill.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"opacity\");\r\n },\r\n /**\r\n * Element's opacity.\r\n *\r\n * Opacity setting can range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * ATTENTION: It is highly not recommended to use `opacity` directly on the\r\n * element. The charts use `opacity` to hide/show elements, so your setting\r\n * might be lost if element is hidden and then later shown.\r\n *\r\n * Instead use methods `hide()` and `show()` to completely toggle off and on\r\n * the element.\r\n *\r\n * Or, use properties `fillOpacity` and `strokeOpacity`, if you need to make\r\n * the element semi-transparent.\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"opacity\", value)) {\r\n this.setSVGAttribute({ \"opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"stroke\", {\r\n /**\r\n * @return Stroke setting\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"stroke\");\r\n },\r\n /**\r\n * Element's stroke (outline) color or pattern.\r\n *\r\n * @param value Stroke setting\r\n */\r\n set: function (value) {\r\n this.setStroke(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `stroke` property on the SVG element, including applicable\r\n * color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Stroke setting\r\n */\r\n Sprite.prototype.setStroke = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"stroke\", value) || this.strokeModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.strokeModifier) {\r\n value = this.strokeModifier.modify(value);\r\n }\r\n }\r\n this.realStroke = value;\r\n if (value instanceof Color) {\r\n if (value.hex == \"none\") {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else {\r\n this.setSVGAttribute({ \"stroke\": value.toString() });\r\n }\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var stroke = value;\r\n stroke.paper = this.paper;\r\n this.setSVGAttribute({ \"stroke\": \"url(\\\"\" + $utils.getBaseURI() + stroke.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeOpacity\");\r\n },\r\n /**\r\n * Stroke (outline) opacity.\r\n *\r\n * The values may range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"strokeOpacity\", value)) {\r\n this.setSVGAttribute({ \"stroke-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScalingStroke\", {\r\n /**\r\n * @return Do not scale stroke (outline)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScalingStroke\");\r\n },\r\n /**\r\n * Controls if the element's stroke (outline) should remain keep constant\r\n * thicnkess and do not scale when the whole element is resized.\r\n *\r\n * @param value Do not scale stroke (outline)\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"nonScalingStroke\", value)) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScaling\", {\r\n /**\r\n * @return Is element scaleable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScaling\");\r\n },\r\n /**\r\n * Controls if element should keep constant size and not scale even if there is\r\n * space available, or it does not fit.\r\n *\r\n * @param value Is element scaleable?\r\n */\r\n set: function (value) {\r\n // @todo Description (review)\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"nonScaling\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Thickness (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeWidth\");\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Thickness (px)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n this.setPropertyValue(\"strokeWidth\", value, true);\r\n if (this.nonScalingStroke) {\r\n if (!$type.isNumber(value)) {\r\n value = 1;\r\n }\r\n value = value / this.globalScale;\r\n }\r\n this.setSVGAttribute({ \"stroke-width\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"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 value = $type.toText(value);\r\n if (this.setPropertyValue(\"strokeDasharray\", value)) {\r\n this.setSVGAttribute({ \"stroke-dasharray\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDashoffset\", {\r\n /**\r\n * @return `stroke-dashoffset`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeDashoffset\");\r\n },\r\n /**\r\n * A `stroke-dashoffset` for the stroke (outline).\r\n *\r\n * \"Dashoffset\" allows setting the start position of the dashes if\r\n * `strokeDasharray` is used.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset} for more info on `stroke-dashoffset`\r\n * @param value `stroke-dashoffset`\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"strokeDashoffset\", value)) {\r\n this.setSVGAttribute({ \"stroke-dashoffset\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinecap\", {\r\n /**\r\n * @return `stroke-linecap`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinecap\");\r\n },\r\n /**\r\n * A `stroke-linecap` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linecap`\r\n * @param value `stroke-linecap`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinecap\", value)) {\r\n this.setSVGAttribute({ \"stroke-linecap\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinejoin\", {\r\n /**\r\n * @return `stroke-linejoin`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinejoin\");\r\n },\r\n /**\r\n * A `stroke-linejoin` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linejoin`\r\n * @param value `stroke-linejoin`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinejoin\", value)) {\r\n this.setSVGAttribute({ \"stroke-linejoin\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"shapeRendering\", {\r\n /**\r\n * @return 'shape-rendering' value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shapeRendering\");\r\n },\r\n /**\r\n * An SVG-specific `shape-rendering` value.\r\n *\r\n * `shape-rendering` controls how vector graphics are drawn and rendered.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering} for more information about `shape-rendering`\r\n * @default \"auto\"\r\n * @param value 'shape-rendering' value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"shapeRendering\", value)) {\r\n this.setSVGAttribute({ \"shape-rendering\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPerfect\", {\r\n /**\r\n * @return Use pixel perfect?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pixelPerfect\");\r\n },\r\n /**\r\n * Controls if SVG vectors should be drawn with \"pixel\" precision, producing\r\n * perfectly crisp lines on retina displays.\r\n *\r\n * Setting this to `true` might improve visual quality, but may have a\r\n * negative effect on performance.\r\n *\r\n * Different elements use different default setting for `pixelPerfect`.\r\n *\r\n * We recommend leaving this at their default settings, unless there's a\r\n * specific need.\r\n *\r\n * @param value Use pixel perfect?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this._positionPrecision = options.pixelPerfectPrecision;\r\n }\r\n else {\r\n this._positionPrecision = 3;\r\n }\r\n this.setPropertyValue(\"pixelPerfect\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rtl\", {\r\n /**\r\n * @return RTL?\r\n */\r\n get: function () {\r\n if ($type.hasValue(this._rtl)) {\r\n return this._rtl;\r\n }\r\n else if (this._topParent) {\r\n return this._topParent.rtl;\r\n }\r\n //this.rtl = false;\r\n return false;\r\n },\r\n /**\r\n * An RTL (right-to-left) setting.\r\n *\r\n * RTL may affect alignment, text, and other visual properties.\r\n *\r\n * If you set this on a top-level chart object, it will be used for all\r\n * child elements, e.g. labels, unless they have their own `rtl` setting\r\n * set directly on them.\r\n *\r\n * @param value `true` for to use RTL\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isBaseSprite) {\r\n this.topParent.rtl = value;\r\n }\r\n this._rtl = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * VISIBILITY AND ORDER PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Reveals hidden element.\r\n *\r\n * Has no effect if element is already visible.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * @param duration Fade in duration (ms)\r\n * @return Animation object if such object was created\r\n */\r\n Sprite.prototype.show = function (duration) {\r\n return this.showReal(duration);\r\n };\r\n /**\r\n * Performs actual operations to reveal this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param duration Fade in duration (ms)\r\n * @return Fade in duration (ms)\r\n */\r\n Sprite.prototype.showReal = function (duration) {\r\n var _this = this;\r\n if (this.preventShow) {\r\n return;\r\n }\r\n var transition;\r\n var properties = this.defaultState.properties;\r\n if (!this.disabled && (this.isHidden || !this.visible || this.isHiding || (properties.opacity != null && this.opacity < properties.opacity && !this.isShowing)) && !this.isDisposed()) {\r\n // helps to avoid flicker, as show might change opacity or visibility but item might be at invalid state/position\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (this.positionInvalid) {\r\n this.validatePosition();\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.defaultState.transitionDuration;\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n this._isHidden = false;\r\n this.isHiding = false;\r\n this.isShowing = true;\r\n // Apply current state\r\n transition = this.applyCurrentState(duration);\r\n if (transition && !transition.isFinished()) {\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isShowing = false;\r\n });\r\n this._disposers.push(this._showHideDisposer);\r\n }\r\n else {\r\n this.isShowing = false;\r\n }\r\n // Make it visible\r\n var visible = this.defaultState.properties.visible;\r\n if (!$type.hasValue(visible)) {\r\n visible = true;\r\n }\r\n this.visible = visible;\r\n // Unhide from screen readers\r\n this.readerHidden = false;\r\n // Dispatch \"show\" event\r\n this.dispatchImmediately(\"shown\");\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Initiates hiding of Sprite.\r\n * When called it will fade out the the Sprite to transparency, then make it\r\n * invisible.\r\n * @param duration Duration in millisecons\r\n */\r\n /**\r\n * Hides the element, by applying `hidden` state.\r\n *\r\n * Has no effect if element is already hidden.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * While element is fading out, its `isHiding` property will resolve to\r\n * `true`.\r\n *\r\n * When element is hidden, its `visible` property will resolve to `false`.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return hide Animation object if such object was created\r\n */\r\n Sprite.prototype.hide = function (duration) {\r\n return this.hideReal(duration);\r\n };\r\n /**\r\n * Hides actual SVG elements and handles hiding animations.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return Fade out duration (ms)\r\n * @ignore\r\n */\r\n Sprite.prototype.hideReal = function (duration) {\r\n var _this = this;\r\n var transition;\r\n if (!this.isHiding && this.visible && !this.isDisposed()) {\r\n // added to solve 51375\r\n if (this.tooltip && this.tooltip.currentSprite == this) {\r\n this.hideTooltip(0);\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n this.isShowing = false;\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n // Get state\r\n var hiddenState_1 = this.hiddenState;\r\n // Transition to \"hidden\" state, provided Sprite has one set\r\n if (hiddenState_1) {\r\n // Yes, we have a \"hidden\" state\r\n // `setState` will return an `Animation` object which we can set\r\n // events on\r\n transition = this.setState(hiddenState_1, duration, undefined);\r\n if (transition && !transition.isFinished()) {\r\n this._hideAnimation = transition;\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isHiding = false;\r\n _this._isHidden = true;\r\n if (hiddenState_1.properties.visible == false) {\r\n _this.visible = false;\r\n }\r\n }, this);\r\n this._disposers.push(this._showHideDisposer);\r\n // Thrown everything into `_disposers` just in case Sprite gets\r\n // destroyed in the meantime\r\n this._disposers.push(transition);\r\n }\r\n else {\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n }\r\n else {\r\n // No hidden state, let's just set `visible` and call it a day\r\n this.visible = false;\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n // Hide from screen readers\r\n this.readerHidden = true;\r\n // Dispach \"hidden\" event\r\n this.dispatchImmediately(\"hidden\");\r\n this.invalidate(); // hide it at once to avoid flickers // validate() causes SO\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.hiddenState.transitionDuration;\r\n }\r\n return transition;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"visible\", {\r\n /**\r\n * @return Visible?\r\n */\r\n get: function () {\r\n return this.getVisibility();\r\n },\r\n /**\r\n * Indicates if element is current visible (`true`) or hidden (`false`).\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setVisibility(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns visibility value\r\n * @ignore\r\n */\r\n Sprite.prototype.getVisibility = function () {\r\n var value = this.getPropertyValue(\"visible\");\r\n if (!$type.hasValue(value)) {\r\n value = true;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n Sprite.prototype.setVisibility = function (value) {\r\n if (this.setPropertyValue(\"visible\", value)) {\r\n if (value) {\r\n this.group.removeAttr(\"visibility\");\r\n }\r\n else {\r\n this.group.attr({ \"visibility\": \"hidden\" });\r\n }\r\n //this.invalidatePosition();\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_4 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_4);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"zIndex\", {\r\n /**\r\n * @return zIndex\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zIndex\");\r\n },\r\n /**\r\n * A \"zIndex\" of the element.\r\n *\r\n * \"zIndex\" determines the order of how elements are placed over each other.\r\n *\r\n * Higher \"zIndex\" will mean the element will be draw on top of elements\r\n * with lower \"zIndexes\".\r\n *\r\n * @param value zIndex\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"zIndex\", value)) {\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves the element to the very top in element order, so that it appears\r\n * in front of other elements.\r\n */\r\n Sprite.prototype.toFront = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != parent.children.length - 1) {\r\n parent.children.moveValue(this, parent.children.length - 1);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n /**\r\n * Moves the element to the very bottom in the element order, so that it\r\n * appears behind other elements.\r\n */\r\n Sprite.prototype.toBack = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != 0) {\r\n parent.children.moveValue(this, 0);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"userClassName\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"userClassName\");\r\n },\r\n /**\r\n * A custom class name to set on the element.\r\n *\r\n * If set, the value will be added to element's `class` attribute.\r\n *\r\n * @since 4.9.11\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"userClassName\", value)) {\r\n if (!value && this.userClassName) {\r\n this.group.removeClass(this.userClassName);\r\n }\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltip\", {\r\n /**\r\n * @return Tooltip\r\n */\r\n get: function () {\r\n if (this._tooltip) {\r\n return this._tooltip;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltip;\r\n }\r\n },\r\n /**\r\n * ==========================================================================\r\n * TOOLTIP-RELATED PROPERTIES STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[Tooltip]] object to be used when displayed rollover information for\r\n * the element.\r\n *\r\n * @param tooltip Tooltip\r\n */\r\n set: function (tooltip) {\r\n if (this._tooltip) {\r\n //this._tooltip.dispose();\r\n this.removeDispose(this._tooltip);\r\n }\r\n this._tooltip = tooltip;\r\n if (tooltip) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipDataItem\", {\r\n /**\r\n * @return Tooltip data item\r\n */\r\n get: function () {\r\n var tooltipDataItem = this._tooltipDataItem;\r\n if (tooltipDataItem) {\r\n return tooltipDataItem;\r\n }\r\n else {\r\n return this.dataItem;\r\n }\r\n },\r\n /**\r\n * A [[DataItem]] to use when populating content for the element's\r\n * [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link DataItem}\r\n * @param value Tooltip data item\r\n */\r\n set: function (value) {\r\n // important: do not dispose tooltip dataItem, as it is some actual data item from data!\r\n this._tooltipDataItem = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipColorSource\", {\r\n /**\r\n * @return Tooltip color source\r\n */\r\n get: function () {\r\n return this._tooltipColorSource;\r\n },\r\n /**\r\n * A [[Sprite]] or sprite template to use when getting colors for tooltip. If a template is set,\r\n * tooltip will look for a clone in tooltipDataItem.sprites. If no clone is found, then template colors will be used.\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link Sprite}\r\n * @param sprite Sprite\r\n */\r\n set: function (sprite) {\r\n this._tooltipColorSource = sprite;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows the element's [[Tooltip]].\r\n *\r\n * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n * `tooltipText` as well as data in `tooltipDataItem`.\r\n *\r\n * @see {@link Tooltip}\r\n * @param optional point (sprite-related) to which tooltip must point.\r\n * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n */\r\n Sprite.prototype.showTooltip = function (point) {\r\n if (this.showTooltipOn == \"always\" && !this._tooltip && this.tooltip) {\r\n this._tooltip = this.tooltip.clone();\r\n }\r\n if (!point && this.tooltipPosition == \"pointer\" && this.isHover) {\r\n point = $utils.documentPointToSvg(getInteraction().lastPointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n // do not show if hidden\r\n var sprite = this;\r\n while (sprite != undefined) {\r\n if (!sprite.visible || sprite.disabled || sprite.__disabled) {\r\n if (this._tooltip && this._tooltip.visible) {\r\n this._tooltip.hide(0);\r\n }\r\n return;\r\n }\r\n sprite = sprite.parent;\r\n }\r\n if ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML)) {\r\n var tooltip = this.tooltip;\r\n var tooltipDataItem = this.tooltipDataItem;\r\n if (tooltip) {\r\n tooltip.targetSprite = this;\r\n var colorSource_1 = this;\r\n var tooltipColorSource_1 = this.tooltipColorSource;\r\n if ((tooltip.getStrokeFromObject || tooltip.getFillFromObject) && tooltipColorSource_1) {\r\n if (tooltipColorSource_1.isTemplate) {\r\n if (tooltipDataItem) {\r\n $array.eachContinue(tooltipDataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == tooltipColorSource_1) {\r\n colorSource_1 = sprite;\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n }\r\n else {\r\n colorSource_1 = tooltipColorSource_1;\r\n }\r\n }\r\n if (tooltip.getStrokeFromObject) {\r\n var stroke = this.stroke;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n stroke = source.stroke;\r\n if (stroke == undefined) {\r\n source = source.parent;\r\n }\r\n if (stroke != undefined) {\r\n break;\r\n }\r\n }\r\n if (stroke instanceof Color) {\r\n tooltip.background.animate({ property: \"stroke\", to: stroke }, tooltip.animationDuration);\r\n }\r\n else {\r\n tooltip.background.stroke = stroke;\r\n }\r\n }\r\n // Set data item\r\n tooltip.dataItem = tooltipDataItem;\r\n tooltip.label.populateStringFrom = this;\r\n if (tooltip.getFillFromObject) {\r\n var fill = this.fill;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n fill = source.fill;\r\n if (fill == undefined || (fill instanceof Color && fill.rgb == undefined)) {\r\n source = source.parent;\r\n }\r\n else if (fill != undefined) {\r\n break;\r\n }\r\n }\r\n if (fill == undefined) {\r\n fill = color(\"#000000\");\r\n }\r\n if (fill instanceof Color) {\r\n if (!tooltip.visible) {\r\n tooltip.background.fill = fill;\r\n }\r\n else {\r\n tooltip.background.animate({ property: \"fill\", to: fill }, tooltip.animationDuration);\r\n }\r\n }\r\n else {\r\n tooltip.background.fill = fill;\r\n }\r\n if (tooltip.autoTextColor && fill instanceof Color) {\r\n tooltip.label.fill = fill.alternative;\r\n }\r\n }\r\n // Apply tooltip text\r\n var text = \"\";\r\n if (this.tooltipHTML) {\r\n tooltip.html = this.tooltipHTML;\r\n text = this.tooltipHTML;\r\n }\r\n if (this.tooltipText) {\r\n tooltip.text = this.tooltipText;\r\n text = this.tooltipText;\r\n }\r\n if (this.updateTooltipPosition(point)) {\r\n // Set accessibility option\r\n tooltip.readerDescribedBy = this.uidAttr();\r\n // make label to render to be able to check currentText\r\n if (tooltip.label.invalid) {\r\n tooltip.label.validate();\r\n }\r\n if (text != undefined && text != \"\" && tooltip.label.currentText != \"\") {\r\n //@todo: think of how to solve this better\r\n if (tooltip && !tooltip.parent) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n // Reveal tooltip\r\n // showing it in 1 ms helps to avoid strange flickering in IE\r\n var duration = tooltip.defaultState.transitionDuration;\r\n if (duration <= 0) {\r\n duration = 1;\r\n }\r\n tooltip.show(duration);\r\n tooltip.currentSprite = this;\r\n return true;\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.updateTooltipPosition = function (point) {\r\n var _this = this;\r\n if (this.tooltipPosition == \"pointer\") {\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n }\r\n this._interactionDisposer = getInteraction().body.events.on(\"track\", function (ev) {\r\n return _this.pointTooltipTo($utils.documentPointToSvg(ev.point, _this.svgContainer.SVGContainer, _this.svgContainer.cssScale), true);\r\n });\r\n if (point) {\r\n return this.pointTooltipTo(point, true);\r\n }\r\n }\r\n else {\r\n // Point to the X/Y of this Sprite\r\n var globalPoint = $utils.spritePointToSvg({\r\n \"x\": this.getTooltipX(),\r\n \"y\": this.getTooltipY()\r\n }, this);\r\n return this.pointTooltipTo(globalPoint);\r\n }\r\n };\r\n /**\r\n * Sets the point the [[Tooltip]] should point to.\r\n *\r\n * @param point Coordinates to point to\r\n * @param instantly Move instantly without animation\r\n */\r\n Sprite.prototype.pointTooltipTo = function (point, instantly) {\r\n var tooltip = this.tooltip;\r\n if (tooltip && this.topParent) {\r\n if (tooltip.showInViewport) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n if ($math.isInRectangle(point, { x: 0, y: 0, width: this.topParent.maxWidth, height: this.topParent.maxHeight })) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Hides element's [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n */\r\n Sprite.prototype.hideTooltip = function (duration) {\r\n if (this.showTooltipOn == \"always\") {\r\n return;\r\n }\r\n var tooltip = this.tooltip;\r\n if (tooltip) {\r\n if (tooltip.targetSprite == this) {\r\n tooltip.targetSprite = undefined;\r\n }\r\n tooltip.hide(duration);\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"tooltipHTML\", {\r\n /**\r\n * @return Tooltip HTML content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipHTML\");\r\n },\r\n /**\r\n * An HTML template to be used to populate [[Tooltip]] contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * @param value Tooltip HTML content template\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n this.hoverable = true;\r\n if (this.setPropertyValue(\"tooltipHTML\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipText\", {\r\n /**\r\n * @return Tooltip content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipText\");\r\n },\r\n /**\r\n * A text template to be used to populate Tooltip's contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * This template will also be parsed for any special formatting tags.\r\n *\r\n * @param value Tooltip content template\r\n * @see {@link TextFormatter}\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (value) {\r\n this.hoverable = true;\r\n }\r\n if (this.setPropertyValue(\"tooltipText\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipContainer\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Container\r\n */\r\n get: function () {\r\n if (this._tooltipContainer) {\r\n return this._tooltipContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltipContainer;\r\n }\r\n },\r\n /**\r\n * A container reference that should be used to place element's\r\n * [[Tooltip]] in.\r\n *\r\n * Will use parent's container if does not have one set.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Container\r\n * @todo Dispose of the old _tooltipContainer ?\r\n */\r\n set: function (value) {\r\n this._tooltipContainer = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipX\", {\r\n /**\r\n * @return Tooltip X (px)\r\n */\r\n get: function () {\r\n return this.getTooltipX();\r\n },\r\n /**\r\n * X coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip X (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipX\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"alwaysShowTooltip\", {\r\n /**\r\n * @return Always show tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\") == \"always\";\r\n },\r\n /**\r\n * DEPRECATION NOTICE: This setting is deprecated in favor of a more flexible\r\n * setting: `showTooltipOn`. Please use `showTooltipOn = \"always\"` instead.\r\n *\r\n * Indicates if this element should display a tooltip permanently.\r\n *\r\n * Useful, if you want to show permanent tooltips on some items.\r\n *\r\n * @default false\r\n * @since 4.5.4\r\n * @deprecated Use `showTooltipOn = \"always\"` instead\r\n * @param value Always show tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this.showTooltipOn = \"always\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showTooltipOn\", {\r\n /**\r\n * @return When to show tooltip\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\");\r\n },\r\n /**\r\n * Indicates when tooltip needs to be shown on this element:\r\n *\r\n * * `\"hover\"` (default) - Tooltip will be shown when element is hovered on.\r\n * * `\"hit\"` - Tooltip will be shown when element is clicked/tapped. Tooltip will be hidden when clicked/tapped anywhere else.\r\n * * `\"always\"` - Tooltip will be shown on the element permanently.\r\n *\r\n * For example, if you would like to show tooltips on all of the columns of\r\n * a [[ColumnSeries]]:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"showTooltipOn\": \"always\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * It can even be set to display on a selected columns via `propertyFields`:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"propertyFields\": {\r\n * \"showTooltipOn\": \"tooltip\"\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @default \"hover\"\r\n * @since 4.7.9\r\n * @param value When to show tooltip\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"showTooltipOn\", value)) {\r\n if (value == \"hit\") {\r\n this.clickable = true;\r\n }\r\n if (this.tooltip) {\r\n if (value == \"always\") {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.handleAlwaysShowTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipPosition\", {\r\n /**\r\n * Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipPosition\");\r\n },\r\n /**\r\n * Specifies if [[Tooltip]] should follow the mouse or touch pointer or stay\r\n * at the fixed position.\r\n *\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipPosition\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipY\", {\r\n /**\r\n * @return Tooltip Y (px)\r\n */\r\n get: function () {\r\n return this.getTooltipY();\r\n },\r\n /**\r\n * Y coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip Y (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipY\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns Tooltip X coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return X (px)\r\n */\r\n Sprite.prototype.getTooltipX = function () {\r\n var x = this.getPropertyValue(\"tooltipX\");\r\n if (!$type.hasValue(x)) {\r\n x = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(x)) {\r\n value = x;\r\n }\r\n if (x instanceof Percent) {\r\n value = this.maxLeftSelf + this._measuredWidthSelf * x.value - this.pixelPaddingLeft - this.ex; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Returns Tooltip Y coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Y (px)\r\n */\r\n Sprite.prototype.getTooltipY = function () {\r\n var y = this.getPropertyValue(\"tooltipY\");\r\n if (!$type.hasValue(y)) {\r\n y = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(y)) {\r\n value = y;\r\n }\r\n if (y instanceof Percent) {\r\n value = this.maxTopSelf + this._measuredHeightSelf * y.value - this.pixelPaddingTop - this.ey; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Displays a modal or console message with error, and halts any further\r\n * processing of this item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param e Error\r\n * @todo Implement from applying further actions to this item\r\n */\r\n Sprite.prototype.raiseCriticalError = function (e, closable) {\r\n if (this.svgContainer) {\r\n if (!this._adapterO) {\r\n this.modal.content = e.message;\r\n }\r\n else {\r\n this.modal.content = this._adapterO.apply(\"criticalError\", e).message;\r\n }\r\n if (!closable) {\r\n this.disabled = true;\r\n }\r\n else {\r\n this.modal.closable = true;\r\n }\r\n if (!options.suppressErrors) {\r\n this.modal.open();\r\n }\r\n }\r\n if (options.verbose) {\r\n console.log(e);\r\n }\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 Sprite.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Tooltip color source\r\n if ($type.hasValue(config.tooltipColorSource) && $type.isString(config.tooltipColorSource) && this.map.hasKey(config.tooltipColorSource)) {\r\n config.tooltipColorSource = this.map.getKey(config.tooltipColorSource);\r\n }\r\n // Cursor styles\r\n if ($type.hasValue(config.cursorOverStyle) && $type.isString(config.cursorOverStyle)) {\r\n config.cursorOverStyle = this.getCursorStyle(config.cursorOverStyle);\r\n }\r\n if ($type.hasValue(config.cursorDowntyle) && $type.isString(config.cursorDowntyle)) {\r\n config.cursorDowntyle = this.getCursorStyle(config.cursorDowntyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions)) {\r\n if ($type.hasValue(config.cursorOptions.overStyle) && $type.isString(config.cursorOptions.overStyle)) {\r\n config.cursorOptions.overStyle = this.getCursorStyle(config.cursorOptions.overStyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions.downStyle) && $type.isString(config.cursorOptions.downStyle)) {\r\n config.cursorOptions.downStyle = this.getCursorStyle(config.cursorOptions.downStyle);\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n this.processDelayedMap();\r\n };\r\n /**\r\n * Converts string name of the cursor into actual [[MouseCursorStyle]].\r\n *\r\n * @param style Cursor type\r\n * @return Cursor definition\r\n */\r\n Sprite.prototype.getCursorStyle = function (style) {\r\n switch (style) {\r\n case \"grab\":\r\n return MouseCursorStyle.grab;\r\n case \"grabbing\":\r\n return MouseCursorStyle.grabbing;\r\n case \"pointer\":\r\n return MouseCursorStyle.pointer;\r\n case \"horizontalResize\":\r\n return MouseCursorStyle.horizontalResize;\r\n case \"verticalResize\":\r\n return MouseCursorStyle.verticalResize;\r\n default:\r\n return MouseCursorStyle.default;\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n Sprite.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"tooltipColorSource\") {\r\n return 1;\r\n }\r\n else if (b == \"tooltipColorSource\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHidden\", {\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n get: function () {\r\n if (this._isHidden) {\r\n return this._isHidden;\r\n }\r\n else if (this._parent) {\r\n return this._parent.isHidden;\r\n }\r\n return false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showOnInit\", {\r\n /**\r\n * @return Show on init?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showOnInit\");\r\n },\r\n /**\r\n * If this is set to `true`, Sprite, when inited will be instantly hidden\r\n * (\"hidden\" state applied) and then shown (\"default\" state applied).\r\n *\r\n * If your \"default\" state's `transitionDuration > 0` this will result in\r\n * initial animation from \"hidden\" state to \"default\" state.\r\n *\r\n * If you need a Sprite which has `showOnInit = true` not to be shown\r\n * initially, set `sprite.hidden = true`. Setting `sprite.visible = false`\r\n * will not prevent the animation and the sprite will be shown.\r\n *\r\n * @param value show on init?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setShowOnInit(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setShowOnInit = function (value) {\r\n if (this.setPropertyValue(\"showOnInit\", value)) {\r\n if (!this.isTemplate) {\r\n if (value && !this.inited && !this.hidden) {\r\n this._showOnInitDisposer = new MultiDisposer([\r\n registry.events.once(\"enterframe\", this.hideInitially, this),\r\n this.events.once(\"beforevalidated\", this.hideInitially, this, false),\r\n this.events.on(\"inited\", this.appear, this, false)\r\n ]);\r\n this._disposers.push(this._showOnInitDisposer);\r\n }\r\n else {\r\n if (this._showOnInitDisposer) {\r\n this._showOnInitDisposer.dispose();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.hideInitially = function () {\r\n if (!this.isDisposed()) {\r\n this.appeared = false;\r\n //if (!this.hidden && !this._isHidden) { // not good for series, as on enterframe it doesn't have data items yet.\r\n if (!this.inited) {\r\n this.hide(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n */\r\n Sprite.prototype.appear = function () {\r\n var _this = this;\r\n this.appeared = false;\r\n if (!this.hidden && !this.isHidden) {\r\n this.hide(0);\r\n }\r\n if (!this.hidden) {\r\n var animation = this.show();\r\n if (animation && !animation.isFinished()) {\r\n this.addDisposer(animation.events.on(\"animationended\", function () {\r\n _this.appeared = true;\r\n _this.dispatch(\"appeared\");\r\n }));\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hidden\", {\r\n /**\r\n * @return Is initially hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hidden\");\r\n },\r\n /**\r\n * If a sprite has `showOnInit = true`, it will animate from \"hidden\" to\r\n * \"default\" state when initialized. To prevent this but keep\r\n * `showOnInit = true`, you can set `sprite.hidden = true`.\r\n *\r\n * @param value initially hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"hidden\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n return this._bbox;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"plugins\", {\r\n /**\r\n * A list of plugins (objects that implement [[IPlugin]] interface) attached\r\n * to this object.\r\n *\r\n * @since 4.2.2\r\n * @return List of plugins\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._plugins) {\r\n this._plugins = new List();\r\n this._disposers.push(this._plugins.events.on(\"inserted\", function (ev) {\r\n ev.newValue.target = _this;\r\n ev.newValue.init();\r\n }));\r\n this._disposers.push(new ListDisposer(this._plugins));\r\n }\r\n return this._plugins;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemUpdate = function (skippedSprites) {\r\n this.validate();\r\n };\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemCheckIfValidate = function () {\r\n return true;\r\n };\r\n /**\r\n * Called during the System.validatePositions method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidatePositions = function () {\r\n this.validatePosition();\r\n };\r\n /**\r\n * Called during the System.validateLayouts method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidateLayouts = function () {\r\n };\r\n return Sprite;\r\n}(BaseObjectEvents));\r\nexport { Sprite };\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[\"Sprite\"] = Sprite;\r\n//# sourceMappingURL=Sprite.js.map","import { __extends } from \"tslib\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { TargetedEventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"./utils/Disposer\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $object from \"./utils/Object\";\r\n/**\r\n * An [[EventDispatcher]] for [[Sprite]].\r\n *\r\n * @important\r\n */\r\nvar SpriteEventDispatcher = /** @class */ (function (_super) {\r\n __extends(SpriteEventDispatcher, _super);\r\n function SpriteEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_interactionEvents description]\r\n *\r\n * @todo Description\r\n */\r\n _this._interactionEvents = new Dictionary();\r\n return _this;\r\n }\r\n /**\r\n * [_dispatchSpriteEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpriteEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this <any> later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_dispatchSpritePointEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpritePointEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this <any> later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target,\r\n spritePoint: ev.point ? $utils.documentPointToSprite(ev.point, this.target) : undefined,\r\n svgPoint: this.target.getSvgPoint(ev.point)\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_addInteractionObjectEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._addInteractionObjectEvent = function (type, callback, context, shouldClone) {\r\n var _this = this;\r\n var key = shouldClone + \"-\" + type;\r\n var counter = this._interactionEvents.insertKeyIfEmpty(key, function () {\r\n var disposer = _this.target.interactions.events.on(type, callback, context, shouldClone);\r\n return new CounterDisposer(function () {\r\n _this._interactionEvents.removeKey(key);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n };\r\n /**\r\n * [_on description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n /**\r\n * Catching Sprite-related events, converting them to [[SpriteEvent]] and\r\n * triggering them on sprite\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"track\":\r\n case \"doublehit\":\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpritePointEvent, this, shouldClone));\r\n break;\r\n case \"rightclick\":\r\n case \"down\":\r\n //case \"hold\":\r\n case \"up\":\r\n case \"drag\":\r\n case \"dragged\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n case \"over\":\r\n case \"out\":\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n case \"resize\":\r\n //case \"rotate\":\r\n case \"focus\":\r\n case \"blur\":\r\n case \"toggled\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpriteEvent, this, shouldClone));\r\n break;\r\n }\r\n /**\r\n * Set functional properties based on events. For example if we add a\r\n * \"drag\" event handler, we want to make the Sprite draggable, even if we\r\n * don't explicitly set \"draggable\"\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"toggled\":\r\n this.target.togglable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n this.target.hoverable = true;\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n this.target.focusable = true;\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return SpriteEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { SpriteEventDispatcher };\r\n//# sourceMappingURL=SpriteEvents.js.map","/**\r\n * Module contains functionality related to [[Sprite]] states.\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 { registry } from \"./Registry\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { toColor } from \"./utils/Color\";\r\nimport { percent } from \"./utils/Percent\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * Defines a state for [[Sprite]].\r\n *\r\n * A \"state\" is a special object that has all the same properties as the\r\n * [[Sprite]] of the same type, and which can be used to quickly apply a set\r\n * of property values. (set state)\r\n *\r\n * When [[Sprite]] (or any object that extends Sprite) is created it creates a\r\n * \"default\" state. You can modify the \"default\" state so that when the Sprite\r\n * returns to default state certain properties are added.\r\n *\r\n * Default state can be accessed using Sprite's `defaultState` getter.\r\n *\r\n * ```TypeScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"defaultState\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * If Sprite is \"hoverable\", it automatically adds a \"hover\" state, which is\r\n * applied when it has a cursor over it.\r\n *\r\n * ```TypeScript\r\n * let hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JavaScript\r\n * var hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"states\": {\r\n * \"hover\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The above will automatically apply \"hover\" state when the Sprite is hovered,\r\n * thus will set its `fillOpacity` property to 1, and will reset it to 0.5 when\r\n * it's no longer hovered.\r\n *\r\n * Every object that inherits from [[Sprite]] can and will add their own\r\n * properties to the available list.\r\n *\r\n * User can create their own states, and apply them as needed:\r\n *\r\n * ```TypeScript\r\n * let myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n * ```JavaScript\r\n * var myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/states/}\r\n * @important\r\n */\r\nvar SpriteState = /** @class */ (function (_super) {\r\n __extends(SpriteState, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SpriteState() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the transition to this state. 0 means instantenous transition.\r\n * Any number means the [[Sprite]] will transit smoothly to this state,\r\n * animating all animatable properties.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionDuration = 0;\r\n /**\r\n * Easing function to use when transitioning to this state.\r\n *\r\n * @default cubicOut\r\n * @see {@link Ease}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionEasing = $ease.cubicOut;\r\n /**\r\n * Collection of properties and their values that should be applied to [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * The property values set on a [[SpriteState]] will override the ones set\r\n * directly on a [[Sprite]].\r\n */\r\n _this.properties = {};\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * SpriteState-specific binding will override binding set directly on\r\n * [[Sprite]]. I.e. you can make Sprite use different fill color on hover by\r\n * adding a `fill` binding to a different DataItem key for Sprite's \"hover\"\r\n * state object.\r\n *\r\n * @see {@link Sprite}\r\n */\r\n _this.propertyFields = {};\r\n //public propertyFields: Dictionary<keyof this[\"_properties\"], string> = new Dictionary<keyof this[\"_properties\"], string>();;\r\n /**\r\n * A list of [[Filter]] elements to be applied to the relative [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * @param {List}\r\n */\r\n _this.filters = new List();\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 _this.className = \"SpriteState\";\r\n // Make filter list disposable\r\n _this._disposers.push(new ListDisposer(_this.filters));\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SpriteState.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n this._adapterO.events.on(\"inserted\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n this._adapterO.events.on(\"removed\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns [[Sprite]] element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]] and if there are\r\n * any method callbacks set up for the specific property.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n SpriteState.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n var sprite = this.sprite;\r\n if (sprite) {\r\n var fieldName = this.propertyFields[propertyName];\r\n if ($type.hasValue(fieldName)) {\r\n if (sprite.dataItem) {\r\n propValue = sprite.dataItem.dataContext[fieldName];\r\n }\r\n if (propValue == undefined) {\r\n propValue = \"__unset\";\r\n }\r\n }\r\n // Apply adapters\r\n // If the value itself is undefined, we're going to pass in Sprite's\r\n // value to adapters\r\n // @todo get rid of <any>\r\n if (!$type.hasValue(propValue)) {\r\n var spriteValue = sprite.getPropertyValue(propertyName);\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, spriteValue);\r\n }\r\n else {\r\n propValue = spriteValue;\r\n }\r\n if (propValue == spriteValue) {\r\n propValue = undefined;\r\n }\r\n }\r\n else {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n }\r\n /*let method = this.propertyMethods.getKey(propertyName);\r\n if (method) {\r\n propValue = method(sprite, propertyName);\r\n }*/\r\n }\r\n return propValue;\r\n };\r\n /**\r\n * Copies all property and style values from another [[SpriteState]] object.\r\n *\r\n * @param source Source [[SpriteState]]\r\n */\r\n SpriteState.prototype.copyFrom = function (source) {\r\n if (source && source != this) {\r\n this.transitionDuration = source.transitionDuration;\r\n this.transitionEasing = source.transitionEasing;\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n this.filters.copyFrom(source.filters);\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n }\r\n };\r\n Object.defineProperty(SpriteState.prototype, \"allValues\", {\r\n /**\r\n * Returns all values that should be applied by the SpriteState.\r\n *\r\n * It takes adapters into account.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Properties\r\n * @todo Add adapter values\r\n * @todo proper type this[\"_properties\"]\r\n */\r\n get: function () {\r\n var _this = this;\r\n // Init return value\r\n var res = {};\r\n // Apply adapters to all values\r\n $object.each(this.properties, function (prop, value) {\r\n res[prop] = _this.getPropertyValue(prop);\r\n });\r\n // Cycle through all adapters and add values for missing properties\r\n if (this._adapterO) {\r\n var keys = this._adapterO.keys();\r\n $object.each(keys, function (_x, prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n }\r\n // Cycle through all property fileds and add values for missing properties\r\n var propertyFields = this.propertyFields;\r\n $object.each(propertyFields, function (prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n return res;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets the State to initial state - no values or Filters applied.\r\n */\r\n SpriteState.prototype.reset = function () {\r\n this.properties = {};\r\n this.filters.clear();\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 SpriteState.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config) && $type.hasValue(config[\"properties\"])) {\r\n $object.each(config[\"properties\"], function (key, value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[0-9.\\-]+\\%$/)) {\r\n config[\"properties\"][key] = percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n config[\"properties\"][key] = toColor(value);\r\n }\r\n }\r\n });\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n SpriteState.prototype.asFunction = function (field) {\r\n return field == \"transitionEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return SpriteState;\r\n}(BaseObject));\r\nexport { SpriteState };\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[\"SpriteState\"] = SpriteState;\r\n//# sourceMappingURL=SpriteState.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry, is } from \"./Registry\";\r\nimport { Container } from \"./Container\";\r\nimport { raf } from \"./utils/AsyncPending\";\r\nimport { triggerIdle } from \"./utils/AsyncPending\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $log from \"./utils/Log\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * The main class that handles system-wide tasks, like caching, heartbeats, etc.\r\n * @important\r\n */\r\nvar System = /** @class */ (function () {\r\n /**\r\n * Performs initialization of the System object.\r\n *\r\n * Called when the first [[Sprite]] object is created.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n function System() {\r\n /**\r\n * A flag indicating if the system is on pause.\r\n */\r\n this._isPaused = false;\r\n /**\r\n * Holds the list of currently playing animations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.animations = [];\r\n /**\r\n * Unique ID of the object.\r\n */\r\n this.uid = registry.getUniqueId();\r\n /**\r\n * @todo Description\r\n * @todo Needed?\r\n * @ignore Exclude from docs\r\n */\r\n this.dummyCounter = 0;\r\n this._frameRequested = false;\r\n this.updateStepDuration = 45;\r\n this.time = Date.now();\r\n }\r\n /**\r\n * Reports time elapsed since timer was reset.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Needed?\r\n * @param msg Message to report in console\r\n * @param reset Reset time counter\r\n */\r\n System.prototype.reportTime = function (msg, reset) {\r\n if (this.dummyCounter < 6) {\r\n //console.log(Date.now() - this.time, msg, this.dummyCounter2);\r\n }\r\n if (reset) {\r\n this.time = Date.now();\r\n }\r\n };\r\n /**\r\n * Performs \"heartbeat\" operations `frameRate` number of times per second.\r\n *\r\n * When the chart element is invalidated, it is not immediately redrawn.\r\n *\r\n * Instead it waits for the next `update()` cycle to be re-validated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.update = function () {\r\n var _this = this;\r\n if (this._isPaused) {\r\n return;\r\n }\r\n this._frameRequested = false;\r\n var time = Date.now();\r\n registry.dispatchImmediately(\"enterframe\");\r\n //this.validateLayouts();\r\n //this.validatePositions();\r\n /*\r\n for (let key in registry.invalidLayouts) {\r\n this.validateLayouts(key);\r\n }\r\n for (let key in registry.invalidPositions) {\r\n this.validatePositions(key);\r\n }\r\n */\r\n var skippedComponents = [];\r\n // data objects first - do all calculations\r\n // only data is parsed in chunks, thats why we do for loop instead of a while like with other invalid items.\r\n // important to go backwards, as items are removed!\r\n // TODO use iterator instead\r\n for (var key in registry.invalidDatas) {\r\n if ($object.hasKey(registry.invalidDatas, key)) {\r\n var invalidData = registry.invalidDatas[key];\r\n while (invalidData.length > 0) {\r\n var component = invalidData[0];\r\n var dataProvider = component.dataProvider;\r\n if (!component.isDisposed()) {\r\n if (dataProvider && dataProvider.dataInvalid) {\r\n try {\r\n dataProvider.validateData();\r\n if (dataProvider.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, dataProvider);\r\n dataProvider.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n try {\r\n component.validateData();\r\n if (component.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n else {\r\n $array.remove(invalidData, component);\r\n }\r\n }\r\n if (Date.now() - time > this.updateStepDuration) {\r\n break;\r\n }\r\n }\r\n }\r\n while (registry.invalidRawDatas.length > 0) {\r\n var component = registry.invalidRawDatas[0];\r\n if (!component.isDisposed()) {\r\n try {\r\n component.validateRawData();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidRawDatas, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(registry.invalidRawDatas, component);\r\n }\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataItems.length > 0) {\r\n var component = registry.invalidDataItems[0];\r\n var dataProvider = component.dataProvider;\r\n // this is needed to avoid partial value validation when data is parsed in chunks\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataItems();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataItems, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateValues removes from invalidDataItems aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataItems, component);\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataRange.length > 0) {\r\n var component = registry.invalidDataRange[0];\r\n var dataProvider = component.dataProvider;\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataRange();\r\n if (!component.skipRangeEvent) {\r\n component.dispatchImmediately(\"datarangechanged\");\r\n }\r\n component.skipRangeEvent = false;\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataRange, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateDataRange removes from invalidDataRange aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataRange, component);\r\n }\r\n var skippedSprites = [];\r\n // display objects later\r\n // TODO use iterator instead\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n var hasSkipped = false;\r\n time = Date.now();\r\n $object.each(registry.invalidSprites, function (key, invalidSprites) {\r\n var count = 0;\r\n while (invalidSprites.length > 0) {\r\n _this.validateLayouts(key);\r\n _this.validatePositions(key);\r\n count++;\r\n if (count == 5) {\r\n if (Date.now() - time > _this.updateStepDuration) {\r\n break;\r\n }\r\n count = 0;\r\n }\r\n var sprite = invalidSprites[invalidSprites.length - 1];\r\n // we need to check this, as validateLayout might validate sprite\r\n if (sprite && !sprite.isDisposed()) {\r\n if (!sprite._systemCheckIfValidate()) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n if (!_this.checkIfValidate2(sprite)) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n try {\r\n sprite._systemUpdate(skippedSprites);\r\n }\r\n catch (e) {\r\n sprite.invalid = false;\r\n $array.remove(invalidSprites, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n // this might seem too much, but it's ok\r\n sprite.invalid = false;\r\n }\r\n $array.remove(invalidSprites, sprite);\r\n }\r\n registry.invalidSprites[key] = registry.invalidSprites[key].concat(skippedSprites);\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.animations), function (x) {\r\n x.update();\r\n });\r\n //if(!hasSkipped){\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n //}\r\n triggerIdle();\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n registry.dispatchImmediately(\"exitframe\");\r\n if (hasSkipped || this.animations.length > 0 || skippedComponents.length > 0) {\r\n this.requestFrame();\r\n }\r\n if (this.updateStepDuration < 200) {\r\n var all0_1 = true;\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n if (all0_1) {\r\n this.updateStepDuration = 200;\r\n }\r\n }\r\n };\r\n System.prototype.checkIfValidate2 = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem.component && sprite.dataItem.component.dataInvalid && !sprite.dataItem.component.isTemplate) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /**\r\n * Requests new animation frame\r\n */\r\n System.prototype.requestFrame = function () {\r\n var _this = this;\r\n if (!this._frameRequested) {\r\n raf(function () {\r\n _this.update();\r\n });\r\n this._frameRequested = true;\r\n }\r\n };\r\n /**\r\n * Call this method if you update data or config of a chart that is in\r\n * hidden container, after revealing the container, so that labels and\r\n * possibly other elements can correctly arrange themselves.\r\n *\r\n * @since 4.7.10\r\n * @param container Target container\r\n */\r\n System.prototype.softInvalidate = function (container) {\r\n var _this = this;\r\n container.children.each(function (child) {\r\n if (child instanceof Container) {\r\n _this.softInvalidate(child);\r\n }\r\n if (child.measureFailed) {\r\n if (is(child, \"Label\")) {\r\n child.hardInvalidate();\r\n }\r\n else {\r\n child.invalidate();\r\n }\r\n child.measureFailed = false;\r\n }\r\n });\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Sprite]] elements that have\r\n * invalid(ated) positions.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validatePositions = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidPositions = registry.invalidPositions[id];\r\n while (invalidPositions.length > 0) {\r\n var sprite = invalidPositions[invalidPositions.length - 1];\r\n if (!sprite.isDisposed()) {\r\n try {\r\n sprite._systemValidatePositions();\r\n }\r\n catch (e) {\r\n sprite.positionInvalid = false;\r\n $array.remove(invalidPositions, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidPositions, sprite);\r\n }\r\n }\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Container]] elements that have\r\n * invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validateLayouts = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidLayouts = registry.invalidLayouts[id];\r\n while (invalidLayouts.length > 0) {\r\n var container = invalidLayouts[invalidLayouts.length - 1];\r\n if (!container.isDisposed()) {\r\n try {\r\n container.children.each(function (sprite) {\r\n sprite._systemValidateLayouts();\r\n });\r\n container.validateLayout();\r\n }\r\n catch (e) {\r\n container.layoutInvalid = false;\r\n $array.remove(invalidLayouts, container);\r\n container.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidLayouts, container);\r\n }\r\n }\r\n };\r\n /**\r\n * Outputs string to console if `verbose` is `true`.\r\n *\r\n * @param value Message to output to console\r\n */\r\n System.prototype.log = function (value) {\r\n $log.log(value);\r\n };\r\n Object.defineProperty(System.prototype, \"isPaused\", {\r\n /**\r\n * @return Is system on pause?\r\n */\r\n get: function () {\r\n return this._isPaused;\r\n },\r\n /**\r\n * Pauses all the processes of all the amCharts objects on the page\r\n *\r\n * @return is paused?\r\n */\r\n set: function (value) {\r\n this._isPaused = value;\r\n if (!value) {\r\n this._frameRequested = false;\r\n this.requestFrame();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * amCharts Version.\r\n *\r\n * This follows npm's semver specification.\r\n *\r\n * @see {@link https://docs.npmjs.com/misc/semver}\r\n */\r\n System.VERSION = \"4.10.33\";\r\n return System;\r\n}());\r\nexport { System };\r\n/**\r\n * A singleton global instance of [[System]].\r\n *\r\n * All code should use this, rather than instantiating their\r\n * own System objects.\r\n */\r\nexport var system = new System();\r\n//# sourceMappingURL=System.js.map"],"names":["DataItem","_super","_this","call","this","_disabled","hasProperties","values","categories","dates","locations","workingLocations","properties","sprites","isTemplate","_index","_visible","_hidden","_ignoreMinMax","hasChildren","isHiding","_valueAnimations","_locationAnimations","className","applyTheme","Object","defineProperty","prototype","get","_adapterO","enumerable","configurable","component","_animations","_disposers","push","set","value","hidden","setVisibility","sprite","__disabled","noChangeValues","visible","defaultState","hiddenState","_eventDispatcher","events","isEnabled","event_1","type","target","dispatchImmediately","show","duration","delay","fields","animation_1","_hideDisposer","removeDispose","field","setWorkingValue","animation","isFinished","dispose","hide","toValue","animation_2","anim","on","getDuration","interpolationDuration","apply","getValue","name","calculated","dataFields","getWorkingValue","realName","workingValue","getActualWorkingValue","setValue","currentValue","newDuration","event_2","property","handleDataItemValueChange","setCalculatedValue","event_3","handleDataItemCalculatedValueChange","animate","childObject","from","to","dummyData","interpolationEasing","handleInterpolationProgress","valueAnimation","stop","event_4","handleDataItemWorkingValueChange","setLocation","currentLocation","event_5","setWorkingLocation","workingLocation","locationAnimation","event_6","handleDataItemWorkingLocationChange","setDate","date","dateFormatter","parse","currentDate","getTime","getDate","setProperty","event_7","handleDataItemPropertyChange","setCategory","copyFrom","source","dataContext","adapter","opacity","event_8","animationOptions","easing","start","event","event_9","hasValue","i","len","length","parent","depth","_dataContext","addSprite","dataItem","options","verbose","commercialLicense","classNamePrefix","autoSetClassName","minPolylineStep","onlyShowOnViewport","queue","autoDispose","licenses","suppressErrors","suppressWarnings","animationsEnabled","nonce","deferredDelay","disableHoverOnTransform","pixelPerfectPrecision","Registry","themes","loadedThemes","_uidCount","registeredClasses","_placeholders","invalidSprites","invalidDatas","invalidRawDatas","invalidDataItems","invalidDataRange","invalidPositions","invalidLayouts","baseSprites","baseSpritesByUid","deferred","uid","getUniqueId","noBase","addEventListener","svg","paper","setAttribute","clientWidth","clientHeight","removeAttribute","_map","setCache","key","ttl","getCache","undefined","dispatch","eventType","data","getPlaceholder","addToInvalidComponents","baseId","removeFromInvalidComponents","addToInvalidSprites","removeFromInvalidSprites","addToInvalidPositions","removeFromInvalidPositions","addToInvalidLayouts","removeFromInvalidLayouts","registry","is","object","x","visualProperties","Sprite","_bindings","_isTemplate","_isPath","_inited","_ready","_isHidden","isShowing","isStandaloneInstance","_isActive","_mask","_positionPrecision","_language","_exporting","_exportable","_bbox","y","width","height","invalid","positionInvalid","propertyFields","applyOnClones","_measuredWidthSelf","_measuredHeightSelf","maxLeft","maxRight","maxTop","maxBottom","maxLeftSelf","maxRightSelf","maxTopSelf","maxBottomSelf","_isDragged","_isResized","_internalDisabled","_updateDisabled","_internalDefaultsApplied","rollOutDelay","isBaseSprite","shouldClone","appeared","ex","ey","dragWhileResize","measureFailed","preventShow","cloneTooltip","group","addGroup","setPropertyValue","_prevMeasuredWidth","_prevMeasuredHeight","_measuredWidth","_measuredHeight","_isMeasured","invalidate","setClassName","getCurrentThemes","_themes","parent_1","_parent","applyInternalDefaults","disabled","validate","beforeDraw","draw","afterDraw","invalidatePosition","validatePosition","pixelX","pixelY","dx","dy","attr","removeSVGAttribute","sizeChanged","measure","prevGroupTransform","transformString","moveTo","rotation","nonScaling","scale","globalScale","showTooltipOn","updateTooltipPosition","maskRectangle","_maskRectangle","_clipElement","e_1","_a","isMeasured","horizontalCenter","verticalCenter","measureElement","_b","keys","_c","next","done","e_1_1","error","return","applyFilters","interactionsEnabled","getPropertyValue","showOnInit","applyMask","dispatchReady","hideTooltip","showTooltip","isReady","reinit","setState","handleGlobalScale","nonScalingStroke","strokeWidth","updateFilterScale","filters","iterator","filter","removeFromInvalids","states","each","clone","interactions","plugins","configField","virtualParent","exportable","_tooltip","tooltip","_showSystemTooltip","showSystemTooltip","fillModifier","strokeModifier","focusFilter","isDisposed","htmlContainer","childNodes","removeChild","firstChild","clear","_clones","getIndex","_svgContainer","_interactionDisposer","_urlDisposer","element","_numberFormatter","_focusFilter","stroke","clonedFrom","fill","id","map","removeKey","_filters","removeValue","_alwaysShowDisposers","children","child","applyAccessibility","_topParent","topParent","oldParent","_tooltipContainer","tooltipContainer","_dataItem","handleAlwaysShowTooltip","handleAlwaysShow","oldDisposers","oldDisposer","disposer","addDisposer","_virtualParent","appendDefs","filterElement","appendDef","fill_1","modify","stroke_1","_clipPath","top","delayedMap","_delayedMap","_id","hasKey","Error","setKey","node","_paper","parent_2","setPaper","oldPaper","_htmlContainer","parent_3","_titleElement","add","_descriptionElement","onAll","setSVGAttributes","fillOpacity","strokeOpacity","shapeRendering","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","focusable","tabindex","role","setSVGAttribute","attribute","removeAttr","addClass","userClassName","uidAttr","updateClipPath","mask","createClipPath","pixelWidth","pixelHeight","point","width_1","height_1","removeChildNodes","filterUnits","appendPrimitives","w","h","removeClipPath","setElement","_element","removeElement","SVGPathElement","svgContainer","definedBBox","svgBBox","getBBox","updateCenter","prevElementTransform","bbox","elementX","elementY","elementWidth","elementHeigth","pixelPaddingLeft","pixelPaddingRight","pixelPaddingTop","pixelPaddingBottom","measuredWidth","measuredHeight","left","right","top_1","bottom","pixelPerfect","positionPrecision","matrix","createSVGMatrix","a","c","e","b","d","f","p1","createSVGPoint","p2","p3","p4","pt1","matrixTransform","pt2","pt3","pt4","Math","min","max","isHover","tooltipText","tooltipHTML","insertBefore","index","indexOf","moveValue","sortChildren","insertAfter","getRelativeX","innerWidth","getRelativeY","innerHeight","getPixelX","pixel","relative","getPixelY","isDragged","inited","reset","rect","hitTest","ax1","ay1","ax2","ay2","bx1","by1","bx2","by2","_states","state","processState","getKey","create","newValue","hoverable","clickable","clones","length_1","getSvgPoint","getBoundingClientRect","transitionDuration","isHidden","isActive","transitionEasing","transitTo","applyCurrentState","isDown","downPointers","isFocused","transition","propValues","allValues","propertyName","finalValue","option","newFilters_1","stateFilter","newFilter","currentFilter","pushAll","isInTransition","animations","isInteractive","handleOver","isRealHover","handleOut","handleDown","handleUp","handleFocus","handleBlur","setActive","current","setDisabled","hasChild","deepInvalidate","_background","numberFormatter","language","_dateFormatter","_durationFormatter","durationFormatter","ev","exporting","populateString","string","escape","tags","match","tag","replace","getTagValue","split","join","unescape","tagName","format","matches","parts","reg","exec","prop","params","reg2","matches2","method","getTagValueFromObject","populateStringFrom","formatApplied","part","numberValue","dateValue","durationValue","encodeURIComponent","formatParts","formatterType","setDataItem","dataContext_1","config","dataContext_2","dataContext2_1","fieldValue","anyThis","propValue","setColorProperty","toString","setPercentProperty","transform","precision","floor","length_2","bind","bindToProperty","modifier","observe","listener","context","title","readerTitle","description","readerDescription","readerHidden","checked","readerChecked","controls","readerControls","live","readerLive","orientation","readerOrientation","valueNow","readerValueNow","valueText","readerValueText","labelledByIds","describedByIds","labelledBy","readerLabelledBy","describedBy","readerDescribedBy","titleElement","titleId","textContent","descriptionElement","descriptionId","keyboardOptions","mouseOptions","_interaction","interaction","getInteraction","dom","trackable","draggable","swipeable","resizable","wheelable","contextMenuDisabled","inert","_tabindex","setEventDisposer","hasFocused","focusedElement","hoverOnFocus","inertiaOptions","applyCursorStyle","handleDragStart","handleDragMove","handleDragStop","isTouchProtected","touch","originalPosition","dragStart","pointer","dragStop","cancelled","cssScale","shift","hoverOptions","_outTimeout","SVGContainer","targetSprite","keepTargetHover","setTimeout","handleOutReal","hitOptions","originalAngle","originalScale","body","once","handleToggle","urlHandler","cursorOverStyle","_baseId","setBaseId","baseSprite","url","urlTarget","window","location","href","open","swipeOptions","handleResize","svgPoint1","point1","svgPoint2","point2","svgMidPoint","parentPoint1","startPoint1","parentPoint2","startPoint2","spritePoint1","spritePoint2","spriteMidPoint","parentPoint","cursorOptions","style","overStyle","defaultStyle","applyCursorOverStyle","downStyle","pointerEvents","getExporting","exp","_export","nonExportableSprites","modalPrefix","modal","has","openModal","text","closeModal","popups","template","openPopup","closeAllPopups","minX","maxX","minY","maxY","invalidateLayout","maxWidth","parentWidth","layout","align","pixelMarginLeft","pixelMarginRight","setMaxWidth","prevWidth","prevHeight","maxHeight","relativeWidth","previousWidth","previousHeight","parentHeight","valign","pixelMarginTop","pixelMarginBottom","setMaxHeight","relativeHeight","changed","percentWidth","percent","_pixelWidth","Number","percentHeight","_relativeHeight","_pixelHeight","minWidth","minHeight","_relativeWidth","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","setPath","setFill","realFill","setStroke","realStroke","hex","_rtl","rtl","showReal","_hideAnimation","kill","_showHideDisposer","hideReal","currentSprite","hiddenState_1","getVisibility","toFront","toBack","removeClass","tooltipDataItem","_tooltipDataItem","_tooltipColorSource","tooltipPosition","lastPointer","colorSource_1","tooltipColorSource_1","tooltipColorSource","getStrokeFromObject","getFillFromObject","background","animationDuration","label","rgb","autoTextColor","alternative","html","currentText","globalPoint","getTooltipX","getTooltipY","pointTooltipTo","instantly","showInViewport","pointTo","raiseCriticalError","closable","content","message","console","log","processConfig","getCursorStyle","cursorDowntyle","processDelayedMap","configOrder","setShowOnInit","_showOnInitDisposer","hideInitially","appear","_plugins","init","_systemUpdate","skippedSprites","_systemCheckIfValidate","_systemValidatePositions","_systemValidateLayouts","SpriteEventDispatcher","arguments","_interactionEvents","_dispatchSpriteEvent","imev","_dispatchSpritePointEvent","spritePoint","svgPoint","_addInteractionObjectEvent","callback","counter","insertKeyIfEmpty","increment","_on","info","disposers","togglable","SpriteState","fieldName","spriteValue","res","_x","asFunction","asIs","System","_isPaused","dummyCounter","_frameRequested","updateStepDuration","time","Date","now","reportTime","msg","update","skippedComponents","invalidData","dataProvider","dataInvalid","validateData","dataValidationProgress","validateRawData","validateDataItems","validateDataRange","skipRangeEvent","validateLayouts","validatePositions","hasSkipped","count","checkIfValidate2","concat","requestFrame","all0_1","softInvalidate","container","hardInvalidate","validateLayout","layoutInvalid","VERSION","system"],"sourceRoot":""}