{"version":3,"sources":["webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Color.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Disposer.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Cache.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Dictionary.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/DOM.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Array.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/AsyncPending.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Browser.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Adapter.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/InterfaceColorSet.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Animation.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/EventDispatcher.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Colors.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Instance.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/Ease.js","webpack:///./node_modules/@amcharts/amcharts4/.internal/core/utils/ColorSet.js"],"names":["__webpack_require__","d","__webpack_exports__","Color","color","toColor","_Registry__WEBPACK_IMPORTED_MODULE_0__","_Colors__WEBPACK_IMPORTED_MODULE_1__","_Type__WEBPACK_IMPORTED_MODULE_2__","this","_value","Object","defineProperty","prototype","get","enumerable","configurable","a","set","value","_lightColor","r","g","b","_darkColor","toString","alpha","rgba","hex","lighten","percent","rgb","brighten","saturate","saturation","darkColor","lightColor","Error","undefined","cacheId","cached","getCache","setCache","isColor","castColor","Disposer","MultiDisposer","MutableValueDisposer","CounterDisposer","tslib__WEBPACK_IMPORTED_MODULE_0__","_Array__WEBPACK_IMPORTED_MODULE_1__","dispose","_disposed","_dispose","isDisposed","_super","disposers","call","x","_this","_disposer","disposer","reset","apply","arguments","_counter","increment","cache","_Dictionary__WEBPACK_IMPORTED_MODULE_0__","_Type__WEBPACK_IMPORTED_MODULE_1__","Cache","_storage","ttl","owner","key","ownerStorage","insertKeyIfEmpty","item","touched","Date","getTime","setKey","hasKey","getKey","cacheItem","expired","removeKey","clear","DictionaryDisposer","Dictionary","DictionaryTemplate","_Disposer__WEBPACK_IMPORTED_MODULE_1__","_EventDispatcher__WEBPACK_IMPORTED_MODULE_2__","_Object__WEBPACK_IMPORTED_MODULE_3__","_Iterator__WEBPACK_IMPORTED_MODULE_4__","_String__WEBPACK_IMPORTED_MODULE_5__","dict","events","on","oldValue","iterator","v","_dictionary","insertKey","isEnabled","dispatchImmediately","type","target","newValue","updateKey","fn","ifEmpty","copyFrom","source","Symbol","_a","_b","_i","_c","label","push","length","sent","each","f","sortedIterator","y","t","template","_template","isTemplate","clone","create","SVGNS","XMLNS","XLINK","addEventListener","getElement","addClass","removeClass","setStyle","getComputedStyle","blur","contains","eventTarget","fixPixelPerfect","StyleRule","findFont","findFontSize","isElementInViewport","rootStylesheet","_AsyncPending__WEBPACK_IMPORTED_MODULE_2__","_Array__WEBPACK_IMPORTED_MODULE_4__","_Type__WEBPACK_IMPORTED_MODULE_5__","dom","listener","options","removeEventListener","el","e","document","getElementById","getElementsByClassName","HTMLElement","element","className","classList","add","currentClassName","getAttribute","setAttribute","split","filter","join","remove","property","style","currentStyle","defaultView","getPropertyValue","input","createElement","position","top","left","body","appendChild","focus","removeChild","cursor","parentNode","host","event","composedPath","rect","getBoundingClientRect","left_1","Math","round","top_1","getStylesheet","head","sheet","makeStylesheet","selector","root","index","cssRules","insertRule","styles","_rule","deleteRule","selectorText","_setVendorPrefixName","name","setProperty","styleId","StyleClass","_className","font","parent_1","parentElement","parent_2","window","innerHeight","documentElement","clientHeight","innerWidth","clientWidth","indexOf","any","map","eachReverse","eachContinue","shiftLeft","pushAll","move","toArray","copy","insertIndex","removeIndex","getSortedIndex","findIndex","array","i","test","output","Array","found","splice","length_1","toIndex","unshift","isArray","ordering","start","end","pivot","order","matches","raf","nextFrame","readFrame","writeFrame","whenIdle","triggerIdle","_Array__WEBPACK_IMPORTED_MODULE_0__","pendingFrame","nextQueue","readQueue","writeQueue","idleQueue","fps","requestAnimationFrame","setTimeout","frameLoop","now","pendFrame","shift","isSafari","navigator","vendor","isInternetExplorer","userAgent","Adapter","_SortedList__WEBPACK_IMPORTED_MODULE_0__","_Number__WEBPACK_IMPORTED_MODULE_1__","_Order__WEBPACK_IMPORTED_MODULE_2__","_utils_Iterator__WEBPACK_IMPORTED_MODULE_3__","_utils_Array__WEBPACK_IMPORTED_MODULE_4__","_utils_Type__WEBPACK_IMPORTED_MODULE_5__","GlobalAdapter","_callbackId","_callbacks","right","priority","id","addAll","callback","scope","insert","applyAll","callbacks","values","globalAdapter","c","object","has","keys","InterfaceColorSet","_Base__WEBPACK_IMPORTED_MODULE_1__","_Registry__WEBPACK_IMPORTED_MODULE_2__","_Color__WEBPACK_IMPORTED_MODULE_3__","_purposes","stroke","fill","primaryButton","primaryButtonHover","primaryButtonDown","primaryButtonActive","primaryButtonText","primaryButtonStroke","secondaryButton","secondaryButtonHover","secondaryButtonDown","secondaryButtonActive","secondaryButtonText","secondaryButtonStroke","grid","background","alternativeBackground","text","alternativeText","disabledBackground","positive","negative","applyTheme","debug","getFor","purpose","setFor","registeredClasses","AnimationDisposer","Animation","_defs_SVGDefaults__WEBPACK_IMPORTED_MODULE_2__","_utils_Disposer__WEBPACK_IMPORTED_MODULE_3__","_utils_Color__WEBPACK_IMPORTED_MODULE_4__","_utils_Percent__WEBPACK_IMPORTED_MODULE_5__","_utils_Ease__WEBPACK_IMPORTED_MODULE_7__","_utils_Colors__WEBPACK_IMPORTED_MODULE_8__","_utils_Math__WEBPACK_IMPORTED_MODULE_9__","_utils_Array__WEBPACK_IMPORTED_MODULE_10__","_utils_Type__WEBPACK_IMPORTED_MODULE_11__","_System__WEBPACK_IMPORTED_MODULE_12__","getProgressNumber","progress","from","to","getProgressPercent","getProgressColor","getHybridProperty","charAt","toUpperCase","substr","animationOptions","duration","easing","_loop","_pause","_delayTimeout","_time","_isFinished","pause","delay","animations","id_1","clearTimeout","_start","removeDispose","stopSameAnimations","requestFrame","_startTime","staticOptions","childObject","updateMethod","convertedFrom","isNaN","applyStaticOptions","event_1","update","loop","count","Infinity","resume","setProgress","event_2","stop","kill","isFinished","skipEvent","event_3","event_4","timeProgress","animation","delayed","killed_1","newOptions","oldOptions","EventDispatcher","TargetedEventDispatcher","_Array__WEBPACK_IMPORTED_MODULE_2__","_AsyncPending__WEBPACK_IMPORTED_MODULE_3__","_Type__WEBPACK_IMPORTED_MODULE_4__","_listeners","_killed","_disabled","_iterating","_enabled","hasListeners","hasListenersByType","killed","enable","disable","enableType","disableType","amount","_removeListener","_removeExistingListener","once","context","_eachListener","info","_shouldDispatch","dispatch","_on","shouldClone","onAll","off","rgbToHex","rgbToRGBA","interpolate","hslToRgb","rgbToHsl","isLight","_Math__WEBPACK_IMPORTED_MODULE_0__","namedColors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","hexToRgb","match","rgbaToRgb","shorthandRegex","replace","m","result","exec","parseInt","parseFloat","pad2","rgb1","rgb2","max","min","getLightnessStep","base","step","hsl","s","h","l","hue2rgb","p","q","useTheme","_System__WEBPACK_IMPORTED_MODULE_0__","_Registry__WEBPACK_IMPORTED_MODULE_1__","_Container__WEBPACK_IMPORTED_MODULE_2__","_Component__WEBPACK_IMPORTED_MODULE_3__","_rendering_Paper__WEBPACK_IMPORTED_MODULE_4__","_rendering_SVGContainer__WEBPACK_IMPORTED_MODULE_5__","_rendering_filters_FocusFilter__WEBPACK_IMPORTED_MODULE_6__","_elements_Preloader__WEBPACK_IMPORTED_MODULE_7__","_elements_AmChartsLogo__WEBPACK_IMPORTED_MODULE_8__","_elements_Tooltip__WEBPACK_IMPORTED_MODULE_9__","_utils_Disposer__WEBPACK_IMPORTED_MODULE_10__","_Percent__WEBPACK_IMPORTED_MODULE_11__","_Options__WEBPACK_IMPORTED_MODULE_12__","_Array__WEBPACK_IMPORTED_MODULE_13__","_Type__WEBPACK_IMPORTED_MODULE_14__","_DOM__WEBPACK_IMPORTED_MODULE_15__","_Utils__WEBPACK_IMPORTED_MODULE_16__","createChild","htmlElement","classType","htmlContainer","innerHTML","svgDiv_1","paper","SVGContainer","container_1","svgContainer","width","height","fillOpacity","append","group","relativeWidth","relativeHeight","container","sprite_1","topParent","uid","invalidSprites","invalidDatas","invalidPositions","invalidLayouts","baseId","isBaseSprite","focusFilter","baseSprites","baseSpritesByUid","maskRectangle","previousWidth","previousHeight","deepInvalidate","addDisposer","tooltipContainer_1","isMeasured","tooltipContainer","tooltip","hide","setBounds","maxWidth","maxHeight","preloader_1","__disabled","preloader","commercialLicense","logo_1","ev","isHidden","isHiding","show","logo","align","valign","numberFormatter","isStandaloneInstance","onlyShowOnViewport","queue","addToQueue","viewPortHandler","vpDisposer","log","sprite","queueHandler","removeFromQueue","nextSprite","showOnInit","invalidateData","reinit","appear","classError","chart","raiseCriticalError","themes","linear","polyOut3","sinOut","cubicIn","cubicOut","_utils_Math__WEBPACK_IMPORTED_MODULE_0__","polyOut","pow","sin","tau","PI","amplitude","period","asin","ColorSet","_Color__WEBPACK_IMPORTED_MODULE_2__","_Registry__WEBPACK_IMPORTED_MODULE_3__","_Colors__WEBPACK_IMPORTED_MODULE_4__","_Utils__WEBPACK_IMPORTED_MODULE_6__","_list","_currentStep","_startIndex","_currentPass","baseColor","stepOptions","passOptions","minColors","minLightness","maxLightness","shuffle","wrap","reuse","generate","getReusableColor","list","tmpstep","floor","next","getIndex","curColor","currentColor","hueStep","hue","mods","lightness","hues","sort","random","applyStepOptions","pass","processConfig","config","len"],"mappings":"kHAAAA,EAAAC,EAAAC,EAAA,sBAAAC,IAAAH,EAAAC,EAAAC,EAAA,sBAAAE,IAAAJ,EAAAC,EAAAC,EAAA,sBAAAG,IAAA,IAAAC,EAAAN,EAAA,QAAAO,EAAAP,EAAA,QAAAQ,EAAAR,EAAA,QAgCAG,EAAA,WAMA,SAAAA,EAAAC,GACAK,KAAAC,OAAAN,EAuLA,OArLAO,OAAAC,eAAAT,EAAAU,UAAA,OAMAC,IAAA,WACA,OAAAL,KAAAC,QAEAK,YAAA,EACAC,cAAA,IAEAL,OAAAC,eAAAT,EAAAU,UAAA,OAMAC,IAAA,WACA,OAAAL,KAAAC,OAAiCH,EAAA,KAAgBE,KAAAC,QAAA,QAEjDK,YAAA,EACAC,cAAA,IAEAL,OAAAC,eAAAT,EAAAU,UAAA,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J,EAAAF,EAAAC,EAAAsJ,GAEArJ,EAAAG,EAAAL,EAAAkJ,WAAA3uB,KAAAutB,YAAAoB,WAAA,GAAAjJ,GAAA1lB,KAAAwtB,YAAAmB,WAAA,GAAAK,EACAhvB,KAAA6tB,MACAlI,EAAAG,EAAA,EACAH,EAAAG,EAAAH,EAAAG,EAAAla,KAAAuiB,MAAAxI,EAAAG,GAEAH,EAAAG,EAAA,IACAH,EAAAG,IAAAH,EAAAG,EAAAla,KAAAuiB,MAAAxI,EAAAG,KAEAH,EAAAG,EAAoBmH,EAAA,KAAwBtH,EAAAG,EAAA9lB,KAAA0tB,aAAA1tB,KAAA2tB,gBAG5ChI,EAAAG,EAAA,EACAH,EAAAG,EAAA,EAEAH,EAAAG,EAAA,IACAH,EAAAG,EAAA,GAEAH,EAAAG,EAAoBmH,EAAA,KAAgBtH,EAAAG,EAAA9lB,KAAA0tB,aAAA1tB,KAAA2tB,gBASpCd,EAAAzsB,UAAA6uB,cAAA,SAAAC,GACA,GAAAA,GAEgBlmB,EAAA,KAAckmB,EAAAjB,OAAiBjlB,EAAA,KAAakmB,EAAAjB,MAC5D,QAAAtf,EAAA,EAAAwgB,EAAAD,EAAAjB,KAAAjnB,OAAyD2H,EAAAwgB,EAASxgB,IAClEugB,EAAAjB,KAAAtf,aAAoDme,EAAA,OACpDoC,EAAAjB,KAAAtf,GAAyCzO,OAAA4sB,EAAA,KAAA5sB,CAAKgvB,EAAAjB,KAAAtf,KAK9C7L,EAAA1C,UAAA6uB,cAAAjsB,KAAAhD,KAAAkvB,IAEArC,EAvZA,CAwZEha,EAAA,MAQFka,EAAA,KAAQnY,kBAAA,YAAAiY","file":"js/chunk-6d4c0f17.6dd823ff.js","sourcesContent":["/**\r\n * This module contains Color object definition\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Represents a color.\r\n *\r\n * `Color` accepts value only in [[iRGB]] object format. To create `Color`\r\n * object by parsing it from any supported string-based formats, use helper\r\n * [[color]] function:\r\n *\r\n * ```TypeScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar Color = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param color Source color\r\n */\r\n function Color(color) {\r\n this._value = color;\r\n }\r\n Object.defineProperty(Color.prototype, \"rgb\", {\r\n /**\r\n * Returns [[iRGB]] representation of the color.\r\n *\r\n * @return RGB object\r\n */\r\n get: function () {\r\n return this._value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"hex\", {\r\n /**\r\n * Returns color hex value string, e.g. \"#FF0000\".\r\n *\r\n * @return Hex color code\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToHex(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"rgba\", {\r\n /**\r\n * Returns an `rgba()` representation of the color, e.g.:\r\n * `rgba(255, 0, 0, 0.5)`.\r\n *\r\n * @return rgba color string\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToRGBA(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"alpha\", {\r\n /**\r\n * Returns current transparency.\r\n *\r\n * @return Alpha (0-1)\r\n */\r\n get: function () {\r\n if (this._value != null && this._value.a != null) {\r\n return this._value.a;\r\n }\r\n else {\r\n return 1;\r\n }\r\n },\r\n /**\r\n * Set alpha (transparency) of the color.\r\n *\r\n * @param value Alpha (0-1)\r\n */\r\n set: function (value) {\r\n if (this._value) {\r\n this._value.a = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"lightColor\", {\r\n /**\r\n * Returns current light color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._lightColor) {\r\n this._lightColor = new Color({ r: 255, g: 255, b: 255 });\r\n }\r\n return this._lightColor;\r\n },\r\n /**\r\n * Sets \"light\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._lightColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"darkColor\", {\r\n /**\r\n * Returns current dark color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._darkColor) {\r\n this._darkColor = new Color({ r: 0, g: 0, b: 0 });\r\n }\r\n return this._darkColor;\r\n },\r\n /**\r\n * Sets \"dark\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._darkColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Overrides `toString` method so that [[Color]] object can be used as\r\n * string.\r\n *\r\n * @ignore Exclude from docs\r\n * @return String represantion of color (usable in CSS)\r\n */\r\n Color.prototype.toString = function () {\r\n return this.alpha < 1 ? this.rgba : this.hex;\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent lighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease lightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.lighten = function (percent) {\r\n return new Color($colors.lighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent brighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease brightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.brighten = function (percent) {\r\n return new Color($colors.brighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] based on current color with specific saturation\r\n * applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @param saturation Saturation (0-1)\r\n * @return New (saturated) color\r\n */\r\n Color.prototype.saturate = function (saturation) {\r\n return new Color($colors.saturate(this.rgb, saturation));\r\n };\r\n Object.defineProperty(Color.prototype, \"alternative\", {\r\n /**\r\n * Returns a either light or dark color that contrasts specifically with\r\n * this color.\r\n *\r\n * Uses properties `darkColor` (default black) and `lightColor` (default\r\n * white).\r\n *\r\n * Useful when determining which color label should be on a colored\r\n * background, so that it stands out.\r\n *\r\n * @return Contrasting color\r\n */\r\n get: function () {\r\n if (this.rgb != null) {\r\n return $colors.isLight(this.rgb) ? this.darkColor : this.lightColor;\r\n }\r\n else {\r\n throw new Error(\"Color does not exist\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Color;\r\n}());\r\nexport { Color };\r\n/**\r\n * Resolves an input variable to a normal [[iRGB]] color and creates [[Color]]\r\n * object for it.\r\n *\r\n * @param value Input value\r\n * @param alpha Alpha (0-1)\r\n * @return Color object\r\n */\r\nexport function color(value, alpha) {\r\n if (!$type.hasValue(value)) {\r\n return new Color(undefined);\r\n }\r\n if (typeof value == \"string\") {\r\n var cacheId = \"_color_\" + value + \"_\" + (alpha || \"1\");\r\n var cached = registry.getCache(cacheId);\r\n if (cached) {\r\n return new Color({\r\n r: cached.r,\r\n g: cached.g,\r\n b: cached.b,\r\n a: cached.a\r\n });\r\n }\r\n var rgb = $colors.rgb(value, alpha);\r\n registry.setCache(cacheId, rgb);\r\n return new Color(rgb);\r\n }\r\n // Check if it's already a Color object\r\n if (value instanceof Color) {\r\n if ($type.hasValue(alpha)) {\r\n value.alpha = alpha;\r\n }\r\n return value;\r\n }\r\n // Not a string or Color instance, it's the iRGB object then\r\n return new Color(value);\r\n}\r\n/**\r\n * Checks if supplied argument is instance of [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Is Color?\r\n */\r\nexport function isColor(value) {\r\n return value instanceof Color;\r\n}\r\n/**\r\n * Converts any value to [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Color\r\n */\r\nexport function castColor(value) {\r\n return color(value);\r\n}\r\n/**\r\n * Converts any value into a [[Color]].\r\n *\r\n * @param value Source value\r\n * @return Color object\r\n */\r\nexport function toColor(value) {\r\n if ($type.hasValue(value) && !isColor(value)) {\r\n return castColor(value);\r\n }\r\n return value;\r\n}\r\n//# sourceMappingURL=Color.js.map","import * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * A base class for disposable objects.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Disposer = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param dispose Function that disposes object\r\n */\r\n function Disposer(dispose) {\r\n this._disposed = false;\r\n this._dispose = dispose;\r\n }\r\n /**\r\n * Checks if object is disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n Disposer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes the object.\r\n */\r\n Disposer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n this._dispose();\r\n }\r\n };\r\n return Disposer;\r\n}());\r\nexport { Disposer };\r\n/**\r\n * A collection of related disposers that can be disposed in one go.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar MultiDisposer = /** @class */ (function (_super) {\r\n tslib_1.__extends(MultiDisposer, _super);\r\n function MultiDisposer(disposers) {\r\n return _super.call(this, function () {\r\n $array.each(disposers, function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n return MultiDisposer;\r\n}(Disposer));\r\nexport { MultiDisposer };\r\n/**\r\n * A special kind of Disposer that has attached value set.\r\n *\r\n * If a new value is set using `set()` method, the old disposer value is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar MutableValueDisposer = /** @class */ (function (_super) {\r\n tslib_1.__extends(MutableValueDisposer, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function MutableValueDisposer() {\r\n var _this = _super.call(this, function () {\r\n if ($type.hasValue(_this._disposer)) {\r\n _this._disposer.dispose();\r\n _this._disposer = undefined;\r\n }\r\n }) || this;\r\n return _this;\r\n }\r\n /**\r\n * Returns current value.\r\n *\r\n * @return Value\r\n */\r\n MutableValueDisposer.prototype.get = function () {\r\n return this._value;\r\n };\r\n /**\r\n * Sets value and disposes previous disposer if it was set.\r\n *\r\n * @param value New value\r\n * @param disposer Disposer\r\n */\r\n MutableValueDisposer.prototype.set = function (value, disposer) {\r\n if ($type.hasValue(this._disposer)) {\r\n this._disposer.dispose();\r\n }\r\n this._disposer = disposer;\r\n this._value = value;\r\n };\r\n /**\r\n * Resets the disposer value.\r\n */\r\n MutableValueDisposer.prototype.reset = function () {\r\n this.set(undefined, undefined);\r\n };\r\n return MutableValueDisposer;\r\n}(Disposer));\r\nexport { MutableValueDisposer };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar CounterDisposer = /** @class */ (function (_super) {\r\n tslib_1.__extends(CounterDisposer, _super);\r\n function CounterDisposer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_counter description]\r\n *\r\n * @todo Description\r\n */\r\n _this._counter = 0;\r\n return _this;\r\n }\r\n /**\r\n * [increment description]\r\n *\r\n * @todo Description\r\n */\r\n CounterDisposer.prototype.increment = function () {\r\n var _this = this;\r\n // TODO throw an error if it is disposed\r\n ++this._counter;\r\n // TODO make this more efficient\r\n return new Disposer(function () {\r\n --_this._counter;\r\n if (_this._counter === 0) {\r\n _this.dispose();\r\n }\r\n });\r\n };\r\n return CounterDisposer;\r\n}(Disposer));\r\nexport { CounterDisposer };\r\n//# sourceMappingURL=Disposer.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Dictionary } from \"./Dictionary\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents object cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better storage\r\n * @todo TTL logging\r\n * @todo Garbage collector\r\n */\r\nvar Cache = /** @class */ (function () {\r\n function Cache() {\r\n /**\r\n * Storage for cache items.\r\n */\r\n this._storage = new Dictionary();\r\n /**\r\n * Default TTL in milliseconds.\r\n */\r\n this.ttl = 1000;\r\n }\r\n /**\r\n * Caches or updates cached value, resets TTL.\r\n *\r\n * If `ttl` is set to zero, item will never expire.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value\r\n * @param ttl TTL of the cache to live in milliseconds\r\n */\r\n Cache.prototype.set = function (owner, key, value, ttl) {\r\n // Create if storage does not exist for this owner\r\n var ownerStorage = this._storage.insertKeyIfEmpty(owner, function () { return new Dictionary(); });\r\n // Create cache item\r\n var item = {\r\n \"touched\": new Date().getTime(),\r\n \"ttl\": $type.isNumber(ttl) ? ttl : this.ttl,\r\n \"value\": value\r\n };\r\n // Set\r\n ownerStorage.setKey(key, item);\r\n };\r\n /**\r\n * Rerturns cached item, respecting TTL.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value to return if cache not available\r\n * @return Value, or `undefined` if not set\r\n */\r\n Cache.prototype.get = function (owner, key, value) {\r\n if (value === void 0) { value = undefined; }\r\n // \t\t || ypeof this._storage[owner][key] === \"undefined\" || this._storage[owner][key].expired === true) {\r\n if (this._storage.hasKey(owner)) {\r\n var ownerStorage = this._storage.getKey(owner);\r\n if (ownerStorage.hasKey(key)) {\r\n var cacheItem = ownerStorage.getKey(key);\r\n if (cacheItem.ttl && ((cacheItem.touched + cacheItem.ttl) < new Date().getTime())) {\r\n cacheItem.expired = true;\r\n }\r\n if (cacheItem.expired) {\r\n ownerStorage.removeKey(key);\r\n return value;\r\n }\r\n return cacheItem.value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n /**\r\n * Clears cache for specific owner or everything.\r\n *\r\n * @param owner Owner to clear cache for\r\n */\r\n Cache.prototype.clear = function (owner) {\r\n if (owner) {\r\n this._storage.removeKey(owner);\r\n }\r\n else {\r\n this._storage.clear();\r\n }\r\n };\r\n return Cache;\r\n}());\r\nexport { Cache };\r\n/**\r\n * ============================================================================\r\n * GLOBAL INSTANCE\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global instance of cache. Use this instance to cache any values.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var cache = new Cache();\r\n//# sourceMappingURL=Cache.js.map","import * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $object from \"./Object\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $string from \"./String\";\r\n/**\r\n * A disposable dictionary, which when disposed itself will call `dispose()`\r\n * method on all its items.\r\n */\r\nvar DictionaryDisposer = /** @class */ (function (_super) {\r\n tslib_1.__extends(DictionaryDisposer, _super);\r\n function DictionaryDisposer(dict) {\r\n var _this = this;\r\n var disposer = dict.events.on(\"removed\", function (x) {\r\n x.oldValue.dispose();\r\n }, undefined, false);\r\n _this = _super.call(this, function () {\r\n disposer.dispose();\r\n // TODO clear the dictionary ?\r\n $iter.each(dict.iterator(), function (a) {\r\n var v = a[1];\r\n v.dispose();\r\n });\r\n }) || this;\r\n return _this;\r\n }\r\n return DictionaryDisposer;\r\n}(Disposer));\r\nexport { DictionaryDisposer };\r\n/**\r\n * A Dictionary is collection where values of some type can be mapped to\r\n * string keys.\r\n *\r\n * You might call it an \"associative list\" or \"associative array\".\r\n */\r\nvar Dictionary = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function Dictionary() {\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n this._dictionary = {};\r\n }\r\n /**\r\n * Returns `true` if key exists in Dictionary.\r\n *\r\n * @param key The key to search for\r\n * @return `true` if key exists, `false` if it doesn't\r\n */\r\n Dictionary.prototype.hasKey = function (key) {\r\n return $object.hasKey(this._dictionary, key);\r\n };\r\n /**\r\n * Returns the value for a specific key.\r\n *\r\n * @param key The key to search for\r\n * @return Value for the key, or `undefined` if it doesn't exist\r\n */\r\n Dictionary.prototype.getKey = function (key) {\r\n return this._dictionary[key];\r\n };\r\n /**\r\n * Inserts value at specific key.\r\n *\r\n * Will thrown an exception if the key already exists in the dictionary.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.insertKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n throw new Error(\"Key \" + key + \" already exists in dictionary\");\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Adds or updates key/value into dictionary.\r\n *\r\n * If the key already exists, the old value will be overwritten.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.setKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n if (oldValue !== value) {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Updates the value at specific `key` using custom function.\r\n *\r\n * Passes in current value into the function, and uses its output as a new\r\n * value.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param fn Function to transform the value\r\n */\r\n Dictionary.prototype.updateKey = function (key, fn) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n var newValue = fn(oldValue);\r\n if (oldValue !== newValue) {\r\n this._dictionary[key] = newValue;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: newValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"Key \" + key + \" doesn't exist in dictionary\");\r\n }\r\n };\r\n /**\r\n * Removes value at specific `key` from dictionary.\r\n *\r\n * @param key Key to remove\r\n */\r\n Dictionary.prototype.removeKey = function (key) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n delete this._dictionary[key];\r\n if (this.events.isEnabled(\"removeKey\")) {\r\n this.events.dispatchImmediately(\"removeKey\", {\r\n type: \"removeKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * [insertKeyIfEmpty description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo description\r\n * @param key [description]\r\n * @param ifEmpty [description]\r\n * @return [description]\r\n */\r\n Dictionary.prototype.insertKeyIfEmpty = function (key, ifEmpty) {\r\n if (!this.hasKey(key)) {\r\n this.insertKey(key, ifEmpty());\r\n }\r\n return this.getKey(key);\r\n };\r\n /**\r\n * Removes all items from the dictionary.\r\n */\r\n Dictionary.prototype.clear = function () {\r\n var _this = this;\r\n // TODO dispatch this after clear\r\n if (this.events.isEnabled(\"removed\")) {\r\n $object.each(this._dictionary, function (key, value) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n oldValue: value\r\n });\r\n });\r\n }\r\n this._dictionary = {};\r\n if (this.events.isEnabled(\"cleared\")) {\r\n this.events.dispatchImmediately(\"cleared\", {\r\n type: \"cleared\",\r\n target: this\r\n });\r\n }\r\n };\r\n /**\r\n * Copies items from another Dictionary.\r\n *\r\n * @param source A Dictionary to copy items from\r\n */\r\n Dictionary.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n _this.setKey(a[0], a[1]);\r\n });\r\n };\r\n /**\r\n * Returns an interator that can be used to iterate through all items in\r\n * the dictionary.\r\n *\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.iterator = function () {\r\n // @todo fix this type after the Iterator bug is fixed\r\n // https://github.com/Microsoft/TypeScript/issues/16730\r\n return $object.entries(this._dictionary);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the keys/values of the dictionary.\r\n */\r\n Dictionary.prototype[Symbol.iterator] = function () {\r\n var _a, _b, _i, key;\r\n return tslib_1.__generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _a = [];\r\n for (_b in this._dictionary)\r\n _a.push(_b);\r\n _i = 0;\r\n _c.label = 1;\r\n case 1:\r\n if (!(_i < _a.length)) return [3 /*break*/, 4];\r\n key = _a[_i];\r\n if (!$object.hasKey(this._dictionary, key)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, [key, this._dictionary[key]]];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3:\r\n _i++;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each key/value in the dictionary.\r\n */\r\n Dictionary.prototype.each = function (f) {\r\n $iter.each(this.iterator(), function (_a) {\r\n var _b = tslib_1.__read(_a, 2), key = _b[0], value = _b[1];\r\n return f(key, value);\r\n });\r\n };\r\n /**\r\n * Returns an iterator that can be used to iterate through all items in\r\n * the dictionary, ordered by key.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.sortedIterator = function () {\r\n return $iter.sort(this.iterator(), function (x, y) { return $string.order(x[0], y[0]); });\r\n };\r\n return Dictionary;\r\n}());\r\nexport { Dictionary };\r\n/**\r\n * A version of a [[Dictionary]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar DictionaryTemplate = /** @class */ (function (_super) {\r\n tslib_1.__extends(DictionaryTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function DictionaryTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(DictionaryTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other dictionary.\r\n *\r\n * @param source Source dictionary\r\n */\r\n DictionaryTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n // TODO why does this need to clone ?\r\n _this.setKey(a[0], a[1].clone());\r\n });\r\n };\r\n /**\r\n * Instantiates a new object of the specified type, adds it to specified\r\n * `key` in the dictionary, and returns it.\r\n *\r\n * @param make Item type to use. Will use the default type for the dictionary if not specified.\r\n * @return Newly created item\r\n */\r\n DictionaryTemplate.prototype.create = function (key) {\r\n var _this = this;\r\n return this.insertKeyIfEmpty(key, function () { return _this.template.clone(); });\r\n };\r\n return DictionaryTemplate;\r\n}(Dictionary));\r\nexport { DictionaryTemplate };\r\n//# sourceMappingURL=Dictionary.js.map","/**\r\n * A collection of DOM-related functions.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { readFrame, writeFrame } from \"./AsyncPending\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * SVG namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var SVGNS = \"http://www.w3.org/2000/svg\";\r\n/**\r\n * XML namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XMLNS = \"http://www.w3.org/2000/xmlns/\";\r\n/**\r\n * XLINK namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XLINK = \"http://www.w3.org/1999/xlink\";\r\n/**\r\n * Function that adds a disposable event listener directly to a DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dom A DOM element to add event to\r\n * @param type Event type\r\n * @param listener Event listener\r\n * @returns Disposable event\r\n */\r\nexport function addEventListener(dom, type, listener, options) {\r\n //@todo proper type check for options: EventListenerOptions | boolean (TS for some reason gives error on passive parameter)\r\n //console.log(type, dom);\r\n dom.addEventListener(type, listener, options || false);\r\n return new Disposer(function () {\r\n dom.removeEventListener(type, listener, options || false);\r\n });\r\n}\r\n/**\r\n * Finds and returns an element reference using following logic:\r\n * * If we pass in an element instance, we just return it back.\r\n * * If we pass in a string, the function looks for an element with such id.\r\n * * If no element with such id is found, we grab the first element with a tag name like this.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element definition (reference, or id, or tag name)\r\n * @return Element reference\r\n * @todo Review this function as it seems pretty fuzzy and hacky\r\n */\r\nexport function getElement(el) {\r\n if ($type.isString(el)) {\r\n var e = document.getElementById(el);\r\n if (e == null) {\r\n e = document.getElementsByClassName(el)[0];\r\n }\r\n if (e instanceof HTMLElement) {\r\n return e;\r\n }\r\n }\r\n else if (el instanceof HTMLElement) {\r\n return el;\r\n }\r\n}\r\n/**\r\n * Adds a class name to an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function addClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n element.classList.add(className);\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \") + \" \" + className);\r\n }\r\n else {\r\n element.setAttribute(\"class\", className);\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\") + \" \" + className;\r\n }\r\n}\r\n/**\r\n * Removes a class name from an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function removeClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n element.classList.remove(className);\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \"));\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\");\r\n }\r\n}\r\n/**\r\n * Sets style property on DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Still needed?\r\n */\r\nexport function setStyle(element, property, value) {\r\n element.style[property] = value;\r\n}\r\n/**\r\n * Gets the computed style value for an element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getComputedStyle(element, property) {\r\n if (element.currentStyle) {\r\n return element.currentStyle[property];\r\n }\r\n return document.defaultView.getComputedStyle(element, null).getPropertyValue(property);\r\n}\r\n/**\r\n * Removes focus from any element by shifting focus to body.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function blur() {\r\n var input = document.createElement(\"input\");\r\n input.style.position = \"fixed\";\r\n input.style.top = \"0px\";\r\n input.style.left = \"-10000px\";\r\n document.body.appendChild(input);\r\n input.focus();\r\n input.blur();\r\n document.body.removeChild(input);\r\n}\r\n/**\r\n * Tries to focus the element.\r\n *\r\n * @ignore Exlude from docs\r\n * @param element Element to focus\r\n */\r\nexport function focus(element) {\r\n if (element instanceof HTMLElement) {\r\n element.focus();\r\n }\r\n else {\r\n var input = document.createElement(\"input\");\r\n var fo = document.createElementNS(SVGNS, \"foreignObject\");\r\n fo.appendChild(input);\r\n element.appendChild(fo);\r\n input.focus();\r\n input.disabled = true;\r\n fo.remove();\r\n }\r\n /*if ((element).focus != undefined) {\r\n (element).focus();\r\n }\r\n else if (element instanceof SVGSVGElement) {\r\n // Not implemented\r\n // @todo implement focus fallback\r\n }*/\r\n}\r\n/**\r\n * Returns markup for the element including the element tag itself.\r\n * SVG elements do not support `outerHTML` so this functions applies of\r\n * a workaround which creates a new temporary wrapper, clones element and uses\r\n * wrapper's `innerHTML`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element to get full markup for\r\n * @return Markup\r\n * @deprecated Not in use anywhere\r\n */\r\nexport function outerHTML(element) {\r\n if (element.outerHTML) {\r\n return element.outerHTML;\r\n }\r\n else {\r\n var twrap = document.createElement(\"div\");\r\n var tnode = element.cloneNode(true);\r\n twrap.appendChild(tnode);\r\n var content = twrap.innerHTML;\r\n return content;\r\n }\r\n}\r\n/**\r\n * Checks if element is a valid DOM node.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element\r\n * @return `true` if element is a valid DOM node\r\n */\r\nexport function isElement(el) {\r\n return el instanceof Object && el && el.nodeType === 1;\r\n}\r\n/**\r\n * Checks of element `a` contains element `b`.\r\n *\r\n * @param a Aleged ascendant\r\n * @param b Aleged descendant\r\n * @return Contains?\r\n */\r\nexport function contains(a, b) {\r\n var cursor = b;\r\n while (true) {\r\n if (a === cursor) {\r\n return true;\r\n }\r\n else if (cursor.parentNode == null) {\r\n if (cursor.host == null) {\r\n return false;\r\n }\r\n else {\r\n cursor = cursor.host;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets the true target of the Event.\r\n *\r\n * This is needed to make events work with the shadow DOM.\r\n *\r\n * @param event Event\r\n * @return EventTarget\r\n */\r\nexport function eventTarget(event) {\r\n if (typeof event.composedPath === \"function\") {\r\n return event.composedPath()[0];\r\n }\r\n else {\r\n return event.target;\r\n }\r\n}\r\n/**\r\n * Copies attributes from one element to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param source Element to copy attributes from\r\n * @param target Element to copy attributes to\r\n */\r\nexport function copyAttributes(source, target) {\r\n $array.each(source.attributes, function (attr) {\r\n // TODO what if it's null ?\r\n if (attr.value != null) {\r\n target.setAttribute(attr.name, attr.value);\r\n }\r\n });\r\n}\r\n/**\r\n * [fixPixelPerfect description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param el Element\r\n */\r\nexport function fixPixelPerfect(el) {\r\n readFrame(function () {\r\n // sometimes IE doesn't like this\r\n // TODO figure out a way to remove this\r\n try {\r\n var rect = el.getBoundingClientRect();\r\n var left_1 = rect.left - Math.round(rect.left);\r\n var top_1 = rect.top - Math.round(rect.top);\r\n if (left_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.left = left_1 + \"px\";\r\n });\r\n }\r\n if (top_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.top = top_1 + \"px\";\r\n });\r\n }\r\n }\r\n catch (e) { }\r\n });\r\n}\r\n/**\r\n * [rootStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar rootStylesheet;\r\n/**\r\n * [getStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\nfunction getStylesheet() {\r\n if (!$type.hasValue(rootStylesheet)) {\r\n // TODO use createElementNS ?\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n document.head.appendChild(e);\r\n rootStylesheet = e.sheet;\r\n }\r\n return rootStylesheet;\r\n}\r\n/**\r\n * [makeStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param selector [description]\r\n * @return [description]\r\n */\r\nfunction makeStylesheet(selector) {\r\n var root = getStylesheet();\r\n var index = root.cssRules.length;\r\n root.insertRule(selector + \"{}\", index);\r\n return root.cssRules[index];\r\n}\r\n/**\r\n * Defines a class for a CSS rule.\r\n *\r\n * Can be used to dynamically add CSS to the document.\r\n */\r\nvar StyleRule = /** @class */ (function (_super) {\r\n tslib_1.__extends(StyleRule, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param selector CSS selector\r\n * @param styles An object of style attribute - value pairs\r\n */\r\n function StyleRule(selector, styles) {\r\n var _this = \r\n // TODO test this\r\n _super.call(this, function () {\r\n var root = getStylesheet();\r\n // TODO a bit hacky\r\n var index = $array.indexOf(root.cssRules, _this._rule);\r\n if (index === -1) {\r\n throw new Error(\"Could not dispose StyleRule\");\r\n }\r\n else {\r\n root.deleteRule(index);\r\n }\r\n }) || this;\r\n _this._rule = makeStylesheet(selector);\r\n $object.each(styles, function (key, value) {\r\n _this.setStyle(key, value);\r\n });\r\n return _this;\r\n }\r\n Object.defineProperty(StyleRule.prototype, \"selector\", {\r\n /**\r\n * @return CSS selector\r\n */\r\n get: function () {\r\n return this._rule.selectorText;\r\n },\r\n /**\r\n * A CSS selector text.\r\n *\r\n * E.g.: `.myClass p`\r\n *\r\n * @param selector CSS selector\r\n */\r\n set: function (selector) {\r\n this._rule.selectorText = selector;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets the same style properties with browser-specific prefixes.\r\n *\r\n * @param name Attribute name\r\n * @param value Attribute value\r\n */\r\n StyleRule.prototype._setVendorPrefixName = function (name, value) {\r\n var style = this._rule.style;\r\n style.setProperty(\"-webkit-\" + name, value, \"\");\r\n style.setProperty(\"-moz-\" + name, value, \"\");\r\n style.setProperty(\"-ms-\" + name, value, \"\");\r\n style.setProperty(\"-o-\" + name, value, \"\");\r\n style.setProperty(name, value, \"\");\r\n };\r\n /**\r\n * Sets a value for specific style attribute.\r\n *\r\n * @param name Attribute\r\n * @param value Value\r\n */\r\n StyleRule.prototype.setStyle = function (name, value) {\r\n if (name === \"transition\") {\r\n this._setVendorPrefixName(name, value);\r\n }\r\n else {\r\n this._rule.style.setProperty(name, value, \"\");\r\n }\r\n };\r\n return StyleRule;\r\n}(Disposer));\r\nexport { StyleRule };\r\n/**\r\n * An internal counter for unique style ids.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar styleId = 0;\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar StyleClass = /** @class */ (function (_super) {\r\n tslib_1.__extends(StyleClass, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param styles An object of style attribute - value pairs\r\n * @param name Class name\r\n */\r\n function StyleClass(styles, name) {\r\n var _this = this;\r\n var className = (!$type.hasValue(name)\r\n // TODO generate the classname randomly\r\n ? \"__style_\" + (++styleId) + \"__\"\r\n : name);\r\n _this = _super.call(this, \".\" + className, styles) || this;\r\n _this._className = className;\r\n return _this;\r\n }\r\n Object.defineProperty(StyleClass.prototype, \"className\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Class name.\r\n *\r\n * @param name Class name\r\n */\r\n set: function (name) {\r\n this._className = name;\r\n this.selector = \".\" + name;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts the whole class to\r\n * @ignore Exclude from docs\r\n */\r\n StyleClass.prototype.toString = function () {\r\n return this._className;\r\n };\r\n return StyleClass;\r\n}(StyleRule));\r\nexport { StyleClass };\r\nexport function ready(f) {\r\n if (document.readyState !== \"loading\") {\r\n f();\r\n }\r\n else {\r\n var listener_1 = function () {\r\n if (document.readyState !== \"loading\") {\r\n document.removeEventListener(\"readystatechange\", listener_1);\r\n f();\r\n }\r\n };\r\n document.addEventListener(\"readystatechange\", listener_1);\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFont(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-family\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_1 = element.parentElement || element.parentNode;\r\n if (parent_1) {\r\n return findFont(parent_1);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFontSize(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-size\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_2 = element.parentElement || element.parentNode;\r\n if (parent_2) {\r\n return findFontSize(parent_2);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Checks whether element is not visible, whether directly or via its\r\n * ascendants.\r\n *\r\n * @param element Target element\r\n * @return Hidden?\r\n */\r\nexport function isHidden(element) {\r\n return (element.offsetParent === null);\r\n}\r\n/**\r\n * Checks wthether element is in the current viewport.\r\n *\r\n * @since 2.5.5\r\n * @param el Element\r\n * @return Within viewport?\r\n */\r\nexport function isElementInViewport(el) {\r\n var rect = el.getBoundingClientRect();\r\n return (rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n rect.left <= (window.innerWidth || document.documentElement.clientWidth));\r\n}\r\n//# sourceMappingURL=DOM.js.map","import * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Searches `array` for `value`.\r\n *\r\n * Returns -1 if not found.\r\n *\r\n * @param array Source array\r\n * @param value Value to search\r\n * @returns Index\r\n */\r\nexport function indexOf(array, value) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n // TODO handle NaN\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Calls `test` for each element in `array`.\r\n *\r\n * If `test` returns `true` then it immediately returns `true`.\r\n *\r\n * If `test` returns `false` for all of the elements in `array` then it returns `false`.\r\n *\r\n * @param array Source array\r\n * @param test Function which is called on each element\r\n * @returns Whether `test` returned true or not\r\n */\r\nexport function any(array, test) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (test(array[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Calls `fn` function for every member of array and returns a new array out\r\n * of all outputs.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n * @returns New array\r\n */\r\nexport function map(array, fn) {\r\n var length = array.length;\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n output[i] = fn(array[i], i);\r\n }\r\n return output;\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function each(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array in reverse order and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachReverse(array, fn) {\r\n var i = array.length;\r\n while (i--) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * If `fn` call evaluates to `false`, further iteration is cancelled.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (!fn(array[i], i)) {\r\n break;\r\n }\r\n }\r\n}\r\n/**\r\n * Shifts an item at `index` towards beginning of the array.\r\n *\r\n * @param array Source array\r\n * @param index Target element index\r\n */\r\nexport function shiftLeft(array, index) {\r\n var length = array.length;\r\n for (var i = index; i < length; ++i) {\r\n array[i - index] = array[i];\r\n }\r\n array.length = length - index;\r\n}\r\n/**\r\n * Returns the last item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function last(array) {\r\n var length = array.length;\r\n return length ? array[length - 1] : undefined;\r\n}\r\n/**\r\n * Returns the first item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function first(array) {\r\n return array[0];\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * Caps `index` to be between `0` and `array.length`\r\n *\r\n * @param array Source array\r\n * @param element Item to insert\r\n * @param array Index to insert item at\r\n */\r\nexport function insert(array, element, index) {\r\n //if (array) {\r\n index = $math.fitToRange(index, 0, array.length);\r\n array.splice(index, 0, element);\r\n //}\r\n}\r\n/**\r\n * Removes all copies of `element` from `array` (if they exist) and then\r\n * inserts `element` at `index`.\r\n *\r\n * @param array Source array\r\n * @param element Item\r\n * @param array Index to move item to\r\n */\r\nexport function setIndex(array, element, index) {\r\n remove(array, element);\r\n insert(array, element, index);\r\n}\r\n/**\r\n * Pushes all of the elements from `input` into `array`.\r\n *\r\n * @param array Output array\r\n * @param input Input array\r\n */\r\nexport function pushAll(array, input) {\r\n var length = input.length;\r\n for (var i = 0; i < length; ++i) {\r\n array.push(input[i]);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array`.\r\n *\r\n * If there are multiple copies of `element`, they are all removed.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n */\r\nexport function remove(array, element) {\r\n var found = false;\r\n var index = array.indexOf(element);\r\n if (index !== -1) {\r\n found = true;\r\n array.splice(index, 1);\r\n var length_1 = array.length;\r\n while (index < length_1) {\r\n // TODO handle NaN\r\n if (array[index] === element) {\r\n array.splice(index, 1);\r\n --length_1;\r\n }\r\n else {\r\n ++index;\r\n }\r\n }\r\n }\r\n return found;\r\n}\r\n/**\r\n * Adds an `element` to `array`.\r\n *\r\n * If array already contains and item like this, it is removed before adding\r\n * it again.\r\n *\r\n * Optionally `toIndex` can be specified to add element at specific index.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to move item to\r\n */\r\nexport function move(array, element, toIndex) {\r\n // @todo this implementation must be the same as the List.moveValue method\r\n // @todo don't do anything if the desired index is the same as the current index\r\n var index = indexOf(array, element);\r\n // @todo remove all old values rather than only the first ?\r\n if (index !== -1) {\r\n removeIndex(array, index);\r\n }\r\n if (toIndex == null) {\r\n array.push(element);\r\n }\r\n else {\r\n insertIndex(array, toIndex, element);\r\n }\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to add item at\r\n */\r\nexport function add(array, element, index) {\r\n // Append to the end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // Add to the beginning of array if index is 0\r\n else if (index === 0) {\r\n array.unshift(element);\r\n }\r\n // Add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array` (if it exists) and then inserts `element` at\r\n * `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n * @param array Index to move item to\r\n */\r\nexport function replace(array, element, index) {\r\n // check if exists\r\n var ind = array.indexOf(element);\r\n // remove if exists\r\n if (ind !== -1) {\r\n array.splice(ind, 1);\r\n }\r\n // add to end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Wraps `input` in an array, if it isn't already an array.\r\n *\r\n * @param input Source value\r\n * @return An array\r\n */\r\nexport function toArray(input) {\r\n if (Array.isArray(input)) {\r\n return input;\r\n }\r\n else {\r\n return [input];\r\n }\r\n}\r\n/**\r\n * Returns `true` if `element` exists in `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to search for\r\n * @returns Item in array?\r\n */\r\nexport function has(array, element) {\r\n return indexOf(array, element) !== -1;\r\n}\r\n/**\r\n * Returns a shallow copy of `array`.\r\n *\r\n * @param array Source array\r\n * @returns Copy of the array\r\n */\r\nexport function copy(array) {\r\n var length = array.length;\r\n // It's faster to create the array with a pre-defined length\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n // Because the array has a pre-defined length, we have to assign rather than push\r\n // This is also faster than pushing\r\n output[i] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Returns a copy of `array` which contains all the elements between `start`\r\n * and `end`. (including `start` and excluding `end`)\r\n *\r\n * If `end` is not provided, it defaults to `array.length`.\r\n *\r\n * @param array Source array\r\n * @param start Start index\r\n * @param end End index\r\n * @returns Part of the array\r\n */\r\nexport function slice(array, start, end) {\r\n if (end === void 0) { end = array.length; }\r\n var output = new Array(end - start);\r\n for (var i = start; i < end; ++i) {\r\n output[i - start] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Inserts a value into array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n * @param value Value to insert\r\n */\r\nexport function insertIndex(array, index, value) {\r\n array.splice(index, 0, value);\r\n}\r\n/**\r\n * Removes a value from array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n */\r\nexport function removeIndex(array, index) {\r\n array.splice(index, 1);\r\n}\r\n/**\r\n * Orders an array using specific `ordering` function and returns index of\r\n * the `value`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param array Source array\r\n * @param ordering An ordering function\r\n * @param value Value to search for\r\n * @returns Result of the search\r\n */\r\nexport function getSortedIndex(array, ordering, value) {\r\n var start = 0;\r\n var end = array.length;\r\n var found = false;\r\n while (start < end) {\r\n // TODO is this faster/slower than using Math.floor ?\r\n var pivot = (start + end) >> 1;\r\n var order = ordering(value, array[pivot]);\r\n // less\r\n if (order < 0) {\r\n end = pivot;\r\n // equal\r\n }\r\n else if (order === 0) {\r\n found = true;\r\n start = pivot + 1;\r\n // more\r\n }\r\n else {\r\n start = pivot + 1;\r\n }\r\n }\r\n return {\r\n found: found,\r\n index: (found ? start - 1 : start)\r\n };\r\n}\r\n/**\r\n * Searches the array using custom function and returns index of the item if\r\n * found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns -1.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Index of the item if found\r\n */\r\nexport function findIndex(array, matches) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (matches(array[i], i)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Searches the array using custom function and returns item if found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns `undefined`.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Item if found\r\n */\r\nexport function find(array, matches) {\r\n var index = findIndex(array, matches);\r\n if (index !== -1) {\r\n return array[index];\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function shuffle(array) {\r\n // https://stackoverflow.com/a/2450976/449477\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n}\r\n//# sourceMappingURL=Array.js.map","/**\r\n * A collection of low-level async operation stuff.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nvar pendingFrame = false;\r\nvar nextQueue = [];\r\nvar readQueue = [];\r\nvar writeQueue = [];\r\nvar idleQueue = [];\r\nvar fps = 1000 / 60;\r\n/**\r\n * [raf description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport var raf = (typeof requestAnimationFrame === \"function\"\r\n ? function (fn) {\r\n requestAnimationFrame(fn);\r\n }\r\n : function (fn) {\r\n setTimeout(fn, fps);\r\n });\r\n/**\r\n * [frameLoop description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction frameLoop() {\r\n var now = Date.now();\r\n var length = nextQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n nextQueue[i](now);\r\n }\r\n $array.shiftLeft(nextQueue, length);\r\n for (var i = 0; i < readQueue.length; ++i) {\r\n readQueue[i](now);\r\n }\r\n readQueue.length = 0;\r\n for (var i = 0; i < writeQueue.length; ++i) {\r\n writeQueue[i](now);\r\n }\r\n writeQueue.length = 0;\r\n if (nextQueue.length === 0 && readQueue.length === 0) {\r\n pendingFrame = false;\r\n }\r\n else {\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [pendFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction pendFrame() {\r\n if (!pendingFrame) {\r\n pendingFrame = true;\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [nextFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function nextFrame(fn) {\r\n nextQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [readFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function readFrame(fn) {\r\n readQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [writeFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function writeFrame(fn) {\r\n writeQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [whenIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function whenIdle(fn) {\r\n idleQueue.push(fn);\r\n}\r\n/**\r\n * [triggerIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo Maybe don't trigger a callback which was added while in the middle of triggering?\r\n */\r\nexport function triggerIdle() {\r\n var now = Date.now();\r\n var length = idleQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n idleQueue.shift()(now);\r\n }\r\n}\r\n//# sourceMappingURL=AsyncPending.js.map","// Also detects iOS\r\nexport function isSafari() {\r\n return /apple/i.test(navigator.vendor);\r\n}\r\nexport function isInternetExplorer() {\r\n return /MSIE |Trident\\//.test(navigator.userAgent);\r\n}\r\n//# sourceMappingURL=Browser.js.map","/**\r\n * An Adapter can be used to apply chained synchronous transformations to any\r\n * value at runtime.\r\n *\r\n * Each type class using Adapters must have `adapters` property and adapter\r\n * interface defined.\r\n *\r\n * Adapters can be used to allow external code to apply transformations to any\r\n * value at any time.\r\n *\r\n * For example we have a Weather class which has a method `now()` which returns\r\n * current temperature.\r\n *\r\n * ```\r\n * function now() {\r\n * // ... calculate temperature\r\n * let temp = \"Temperature now is \" + degrees + \"F\";\r\n * return temp;\r\n * }\r\n * ```\r\n *\r\n * Now, supposed we want to let other classes to modify the output of the\r\n * `now()`? We just apply an adapter to the `temp` before it is returned:\r\n *\r\n * ```\r\n * temp = this.adapters.apply(\"now\", {\r\n * temp: temp,\r\n * degrees: degrees\r\n * }).temp;\r\n * ```\r\n *\r\n * Some other class might tap onto it by defining an Adapter that calculates\r\n * the temperature in Celsius:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"(\" + farenheitToCelsius(arg.degrees) + \"C)\";\r\n * return arh;\r\n * });\r\n *\r\n * Furthermore some time-related class could add time:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"; the time now is \" + (new Date().toLocaleString());\r\n * return arh;\r\n * });\r\n *\r\n * So without adapters we would get output like this:\r\n *\r\n * ```\r\n * Temperature now is 90F\r\n * ```\r\n *\r\n * With adapters applied we now have:\r\n *\r\n * ```\r\n * Temperature now is 90F (32C); the time now is 12/11/2012, 7:00:00 PM\r\n * ```\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SortedList } from \"./SortedList\";\r\nimport * as $number from \"./Number\";\r\nimport * as $order from \"./Order\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * GLOBAL ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global adapter is an adpater that is attached to a class type rather than\r\n * specific object instance.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar GlobalAdapter = /** @class */ (function () {\r\n function GlobalAdapter() {\r\n /**\r\n * Callback id iterator.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of if callbacks (adapters).\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n }\r\n /**\r\n * Adds a global callback which is not specific to any particular object.\r\n * Whenever an adapter in any object of the specific class type is invoked\r\n * global adapters will kick in.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param callback Callback function\r\n * @param priority Priority (higher priority meaning adapter will be applied later)\r\n * @param scope Callback function scaope\r\n */\r\n GlobalAdapter.prototype.addAll = function (type, key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope,\r\n type: type\r\n });\r\n };\r\n /**\r\n * Returns if there are adapters for specific type available.\r\n *\r\n * @param type Adapter type\r\n * @param key Adapter key\r\n * @return {boolean}\r\n */\r\n GlobalAdapter.prototype.isEnabled = function (type, key) {\r\n // TODO check the type and key\r\n return this._callbacks.length > 0;\r\n };\r\n /**\r\n * Applies global adapters for the object of the specific type.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param value Value\r\n */\r\n GlobalAdapter.prototype.applyAll = function (type, key, value) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length = callbacks.length;\r\n if (length == 0) {\r\n return value;\r\n }\r\n // Cycle through all callbacks and find the ones we need to use\r\n for (var i = 0; i < length; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key && type instanceof item.type) {\r\n value = item.callback.call(item.scope, value, type, key);\r\n }\r\n }\r\n return value;\r\n };\r\n return GlobalAdapter;\r\n}());\r\nexport { GlobalAdapter };\r\n/**\r\n * A global Adapter for plugins that want to add specific\r\n * functionality for any chart, not just specific instance.\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * @todo Description (improve)\r\n */\r\nexport var globalAdapter = new GlobalAdapter();\r\n/**\r\n * ============================================================================\r\n * REGULAR ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Adapter allows adding ordered callback functions and associating them with a\r\n * string-based key. An Adapter user can then easily invoke those callbacks to\r\n * apply custom functions on its input, output or intermediate values.\r\n *\r\n * Custom code and plugins can add their own callbacks to modify and enhance\r\n * core functionality.\r\n *\r\n * See the description of `add()` for an example.\r\n *\r\n * Almost any object in amCharts4 has own adapter, accessible with `adapter`\r\n * property.\r\n *\r\n * Any adapters added to it will be applied to that object only.\r\n *\r\n * ### Global Adapters\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * {@link https://www.amcharts.com/docs/v4/reference/adapter_module/#globalAdapter_property More info}.\r\n *\r\n * @important\r\n */\r\nvar Adapter = /** @class */ (function () {\r\n /**\r\n * Constructor, sets the object referece this Adapter should be used for.\r\n *\r\n * @param c Object\r\n */\r\n function Adapter(c) {\r\n /**\r\n * Internal counter for callback ids.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of adapter callbacks.\r\n *\r\n * @param $number.order(left.priority, right.priority) [description]\r\n * @param $number.order(left.id, right.id));\t} [description]\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n this.object = c;\r\n // TODO this exposes the internal events\r\n this.events = this._callbacks.events;\r\n }\r\n /**\r\n * Adds a callback for a specific key.\r\n *\r\n * ```TypeScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", function(value, target, key) {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"adapter\": {\r\n * \t// Override fill color value and make all slices green\r\n * \t\"fill\": function(value, target, key) {\r\n * \t return am4core.color(\"#005500\");\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will call user-defined function (adapter) whenever `fill` value\r\n * is requested from the Pie series, allowing it to override the default\r\n * using custom code and any fuzzy logic.\r\n *\r\n * There can be any number of adapters set on one property key.\r\n *\r\n * In this case adapters will be applied in daisy-chain fashion. The first\r\n * adapter in queue will make its transformation. The next one will have\r\n * the output of the first adapter as a starting value, etc.\r\n *\r\n * The order of the adapters are determined either by the order they were\r\n * added in, or their `priority` value.\r\n *\r\n * The heigher the `priority`, the later in the game adapter will be applied.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n */\r\n Adapter.prototype.add = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope\r\n });\r\n };\r\n /**\r\n * Checks whether specific adapter is already set.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n * @returns Adapter set?\r\n */\r\n Adapter.prototype.has = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n // @todo Implement actual check\r\n return false;\r\n };\r\n /**\r\n * Removes adapter callbacks for the specific `key`.\r\n *\r\n * If `priority` is specified, only callbacks for that priority are removed.\r\n *\r\n * @param key Key\r\n * @param priority Priority\r\n * @todo Implement\r\n */\r\n Adapter.prototype.remove = function (key, priority) {\r\n var _this = this;\r\n // It has to make a copy because it removes the elements while iterating\r\n // TODO inefficient\r\n $array.each($iter.toArray(this._callbacks.iterator()), function (item) {\r\n // TODO test this\r\n if (item.key === key && (!$type.isNumber(priority) || priority === item.priority)) {\r\n _this._callbacks.remove(item);\r\n }\r\n });\r\n };\r\n /**\r\n * Returns if there are any adapters set for the specific `key`.\r\n *\r\n * @returns Are there any adapters for the key?\r\n */\r\n Adapter.prototype.isEnabled = function (key) {\r\n // TODO check the key\r\n return this._callbacks.length > 0 || globalAdapter.isEnabled(this.object, key);\r\n };\r\n /**\r\n * Passes the input value through all the callbacks for the defined `key`.\r\n *\r\n * @param key Key\r\n * @param value Input value\r\n * @param ...rest Rest of the parameters to be passed into callback\r\n * @return Output value\r\n */\r\n Adapter.prototype.apply = function (key, value) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length = callbacks.length;\r\n if (length > 0) {\r\n for (var i = 0; i < length; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key) {\r\n value = item.callback.call(item.scope, value, this.object, key);\r\n }\r\n }\r\n }\r\n // Apply global adapters\r\n value = globalAdapter.applyAll(this.object, key, value);\r\n return value;\r\n };\r\n /**\r\n * Returns all adapter keys that are currently in effect.\r\n *\r\n * @return Adapter keys\r\n */\r\n Adapter.prototype.keys = function () {\r\n // TODO inefficient\r\n return $iter.toArray($iter.map(this._callbacks.iterator(), function (x) { return x.key; }));\r\n };\r\n /**\r\n * Copies all the adapter callbacks from `source`.\r\n *\r\n * @param source An Adapter to copy items from\r\n */\r\n Adapter.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source._callbacks.iterator(), function (x) {\r\n _this.add(x.key, x.callback, x.priority, x.scope);\r\n });\r\n };\r\n /**\r\n * Clears all callbacks from this Adapter.\r\n */\r\n Adapter.prototype.clear = function () {\r\n this._callbacks.clear();\r\n };\r\n return Adapter;\r\n}());\r\nexport { Adapter };\r\n//# sourceMappingURL=Adapter.js.map","/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n */\r\nimport * as tslib_1 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 { color } from \"./Color\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n *\r\n * The main difference from the basic [[ColorSet]] is that instead of sequenced\r\n * colors, it uses a concept of named colors.\r\n *\r\n * This way, every element in the UI can extract an exact color theme author\r\n * meant for the specific purpose, like strokes, backgrounds, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar InterfaceColorSet = /** @class */ (function (_super) {\r\n tslib_1.__extends(InterfaceColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InterfaceColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Maps the list of purposes (like \"stroke\") to an index of color of the\r\n * color set.\r\n */\r\n _this._purposes = {\r\n stroke: color(\"#e5e5e5\"),\r\n fill: color(\"#f3f3f3\"),\r\n primaryButton: color(\"#6794dc\"),\r\n primaryButtonHover: color(\"#6771dc\"),\r\n primaryButtonDown: color(\"#68dc75\"),\r\n primaryButtonActive: color(\"#68dc75\"),\r\n primaryButtonText: color(\"#FFFFFF\"),\r\n primaryButtonStroke: color(\"#FFFFFF\"),\r\n secondaryButton: color(\"#d9d9d9\"),\r\n secondaryButtonHover: color(\"#d9d9d9\").brighten(-0.25),\r\n secondaryButtonDown: color(\"#d9d9d9\").brighten(-0.35),\r\n secondaryButtonActive: color(\"#d9d9d9\").brighten(0.35),\r\n secondaryButtonText: color(\"#000000\"),\r\n secondaryButtonStroke: color(\"#FFFFFF\"),\r\n grid: color(\"#000000\"),\r\n background: color(\"#ffffff\"),\r\n alternativeBackground: color(\"#000000\"),\r\n text: color(\"#000000\"),\r\n alternativeText: color(\"#FFFFFF\"),\r\n disabledBackground: color(\"#999999\"),\r\n positive: color(\"#67dc75\"),\r\n negative: color(\"#dc6788\")\r\n };\r\n _this.className = \"InterfaceColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n InterfaceColorSet.prototype.debug = function () { };\r\n /**\r\n * Returns a color to be used for the specific purpose.\r\n *\r\n * ```TypeScript\r\n * let uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n * ```JavaScript\r\n * var uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n *\r\n * @param purpose Color use purpuse\r\n * @return Color\r\n */\r\n InterfaceColorSet.prototype.getFor = function (purpose) {\r\n return this._purposes[purpose];\r\n };\r\n /**\r\n * Sets color to be used for the specific purpose.\r\n *\r\n * @param purpose Color use purpose\r\n * @param color Color\r\n */\r\n InterfaceColorSet.prototype.setFor = function (purpose, color) {\r\n this._purposes[purpose] = color;\r\n };\r\n return InterfaceColorSet;\r\n}(BaseObject));\r\nexport { InterfaceColorSet };\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[\"InterfaceColorSet\"] = InterfaceColorSet;\r\n//# sourceMappingURL=InterfaceColorSet.js.map","/**\r\n * Animation module.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { SVGDefaults } from \"../defs/SVGDefaults\";\r\nimport { Disposer } from \"../utils/Disposer\";\r\nimport { Color } from \"../utils/Color\";\r\nimport { Percent, percent } from \"../utils/Percent\";\r\nimport * as $async from \"../utils/AsyncPending\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $colors from \"../utils/Colors\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { system } from \"../System\";\r\n/**\r\n * Calls a `callback` function for the `duration` of milliseconds.\r\n *\r\n * @todo Needed?\r\n * @deprecated Not used anywhere\r\n * @ignore Exclude from docs\r\n * @param duration Duration (ms)\r\n * @param callback Callback function\r\n * @return Disposer\r\n */\r\nexport function animate(duration, callback) {\r\n var disposed = false;\r\n // TODO use performance.now() ?\r\n var startTime = Date.now();\r\n function loop(now) {\r\n if (!disposed) {\r\n var diff = now - startTime;\r\n if (diff >= duration) {\r\n callback(1);\r\n }\r\n else {\r\n $async.nextFrame(loop);\r\n callback(diff / duration);\r\n }\r\n }\r\n }\r\n $async.nextFrame(loop);\r\n return new Disposer(function () {\r\n disposed = true;\r\n });\r\n}\r\n/**\r\n * Returns numeric value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressNumber(progress, from, to) {\r\n return from + ((to - from) * progress);\r\n}\r\n/**\r\n * Returns [[Percent]] value accoring to progress between start and end\r\n * values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressPercent(progress, from, to) {\r\n return new Percent(getProgressNumber(progress, from.percent, to.percent));\r\n}\r\n/**\r\n * Returns color value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Color according to progress\r\n */\r\nfunction getProgressColor(progress, from, to) {\r\n return new Color($colors.interpolate(from.rgb, to.rgb, progress));\r\n}\r\n/**\r\n * [getHybridProperty description]\r\n *\r\n * @todo Description\r\n * @param property [description]\r\n * @param type [description]\r\n * @return [description]\r\n */\r\nfunction getHybridProperty(property, type) {\r\n return type + property.charAt(0).toUpperCase() + property.substr(1);\r\n}\r\nvar AnimationDisposer = /** @class */ (function () {\r\n function AnimationDisposer(array) {\r\n this._disposer = new Disposer(function () {\r\n while (array.length !== 0) {\r\n array[0].dispose();\r\n }\r\n });\r\n }\r\n AnimationDisposer.prototype.isDisposed = function () {\r\n return this._disposer.isDisposed();\r\n };\r\n AnimationDisposer.prototype.dispose = function () {\r\n this._disposer.dispose();\r\n };\r\n return AnimationDisposer;\r\n}());\r\nexport { AnimationDisposer };\r\n/**\r\n * Animation can be used to transition certain properties on an object that\r\n * implements [[IAnimatable]] interface.\r\n *\r\n * @see {@link IAnimationEvents} for a list of available events\r\n */\r\nvar Animation = /** @class */ (function (_super) {\r\n tslib_1.__extends(Animation, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param object An object animation should run on\r\n * @param animationOptions One or several (array) of animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n */\r\n function Animation(object, animationOptions, duration, easing) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the animation in milliseconds.\r\n */\r\n _this.duration = 0;\r\n /**\r\n * Easing function to use.\r\n *\r\n * @see {@link Ease}\r\n */\r\n _this.easing = $ease.linear;\r\n /**\r\n * Contains progress of the current animation: 0 (start) to 1 (end).\r\n */\r\n _this.progress = 0;\r\n /**\r\n * Indicated how many times animation should loop.\r\n */\r\n _this._loop = 0;\r\n /**\r\n * Animation is paused.\r\n */\r\n _this._pause = false;\r\n /**\r\n * Holds reference to timeout for delayed play.\r\n */\r\n _this._delayTimeout = null;\r\n /**\r\n * Elapsed time in currently playing animation.\r\n */\r\n _this._time = 0;\r\n _this._isFinished = false;\r\n _this.className = \"Animation\";\r\n // Set parameters\r\n _this.object = object;\r\n _this.animationOptions = $array.toArray(animationOptions);\r\n _this.duration = duration;\r\n if (easing) {\r\n _this.easing = easing;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n //this.stopSameAnimations();\r\n /*if ($type.hasValue(callback)) {\r\n // TODO don't use .call\r\n this.events.on(\"animationended\", callback, object);\r\n }*/\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n // TODO verify that this is correct\r\n Animation.prototype.debug = function () { };\r\n /**\r\n * Disposes this object, clears up after itself.\r\n */\r\n Animation.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n this.pause();\r\n };\r\n /**\r\n * Delays animation start by X milliseconds.\r\n *\r\n * @param delay Delay (ms)\r\n * @return Animation\r\n */\r\n Animation.prototype.delay = function (delay) {\r\n var _this = this;\r\n //@todo Maybe not use `bind()`\r\n if (delay > 0) {\r\n this.pause();\r\n // This is so that it will get disposed if `this.object` is disposed\r\n // TODO hacky, figure out a better way\r\n $array.move(this.object.animations, this);\r\n var id_1 = setTimeout(function () {\r\n _this._delayTimeout = null;\r\n _this.start();\r\n }, delay);\r\n this._delayTimeout = new Disposer(function () {\r\n clearTimeout(id_1);\r\n });\r\n }\r\n return this;\r\n };\r\n Animation.prototype._start = function () {\r\n this._isFinished = false;\r\n // Clear delay timeout if there was one\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n this.stopSameAnimations();\r\n // Reset counters\r\n this._pause = false;\r\n // Register animation\r\n $array.move(system.animations, this);\r\n // Register this animation in object's `animations` list\r\n $array.move(this.object.animations, this);\r\n system.requestFrame();\r\n };\r\n /**\r\n * Starts animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.start = function () {\r\n this._start();\r\n this._startTime = Date.now();\r\n this._time = 0;\r\n this.staticOptions = [];\r\n // Process initial property values\r\n for (var i = this.animationOptions.length - 1; i >= 0; i--) {\r\n var options = this.animationOptions[i];\r\n if (!$type.hasValue(options.from)) {\r\n if (options.childObject) {\r\n options.from = options.childObject[options.property];\r\n }\r\n else {\r\n options.from = this.object[options.property];\r\n if (!$type.hasValue(options.from)) {\r\n options.from = SVGDefaults[options.property];\r\n }\r\n }\r\n /*if (!$type.hasValue(options.from)) {\r\n throw Error(\"Could not get initial transition value.\");\r\n }*/\r\n }\r\n if (options.from == options.to) { // || options.to == (this.object)[options.property]){ this is not good, as dataItem.value is set to final at once, and we animate workingValue\r\n $array.remove(this.animationOptions, options);\r\n }\r\n else if (!$type.hasValue(options.from)) {\r\n // Initial value is undefined, treat it as static\r\n this.staticOptions.push(options);\r\n $array.remove(this.animationOptions, options);\r\n }\r\n else {\r\n // Use different update methods for different value types\r\n if ($type.isNumber(options.to)) {\r\n // Numeric value\r\n options.updateMethod = getProgressNumber;\r\n // Check if initial value is not Percent\r\n if (options.from instanceof Percent) {\r\n // It is. Let's convert it to pixel value\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options.property, \"pixel\")];\r\n if (!isNaN(convertedFrom)) {\r\n options.from = convertedFrom;\r\n }\r\n else {\r\n this.staticOptions.push(options);\r\n $array.remove(this.animationOptions, options);\r\n }\r\n }\r\n else if (isNaN(options.from)) {\r\n // Static value\r\n this.staticOptions.push(options);\r\n $array.remove(this.animationOptions, options);\r\n }\r\n }\r\n else {\r\n // Check if maybe we have a color or percent value\r\n if (options.to instanceof Color) {\r\n // Yup - set resolved named color\r\n //options.from = $colors.stringToColor(options.from);\r\n if (options.from) {\r\n options.updateMethod = getProgressColor;\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options);\r\n $array.remove(this.animationOptions, options);\r\n }\r\n }\r\n else if (options.to instanceof Percent) {\r\n // Percent\r\n options.updateMethod = getProgressPercent;\r\n // Check if the initial value is maybe in pixels\r\n if (!isNaN(options.from)) {\r\n // It is. Let's convert it\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options.property, \"relative\")];\r\n if (!isNaN(convertedFrom)) {\r\n options.from = percent(convertedFrom * 100);\r\n }\r\n }\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options);\r\n $array.remove(this.animationOptions, options);\r\n }\r\n }\r\n }\r\n }\r\n // Apply static options (just in case they were reset by previous\r\n // animation loop)\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationstarted\")) {\r\n var event_1 = {\r\n type: \"animationstarted\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstarted\", event_1);\r\n }\r\n this.update();\r\n // If duration is 0, just end animation\r\n if (this.duration === 0) {\r\n this.end();\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets loop count for the animation. If parameter is not a valid number the\r\n * animation will keep on looping indefinitely.\r\n *\r\n * @param count Number of times to loop animation\r\n * @return Animation\r\n */\r\n Animation.prototype.loop = function (count) {\r\n if (!$type.isNumber(count)) {\r\n count = Infinity;\r\n }\r\n this._loop = count;\r\n return this;\r\n };\r\n /**\r\n * Pauses animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.pause = function () {\r\n this._pause = true;\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n $array.remove(system.animations, this);\r\n $array.remove(this.object.animations, this);\r\n return this;\r\n };\r\n /**\r\n * Resumes paused animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.resume = function () {\r\n this._start();\r\n this._startTime = Date.now() - this._time;\r\n return this;\r\n };\r\n /**\r\n * Jumps to animation end. If animation is set to loop, this will start\r\n * another round of animation from start.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.end = function () {\r\n // Pause and complete the progress\r\n if (this._loop == 0) {\r\n this.pause();\r\n }\r\n this.setProgress(1);\r\n // Apply static options\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationended\")) {\r\n var event_2 = {\r\n type: \"animationended\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationended\", event_2);\r\n }\r\n // Check if we should loop\r\n if (this._loop > 0) {\r\n this._loop--;\r\n this.start();\r\n }\r\n else {\r\n this.stop();\r\n this._isFinished = true;\r\n }\r\n return this;\r\n };\r\n Animation.prototype.kill = function () {\r\n this.pause();\r\n this._isFinished = true;\r\n };\r\n /**\r\n * Returns indicator if this animation is finished or not\r\n *\r\n * @return Is finished?\r\n */\r\n Animation.prototype.isFinished = function () {\r\n return this._isFinished;\r\n };\r\n /**\r\n * Applies static options that can't be animated.\r\n */\r\n Animation.prototype.applyStaticOptions = function () {\r\n var _this = this;\r\n $array.each(this.staticOptions, function (options) {\r\n if (options.childObject) {\r\n options.childObject[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n else {\r\n _this.object[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n });\r\n };\r\n /**\r\n * Stops animation.\r\n *\r\n * When animation is stopped, the properties of the target object will remain\r\n * where they were at the moment when `stop()` was called.\r\n *\r\n * @param skipEvent Do not trigger `animationstopped` event\r\n * @return Animation\r\n */\r\n Animation.prototype.stop = function (skipEvent) {\r\n this.pause();\r\n if (!skipEvent) {\r\n if (this.events.isEnabled(\"animationstopped\")) {\r\n var event_3 = {\r\n type: \"animationstopped\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstopped\", event_3);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets current progress and updates object's numeric and color values.\r\n *\r\n * @param progress Progress (0-1)\r\n */\r\n Animation.prototype.setProgress = function (progress) {\r\n var _this = this;\r\n this._time = this.duration * progress; // just in case we call this from outside\r\n $array.each(this.animationOptions, function (options) {\r\n if (options.updateMethod && $type.hasValue(options.from)) {\r\n var value = options.updateMethod(progress, options.from, options.to);\r\n if (options.childObject) {\r\n options.childObject[options.property] = value;\r\n }\r\n else {\r\n _this.object[options.property] = value;\r\n }\r\n }\r\n });\r\n this.progress = progress;\r\n if (this.events.isEnabled(\"animationprogress\")) {\r\n var event_4 = {\r\n type: \"animationprogress\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationprogress\", event_4);\r\n }\r\n system.requestFrame();\r\n };\r\n /**\r\n * Tracks and sets progress according to time or frames.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation\r\n */\r\n Animation.prototype.update = function () {\r\n if (!this._pause) {\r\n var progress = void 0;\r\n this._time = $math.fitToRange(Date.now() - this._startTime, 0, this.duration);\r\n var timeProgress = this._time / this.duration;\r\n progress = this.easing(timeProgress);\r\n if (this.duration == 0 || !$type.isNumber(progress) || timeProgress >= 1) {\r\n progress = 1;\r\n }\r\n this.setProgress(progress);\r\n if ($math.round(this._time / this.duration, 6) == 1) {\r\n this.end();\r\n }\r\n }\r\n return this;\r\n };\r\n Object.defineProperty(Animation.prototype, \"delayed\", {\r\n /**\r\n * Returns `true` if this animation is delayed.\r\n *\r\n * @readonly\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._delayTimeout ? true : false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks other animations currently running on the same object and removes\r\n * overlapping options from those other animations that are contained in\r\n * this animation.\r\n *\r\n * This is needed to ensure that no two confurent animations step on each\r\n * other's toes by trying to animate the same property.\r\n */\r\n Animation.prototype.stopSameAnimations = function () {\r\n var _this = this;\r\n // stop animation of the same property\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.object.animations), function (animation) {\r\n if (animation !== _this && !animation.delayed) {\r\n var killed_1 = [];\r\n $array.each(_this.animationOptions, function (newOptions) {\r\n $array.each(animation.animationOptions, function (oldOptions) {\r\n if (newOptions.property == oldOptions.property && newOptions.childObject == oldOptions.childObject) {\r\n killed_1.push(oldOptions);\r\n if (animation.animationOptions.length == 0) {\r\n animation.kill();\r\n }\r\n }\r\n });\r\n });\r\n $array.each(killed_1, function (oldOptions) {\r\n $array.remove(animation.animationOptions, oldOptions);\r\n });\r\n }\r\n });\r\n };\r\n return Animation;\r\n}(BaseObjectEvents));\r\nexport { Animation };\r\n//# sourceMappingURL=Animation.js.map","/**\r\n * Event Dispatcher module is used for registering listeners and dispatching\r\n * events across amCharts system.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport * as $array from \"./Array\";\r\nimport * as $async from \"./AsyncPending\";\r\nimport * as $type from \"./Type\";\r\n/*export interface IEventDispatcher {\r\n isDisposed(): boolean;\r\n dispose(): void;\r\n hasListeners(): boolean;\r\n enable(): void;\r\n disable(): void;\r\n enableType(type: Key): void;\r\n disableType(type: Key, amount?: number): void;\r\n isEnabled(type: Key): boolean;\r\n has(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): boolean;\r\n dispatchImmediately(type: Key, event: T[Key]): void;\r\n dispatch(type: Key, event: T[Key]): void;\r\n onAll(callback: (this: C, type: Key, event: T[Key]) => void, context?: C): IDisposer;\r\n on(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n once(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n off(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n off(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n copyFrom(source: this): void;\r\n}*/\r\n/**\r\n * Universal Event Dispatcher.\r\n *\r\n * @important\r\n */\r\nvar EventDispatcher = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function EventDispatcher() {\r\n this._listeners = [];\r\n this._killed = [];\r\n this._disabled = {};\r\n this._iterating = 0;\r\n this._enabled = true;\r\n this._disposed = false;\r\n }\r\n /**\r\n * Returns if this object has been already disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n EventDispatcher.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Dispose (destroy) this object.\r\n */\r\n EventDispatcher.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._listeners;\r\n this._iterating = 1;\r\n this._listeners = null;\r\n this._disabled = null;\r\n try {\r\n $array.each(a, function (x) {\r\n x.disposer.dispose();\r\n });\r\n }\r\n finally {\r\n this._killed = null;\r\n this._iterating = null;\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any listeners set.\r\n *\r\n * @return Has listeners?\r\n */\r\n EventDispatcher.prototype.hasListeners = function () {\r\n return this._listeners.length !== 0;\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any particular listeners set.\r\n *\r\n * @return Has particular event listeners?\r\n */\r\n EventDispatcher.prototype.hasListenersByType = function (type) {\r\n return $array.any(this._listeners, function (x) { return (x.type === null || x.type === type) && !x.killed; });\r\n };\r\n /**\r\n * Enable dispatching of events if they were previously disabled by\r\n * `disable()`.\r\n */\r\n EventDispatcher.prototype.enable = function () {\r\n this._enabled = true;\r\n };\r\n /**\r\n * Disable dispatching of events until re-enabled by `enable()`.\r\n */\r\n EventDispatcher.prototype.disable = function () {\r\n this._enabled = false;\r\n };\r\n /**\r\n * Enable dispatching particular event, if it was disabled before by\r\n * `disableType()`.\r\n *\r\n * @param type Event type\r\n */\r\n EventDispatcher.prototype.enableType = function (type) {\r\n delete this._disabled[type];\r\n };\r\n /**\r\n * Disable dispatching of events for a certain event type.\r\n *\r\n * Optionally, can set how many dispatches to skip before automatically\r\n * re-enabling the dispatching.\r\n *\r\n * @param type Event type\r\n * @param amount Number of event dispatches to skip\r\n */\r\n EventDispatcher.prototype.disableType = function (type, amount) {\r\n if (amount === void 0) { amount = Infinity; }\r\n this._disabled[type] = amount;\r\n };\r\n /**\r\n * Removes listener from dispatcher.\r\n *\r\n * Will throw an exception if such listener does not exists.\r\n *\r\n * @param listener Listener to remove\r\n */\r\n EventDispatcher.prototype._removeListener = function (listener) {\r\n if (this._iterating === 0) {\r\n var index = this._listeners.indexOf(listener);\r\n if (index === -1) {\r\n throw new Error(\"Invalid state: could not remove listener\");\r\n }\r\n this._listeners.splice(index, 1);\r\n }\r\n else {\r\n this._killed.push(listener);\r\n }\r\n };\r\n /**\r\n * Removes existing listener by certain parameters.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype._removeExistingListener = function (once, type, callback, context) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._eachListener(function (info) {\r\n if (info.once === once && // TODO is this correct ?\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context) {\r\n info.disposer.dispose();\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if dispatching for particular event type is enabled.\r\n *\r\n * @param type Event type\r\n * @return Enabled?\r\n */\r\n EventDispatcher.prototype.isEnabled = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n // TODO is this check correct ?\r\n return this._enabled && this._listeners.length > 0 && this.hasListenersByType(type) && this._disabled[type] == null;\r\n };\r\n /**\r\n * Checks if there's already a listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @return Has listener?\r\n */\r\n EventDispatcher.prototype.has = function (type, callback, context) {\r\n var index = $array.findIndex(this._listeners, function (info) {\r\n return info.once !== true && // Ignoring \"once\" listeners\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context;\r\n });\r\n return index !== -1;\r\n };\r\n /**\r\n * Checks whether event of the particular type should be dispatched.\r\n *\r\n * @param type Event type\r\n * @return Dispatch?\r\n */\r\n EventDispatcher.prototype._shouldDispatch = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n var count = this._disabled[type];\r\n if (!$type.isNumber(count)) {\r\n return this._enabled;\r\n }\r\n else {\r\n if (count <= 1) {\r\n delete this._disabled[type];\r\n }\r\n else {\r\n --this._disabled[type];\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * [_eachListener description]\r\n *\r\n * All of this extra code is needed when a listener is removed while iterating\r\n *\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\n EventDispatcher.prototype._eachListener = function (fn) {\r\n var _this = this;\r\n ++this._iterating;\r\n try {\r\n $array.each(this._listeners, fn);\r\n }\r\n finally {\r\n --this._iterating;\r\n // TODO should this be inside or outside the finally ?\r\n if (this._iterating === 0 && this._killed.length !== 0) {\r\n // Remove killed listeners\r\n $array.each(this._killed, function (killed) {\r\n _this._removeListener(killed);\r\n });\r\n this._killed.length = 0;\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches an event immediately without waiting for next cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatchImmediately = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n // TODO if the function throws, maybe it should keep going ?\r\n this._eachListener(function (listener) {\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Shelves the event to be dispatched within next update cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatch = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n this._eachListener(function (listener) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n // TODO if the function throws, maybe it should keep going ?\r\n // TODO dispatch during the update cycle, rather than using whenIdle\r\n $async.whenIdle(function () {\r\n if (!listener.killed) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Creates, catalogs and returns an [[EventListener]].\r\n *\r\n * Event listener can be disposed.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @param dispatch\r\n * @returns An event listener\r\n */\r\n EventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._removeExistingListener(once, type, callback, context);\r\n var info = {\r\n type: type,\r\n callback: callback,\r\n context: context,\r\n shouldClone: shouldClone,\r\n dispatch: dispatch,\r\n killed: false,\r\n once: once,\r\n disposer: new Disposer(function () {\r\n info.killed = true;\r\n _this._removeListener(info);\r\n })\r\n };\r\n this._listeners.push(info);\r\n return info;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on **any** event.\r\n *\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.onAll = function (callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, null, callback, context, shouldClone, function (type, event) { return callback.call(context, type, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler whenever series we put\r\n * event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.on = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, type, callback, context, shouldClone, function (type, event) { return callback.call(context, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type once.\r\n *\r\n * Once the event listener is invoked, it is automatically disposed.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler the first time series we\r\n * put event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.once = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n var x = this._on(true, type, callback, context, shouldClone, function (type, event) {\r\n x.disposer.dispose();\r\n callback.call(context, event);\r\n });\r\n // TODO maybe this should return a different Disposer ?\r\n return x.disposer;\r\n };\r\n /**\r\n * Removes the event listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype.off = function (type, callback, context) {\r\n this._removeExistingListener(false, type, callback, context);\r\n };\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n EventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return EventDispatcher;\r\n}());\r\nexport { EventDispatcher };\r\n/**\r\n * A version of the [[EventDispatcher]] that dispatches events for a specific\r\n * target object.\r\n *\r\n * @important\r\n */\r\nvar TargetedEventDispatcher = /** @class */ (function (_super) {\r\n tslib_1.__extends(TargetedEventDispatcher, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param target Event dispatcher target\r\n */\r\n function TargetedEventDispatcher(target) {\r\n var _this = _super.call(this) || this;\r\n _this.target = target;\r\n return _this;\r\n }\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n TargetedEventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO very hacky\r\n if (x.context === source.target) {\r\n return;\r\n }\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return TargetedEventDispatcher;\r\n}(EventDispatcher));\r\nexport { TargetedEventDispatcher };\r\n//# sourceMappingURL=EventDispatcher.js.map","/**\r\n * A collection of color-related functions\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Define named colors for easy resolution to RGB.\r\n */\r\nvar namedColors = {\r\n aliceblue: { r: 240, g: 248, b: 255 },\r\n antiquewhite: { r: 250, g: 235, b: 215 },\r\n aqua: { r: 0, g: 255, b: 255 },\r\n aquamarine: { r: 127, g: 255, b: 212 },\r\n azure: { r: 240, g: 255, b: 255 },\r\n beige: { r: 245, g: 245, b: 220 },\r\n bisque: { r: 255, g: 228, b: 196 },\r\n black: { r: 0, g: 0, b: 0 },\r\n blanchedalmond: { r: 255, g: 235, b: 205 },\r\n blue: { r: 0, g: 0, b: 255 },\r\n blueviolet: { r: 138, g: 43, b: 226 },\r\n brown: { r: 165, g: 42, b: 42 },\r\n burlywood: { r: 222, g: 184, b: 135 },\r\n cadetblue: { r: 95, g: 158, b: 160 },\r\n chartreuse: { r: 127, g: 255, b: 0 },\r\n chocolate: { r: 210, g: 105, b: 30 },\r\n coral: { r: 255, g: 127, b: 80 },\r\n cornflowerblue: { r: 100, g: 149, b: 237 },\r\n cornsilk: { r: 255, g: 248, b: 220 },\r\n crimson: { r: 220, g: 20, b: 60 },\r\n cyan: { r: 0, g: 255, b: 255 },\r\n darkblue: { r: 0, g: 0, b: 139 },\r\n darkcyan: { r: 0, g: 139, b: 139 },\r\n darkgoldenrod: { r: 184, g: 134, b: 11 },\r\n darkgray: { r: 169, g: 169, b: 169 },\r\n darkgrey: { r: 169, g: 169, b: 169 },\r\n darkgreen: { r: 0, g: 100, b: 0 },\r\n darkkhaki: { r: 189, g: 183, b: 107 },\r\n darkmagenta: { r: 139, g: 0, b: 139 },\r\n darkolivegreen: { r: 85, g: 107, b: 47 },\r\n darkorange: { r: 255, g: 140, b: 0 },\r\n darkorchid: { r: 153, g: 50, b: 204 },\r\n darkred: { r: 139, g: 0, b: 0 },\r\n darksalmon: { r: 233, g: 150, b: 122 },\r\n darkseagreen: { r: 143, g: 188, b: 143 },\r\n darkslateblue: { r: 72, g: 61, b: 139 },\r\n darkslategray: { r: 47, g: 79, b: 79 },\r\n darkslategrey: { r: 47, g: 79, b: 79 },\r\n darkturquoise: { r: 0, g: 206, b: 209 },\r\n darkviolet: { r: 148, g: 0, b: 211 },\r\n deeppink: { r: 255, g: 20, b: 147 },\r\n deepskyblue: { r: 0, g: 191, b: 255 },\r\n dimgray: { r: 105, g: 105, b: 105 },\r\n dimgrey: { r: 105, g: 105, b: 105 },\r\n dodgerblue: { r: 30, g: 144, b: 255 },\r\n firebrick: { r: 178, g: 34, b: 34 },\r\n floralwhite: { r: 255, g: 250, b: 240 },\r\n forestgreen: { r: 34, g: 139, b: 34 },\r\n fuchsia: { r: 255, g: 0, b: 255 },\r\n gainsboro: { r: 220, g: 220, b: 220 },\r\n ghostwhite: { r: 248, g: 248, b: 255 },\r\n gold: { r: 255, g: 215, b: 0 },\r\n goldenrod: { r: 218, g: 165, b: 32 },\r\n gray: { r: 128, g: 128, b: 128 },\r\n grey: { r: 128, g: 128, b: 128 },\r\n green: { r: 0, g: 128, b: 0 },\r\n greenyellow: { r: 173, g: 255, b: 47 },\r\n honeydew: { r: 240, g: 255, b: 240 },\r\n hotpink: { r: 255, g: 105, b: 180 },\r\n indianred: { r: 205, g: 92, b: 92 },\r\n indigo: { r: 75, g: 0, b: 130 },\r\n ivory: { r: 255, g: 255, b: 240 },\r\n khaki: { r: 240, g: 230, b: 140 },\r\n lavender: { r: 230, g: 230, b: 250 },\r\n lavenderblush: { r: 255, g: 240, b: 245 },\r\n lawngreen: { r: 124, g: 252, b: 0 },\r\n lemonchiffon: { r: 255, g: 250, b: 205 },\r\n lightblue: { r: 173, g: 216, b: 230 },\r\n lightcoral: { r: 240, g: 128, b: 128 },\r\n lightcyan: { r: 224, g: 255, b: 255 },\r\n lightgoldenrodyellow: { r: 250, g: 250, b: 210 },\r\n lightgray: { r: 211, g: 211, b: 211 },\r\n lightgrey: { r: 211, g: 211, b: 211 },\r\n lightgreen: { r: 144, g: 238, b: 144 },\r\n lightpink: { r: 255, g: 182, b: 193 },\r\n lightsalmon: { r: 255, g: 160, b: 122 },\r\n lightseagreen: { r: 32, g: 178, b: 170 },\r\n lightskyblue: { r: 135, g: 206, b: 250 },\r\n lightslategray: { r: 119, g: 136, b: 153 },\r\n lightslategrey: { r: 119, g: 136, b: 153 },\r\n lightsteelblue: { r: 176, g: 196, b: 222 },\r\n lightyellow: { r: 255, g: 255, b: 224 },\r\n lime: { r: 0, g: 255, b: 0 },\r\n limegreen: { r: 50, g: 205, b: 50 },\r\n linen: { r: 250, g: 240, b: 230 },\r\n magenta: { r: 255, g: 0, b: 255 },\r\n maroon: { r: 128, g: 0, b: 0 },\r\n mediumaquamarine: { r: 102, g: 205, b: 170 },\r\n mediumblue: { r: 0, g: 0, b: 205 },\r\n mediumorchid: { r: 186, g: 85, b: 211 },\r\n mediumpurple: { r: 147, g: 112, b: 219 },\r\n mediumseagreen: { r: 60, g: 179, b: 113 },\r\n mediumslateblue: { r: 123, g: 104, b: 238 },\r\n mediumspringgreen: { r: 0, g: 250, b: 154 },\r\n mediumturquoise: { r: 72, g: 209, b: 204 },\r\n mediumvioletred: { r: 199, g: 21, b: 133 },\r\n midnightblue: { r: 25, g: 25, b: 112 },\r\n mintcream: { r: 245, g: 255, b: 250 },\r\n mistyrose: { r: 255, g: 228, b: 225 },\r\n moccasin: { r: 255, g: 228, b: 181 },\r\n navajowhite: { r: 255, g: 222, b: 173 },\r\n navy: { r: 0, g: 0, b: 128 },\r\n oldlace: { r: 253, g: 245, b: 230 },\r\n olive: { r: 128, g: 128, b: 0 },\r\n olivedrab: { r: 107, g: 142, b: 35 },\r\n orange: { r: 255, g: 165, b: 0 },\r\n orangered: { r: 255, g: 69, b: 0 },\r\n orchid: { r: 218, g: 112, b: 214 },\r\n palegoldenrod: { r: 238, g: 232, b: 170 },\r\n palegreen: { r: 152, g: 251, b: 152 },\r\n paleturquoise: { r: 175, g: 238, b: 238 },\r\n palevioletred: { r: 219, g: 112, b: 147 },\r\n papayawhip: { r: 255, g: 239, b: 213 },\r\n peachpuff: { r: 255, g: 218, b: 185 },\r\n peru: { r: 205, g: 133, b: 63 },\r\n pink: { r: 255, g: 192, b: 203 },\r\n plum: { r: 221, g: 160, b: 221 },\r\n powderblue: { r: 176, g: 224, b: 230 },\r\n purple: { r: 128, g: 0, b: 128 },\r\n rebeccapurple: { r: 102, g: 51, b: 153 },\r\n red: { r: 255, g: 0, b: 0 },\r\n rosybrown: { r: 188, g: 143, b: 143 },\r\n royalblue: { r: 65, g: 105, b: 225 },\r\n saddlebrown: { r: 139, g: 69, b: 19 },\r\n salmon: { r: 250, g: 128, b: 114 },\r\n sandybrown: { r: 244, g: 164, b: 96 },\r\n seagreen: { r: 46, g: 139, b: 87 },\r\n seashell: { r: 255, g: 245, b: 238 },\r\n sienna: { r: 160, g: 82, b: 45 },\r\n silver: { r: 192, g: 192, b: 192 },\r\n skyblue: { r: 135, g: 206, b: 235 },\r\n slateblue: { r: 106, g: 90, b: 205 },\r\n slategray: { r: 112, g: 128, b: 144 },\r\n slategrey: { r: 112, g: 128, b: 144 },\r\n snow: { r: 255, g: 250, b: 250 },\r\n springgreen: { r: 0, g: 255, b: 127 },\r\n steelblue: { r: 70, g: 130, b: 180 },\r\n tan: { r: 210, g: 180, b: 140 },\r\n teal: { r: 0, g: 128, b: 128 },\r\n thistle: { r: 216, g: 191, b: 216 },\r\n tomato: { r: 255, g: 99, b: 71 },\r\n turquoise: { r: 64, g: 224, b: 208 },\r\n violet: { r: 238, g: 130, b: 238 },\r\n wheat: { r: 245, g: 222, b: 179 },\r\n white: { r: 255, g: 255, b: 255 },\r\n whitesmoke: { r: 245, g: 245, b: 245 },\r\n yellow: { r: 255, g: 255, b: 0 },\r\n yellowgreen: { r: 154, g: 205, b: 50 }\r\n};\r\n/**\r\n * Tries to resolve a named color into a hex color representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Color name\r\n * @return Color\r\n * @deprecated\r\n * @hidden\r\n */\r\n/*export function resolveNamedColor(value: string): Color {\r\n return (namedColors)[value] ? (namedColors)[value] : undefined;\r\n}*/\r\n/**\r\n * Converts a proper color hex code (i.e. \"#FF5500\") or named color (i.e. \"red\")\r\n * into an {iRGB} object. If the code is not correctly formatted, an RGB of\r\n * black is returned.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @param alpha Alpha (0-1)\r\n * @return RGB\r\n */\r\nexport function rgb(color, alpha) {\r\n // Init return value\r\n var rgb;\r\n // Try resolving color format\r\n // Named color?\r\n if (namedColors[color]) {\r\n rgb = namedColors[color];\r\n }\r\n // Hex code?\r\n else if (color.charAt(0) === \"#\") {\r\n rgb = hexToRgb(color);\r\n }\r\n // rgb() format?\r\n else if (color.match(/^rgba?\\(/)) {\r\n rgb = rgbaToRgb(color);\r\n }\r\n // Was not able to resolve?\r\n if (!rgb) {\r\n rgb = { r: 0, g: 0, b: 0, a: 1 };\r\n }\r\n // Set alpha\r\n if ($type.hasValue(alpha)) {\r\n rgb.a = alpha;\r\n }\r\n return rgb;\r\n}\r\n/**\r\n * Converts a hex color code (i.e. \"#FF5500\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgb(hex) {\r\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\r\n return r + r + g + g + b + b;\r\n });\r\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n } : undefined;\r\n}\r\n/**\r\n * Converts color strings in format like `rgb()` and `rgba()` to [[iRGB]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @return RGB\r\n */\r\nexport function rgbaToRgb(color) {\r\n color = color.replace(/[ ]/g, \"\");\r\n // Init\r\n var matches = color.match(/^rgb\\(([0-9]*),([0-9]*),([0-9]*)\\)/i);\r\n // Try rgb() format\r\n if (matches) {\r\n matches.push(\"1\");\r\n }\r\n else {\r\n matches = color.match(/^rgba\\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\\)/i);\r\n if (!matches) {\r\n return;\r\n }\r\n }\r\n return {\r\n r: parseInt(matches[1]),\r\n g: parseInt(matches[2]),\r\n b: parseInt(matches[3]),\r\n a: parseFloat(matches[4])\r\n };\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into a hex color code.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return Hex color code\r\n */\r\nexport function rgbToHex(rgb) {\r\n return \"#\" + pad2(rgb.r.toString(16)) + pad2(rgb.g.toString(16)) + pad2(rgb.b.toString(16));\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into its `rgb()` or `rgba()` representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return `rgba()` syntax\r\n */\r\nexport function rgbToRGBA(rgb) {\r\n if ($type.hasValue(rgb.a) && rgb.a !== 1) {\r\n return \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + rgb.a + \")\";\r\n }\r\n else {\r\n return \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\r\n }\r\n}\r\n/**\r\n * Pads a 1-digit string with a zero.\r\n *\r\n * @ignore Exclude from docs\r\n * @param c Input string\r\n * @return Padded string\r\n */\r\nexport function pad2(c) {\r\n return c.length == 1 ? \"0\" + c : \"\" + c;\r\n}\r\n/**\r\n * Returns an intermediate color between two colors based on the relative\r\n * position. Position needs to be in range between 0 and 1. Zero meaning the\r\n * resulting color will be closest to the first reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color1 First reference color\r\n * @param color2 Second reference color\r\n * @param percent Relative position (0-1)\r\n * @return Interpolated color\r\n */\r\nexport function interpolate(rgb1, rgb2, percent) {\r\n percent = $math.fitToRange(percent, 0, 1);\r\n if (rgb1) {\r\n if (rgb2) {\r\n return {\r\n r: rgb1.r + Math.round((rgb2.r - rgb1.r) * percent),\r\n g: rgb1.g + Math.round((rgb2.g - rgb1.g) * percent),\r\n b: rgb1.b + Math.round((rgb2.b - rgb1.b) * percent),\r\n a: (rgb1.a || 1) + Math.round(((rgb2.a || 1) - (rgb1.a || 1)) * percent)\r\n };\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n }\r\n else if (rgb2) {\r\n return rgb2;\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Reference color\r\n * @param percent Brightness percent\r\n * @return Hex code of the new color\r\n */\r\nexport function lighten(rgb, percent) {\r\n if (rgb) {\r\n return {\r\n r: Math.max(0, Math.min(255, rgb.r + getLightnessStep(rgb.r, percent))),\r\n g: Math.max(0, Math.min(255, rgb.g + getLightnessStep(rgb.g, percent))),\r\n b: Math.max(0, Math.min(255, rgb.b + getLightnessStep(rgb.b, percent))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Gets lightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getLightnessStep(value, percent) {\r\n var base = percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the source `color`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @param percent Brightness percent\r\n * @return New color\r\n */\r\nexport function brighten(rgb, percent) {\r\n if (rgb) {\r\n var base = Math.min(Math.max(rgb.r, rgb.g, rgb.b), 230);\r\n //let base = Math.max(rgb.r, rgb.g, rgb.b);\r\n var step = getLightnessStep(base, percent);\r\n return {\r\n r: Math.max(0, Math.min(255, Math.round(rgb.r + step))),\r\n g: Math.max(0, Math.min(255, Math.round(rgb.g + step))),\r\n b: Math.max(0, Math.min(255, Math.round(rgb.b + step))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Returns brightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getBrightnessStep(value, percent) {\r\n var base = 255; //percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a new [[iRGB]] object based on `rgb` parameter with specific\r\n * saturation applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Base color\r\n * @param saturation Saturation (0-1)\r\n * @return New color\r\n */\r\nexport function saturate(rgb, saturation) {\r\n if (rgb == null || saturation == 1) {\r\n return rgb;\r\n }\r\n var hsl = rgbToHsl(rgb);\r\n hsl.s = saturation;\r\n return hslToRgb(hsl);\r\n}\r\n/*\r\n// not used\r\nexport function rgbToMatrix(rgb: iRGB): string {\r\n let r = $type.toText($math.round((rgb.r || 0) / 255, 10));\r\n let g = $type.toText($math.round((rgb.g || 0) / 255, 10));\r\n let b = $type.toText($math.round((rgb.b || 0) / 255, 10));\r\n let a = $type.toText(rgb.a || 1);\r\n return\t r + \" 0 0 0 0\" +\r\n \" 0 \" + g + \" 0 0 0\" +\r\n \" 0 0 \" + b + \" 0 0\" +\r\n \" 0 0 0 \" + a + \" 0\";\r\n}\r\n*/\r\n/**\r\n * The functions below are taken and adapted from Garry Tan's blog post:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * The further attributions go mjijackson.com, which now seems to be defunct.\r\n */\r\n/**\r\n * Converts an HSL color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes h, s, and l are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param h The hue\r\n * @param s The saturation\r\n * @param l The lightness\r\n * @return The RGB representation\r\n */\r\nexport function hslToRgb(color) {\r\n var r, g, b;\r\n var h = color.h;\r\n var s = color.s;\r\n var l = color.l;\r\n if (s == 0) {\r\n r = g = b = l; // achromatic\r\n }\r\n else {\r\n var hue2rgb = function hue2rgb(p, q, t) {\r\n if (t < 0) {\r\n t += 1;\r\n }\r\n if (t > 1) {\r\n t -= 1;\r\n }\r\n if (t < 1 / 6) {\r\n return p + (q - p) * 6 * t;\r\n }\r\n if (t < 1 / 2) {\r\n return q;\r\n }\r\n if (t < 2 / 3) {\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n }\r\n return p;\r\n };\r\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hue2rgb(p, q, h + 1 / 3);\r\n g = hue2rgb(p, q, h);\r\n b = hue2rgb(p, q, h - 1 / 3);\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSL. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and l in the set [0, 1].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param r The red color value\r\n * @param g The green color value\r\n * @param b The blue color value\r\n * @return The HSL representation\r\n */\r\nexport function rgbToHsl(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var l = (max + min) / 2;\r\n if (max === min) {\r\n h = s = 0; // achromatic\r\n }\r\n else {\r\n var d = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n l: l\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSV. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and v in the set [0, 1].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number r The red color value\r\n * @param Number g The green color value\r\n * @param Number b The blue color value\r\n * @return Array The HSV representation\r\n */\r\nexport function rgbToHsv(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var v = max;\r\n var d = max - min;\r\n s = max == 0 ? 0 : d / max;\r\n if (max == min) {\r\n h = 0; // achromatic\r\n }\r\n else {\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n v: v\r\n };\r\n}\r\n/**\r\n * Converts an HSV color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes h, s, and v are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number h The hue\r\n * @param Number s The saturation\r\n * @param Number v The value\r\n * @return Array The RGB representation\r\n */\r\nexport function hsvToRgb(color) {\r\n var r = 0;\r\n var g = 0;\r\n var b = 0;\r\n var h = color.h;\r\n var s = color.s;\r\n var v = color.v;\r\n var i = Math.floor(h * 6);\r\n var f = h * 6 - i;\r\n var p = v * (1 - s);\r\n var q = v * (1 - f * s);\r\n var t = v * (1 - (1 - f) * s);\r\n switch (i % 6) {\r\n case 0:\r\n r = v;\r\n g = t;\r\n b = p;\r\n break;\r\n case 1:\r\n r = q;\r\n g = v;\r\n b = p;\r\n break;\r\n case 2:\r\n r = p;\r\n g = v;\r\n b = t;\r\n break;\r\n case 3:\r\n r = p;\r\n g = q;\r\n b = v;\r\n break;\r\n case 4:\r\n r = t;\r\n g = p;\r\n b = v;\r\n break;\r\n case 5:\r\n r = v;\r\n g = p;\r\n b = q;\r\n break;\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Returns `true` if color is \"light\". Useful indetermining which contrasting\r\n * color to use for elements over this color. E.g.: you would want to use\r\n * black text over light background, and vice versa.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @return Light?\r\n */\r\nexport function isLight(color) {\r\n return ((color.r * 299) + (color.g * 587) + (color.b * 114)) / 1000 >= 128;\r\n}\r\n//# sourceMappingURL=Colors.js.map","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { system } from \"../System\";\r\nimport { registry } from \"../Registry\";\r\nimport { Container } from \"../Container\";\r\nimport { Component } from \"../Component\";\r\nimport { Paper } from \"../rendering/Paper\";\r\nimport { SVGContainer, svgContainers } from \"../rendering/SVGContainer\";\r\nimport { FocusFilter } from \"../rendering/filters/FocusFilter\";\r\nimport { Preloader } from \"../elements/Preloader\";\r\nimport { AmChartsLogo } from \"../elements/AmChartsLogo\";\r\nimport { Tooltip } from \"../elements/Tooltip\";\r\nimport { Disposer, MultiDisposer } from \"../utils/Disposer\";\r\nimport { percent } from \"./Percent\";\r\nimport { options } from \"../Options\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport * as $dom from \"./DOM\";\r\nimport * as $utils from \"./Utils\";\r\n/**\r\n * ============================================================================\r\n * INSTANTIATION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates all HTML and SVG containers needed for the chart instance, as well\r\n * as the new [[Sprite]] (as specified in `classType` parameter).\r\n *\r\n * @param htmlElement A container to creat elements in\r\n * @param classType A class definition of the new element to create\r\n * @return Newly-created Sprite object\r\n */\r\nfunction createChild(htmlElement, classType) {\r\n var htmlContainer = $dom.getElement(htmlElement);\r\n if (htmlContainer) {\r\n htmlContainer.innerHTML = \"\";\r\n //htmlContainer.style.overflow = \"hidden\";\r\n var svgDiv_1 = new SVGContainer(htmlContainer);\r\n var paper = new Paper(svgDiv_1.SVGContainer, \"svg-\" + (svgContainers.length - 1));\r\n // the approach with masks is chosen because overflow:visible is set on SVG element in order tooltips could go outside\r\n // svg area - this is often needed when working with small charts.\r\n // main container which holds content container and tooltips container\r\n var container_1 = new Container();\r\n container_1.htmlContainer = htmlContainer;\r\n container_1.svgContainer = svgDiv_1;\r\n container_1.width = percent(100);\r\n container_1.height = percent(100);\r\n container_1.background.fillOpacity = 0;\r\n container_1.paper = paper;\r\n paper.append(container_1.group);\r\n // this is set from parent container, but this one doesn't have, so do it manually.\r\n container_1.relativeWidth = 1;\r\n container_1.relativeHeight = 1;\r\n svgDiv_1.container = container_1;\r\n // creating classType instance\r\n var sprite_1 = container_1.createChild(classType);\r\n sprite_1.topParent = container_1;\r\n var uid = sprite_1.uid;\r\n registry.invalidSprites[uid] = [];\r\n registry.invalidDatas[uid] = [];\r\n registry.invalidPositions[uid] = [];\r\n registry.invalidLayouts[uid] = [];\r\n container_1.baseId = uid;\r\n sprite_1.isBaseSprite = true;\r\n sprite_1.focusFilter = new FocusFilter();\r\n registry.baseSprites.push(sprite_1);\r\n registry.baseSpritesByUid[uid] = sprite_1;\r\n sprite_1.maskRectangle = { x: 0, y: 0, width: svgDiv_1.width, height: svgDiv_1.height };\r\n // this solves issues with display:none, as all children are measured as 0x0\r\n container_1.events.on(\"maxsizechanged\", function (event) {\r\n if (event.previousWidth == 0 || event.previousHeight == 0) {\r\n container_1.deepInvalidate();\r\n }\r\n if (sprite_1.maskRectangle) {\r\n sprite_1.maskRectangle = { x: 0, y: 0, width: svgDiv_1.width, height: svgDiv_1.height };\r\n }\r\n });\r\n sprite_1.addDisposer(new Disposer(function () {\r\n $array.remove(registry.baseSprites, sprite_1);\r\n registry.baseSpritesByUid[sprite_1.uid] = undefined;\r\n }));\r\n // TODO figure out a better way of doing this\r\n sprite_1.addDisposer(container_1);\r\n // tooltip container\r\n var tooltipContainer_1 = container_1.createChild(Container);\r\n tooltipContainer_1.topParent = container_1;\r\n tooltipContainer_1.width = percent(100);\r\n tooltipContainer_1.height = percent(100);\r\n tooltipContainer_1.isMeasured = false;\r\n container_1.tooltipContainer = tooltipContainer_1;\r\n sprite_1.tooltip = new Tooltip();\r\n sprite_1.tooltip.hide(0);\r\n sprite_1.tooltip.setBounds({ x: 0, y: 0, width: tooltipContainer_1.maxWidth, height: tooltipContainer_1.maxHeight });\r\n tooltipContainer_1.events.on(\"maxsizechanged\", function () {\r\n $type.getValue(sprite_1.tooltip).setBounds({ x: 0, y: 0, width: tooltipContainer_1.maxWidth, height: tooltipContainer_1.maxHeight });\r\n }, undefined, false);\r\n //@todo: maybe we don't need to create one by default but only on request?\r\n var preloader_1 = new Preloader();\r\n preloader_1.events.on(\"inited\", function () {\r\n preloader_1.__disabled = true;\r\n }, undefined, false);\r\n container_1.preloader = preloader_1;\r\n if (!options.commercialLicense) {\r\n var logo_1 = tooltipContainer_1.createChild(AmChartsLogo);\r\n tooltipContainer_1.events.on(\"maxsizechanged\", function (ev) {\r\n if ((tooltipContainer_1.maxWidth <= 100) || (tooltipContainer_1.maxHeight <= 50)) {\r\n logo_1.hide();\r\n }\r\n else if (logo_1.isHidden || logo_1.isHiding) {\r\n logo_1.show();\r\n }\r\n }, undefined, false);\r\n sprite_1.logo = logo_1;\r\n logo_1.align = \"left\";\r\n logo_1.valign = \"bottom\";\r\n }\r\n $utils.used(sprite_1.numberFormatter); // need to create one.\r\n // Set this as an autonomouse instance\r\n // Controls like Preloader, Export will use this.\r\n container_1.isStandaloneInstance = true;\r\n if (options.onlyShowOnViewport) {\r\n if (!$dom.isElementInViewport(htmlContainer)) {\r\n sprite_1.__disabled = true;\r\n sprite_1.tooltipContainer.__disabled = true;\r\n var disposer = new MultiDisposer([\r\n $dom.addEventListener(window, \"DOMContentLoaded\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"load\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"resize\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"scroll\", function () { viewPortHandler(sprite_1); })\r\n ]);\r\n sprite_1.addDisposer(disposer);\r\n sprite_1.vpDisposer = disposer;\r\n }\r\n else if (options.queue) {\r\n addToQueue(sprite_1);\r\n }\r\n }\r\n else if (options.queue) {\r\n addToQueue(sprite_1);\r\n }\r\n return sprite_1;\r\n }\r\n else {\r\n system.log(\"html container not found\");\r\n throw new Error(\"html container not found\");\r\n }\r\n}\r\nexport function addToQueue(sprite) {\r\n if (registry.queue.indexOf(sprite) == -1) {\r\n sprite.__disabled = true;\r\n sprite.tooltipContainer.__disabled = true;\r\n sprite.events.disableType(\"appeared\");\r\n if (registry.queue.length == 0) {\r\n queueHandler(sprite);\r\n }\r\n sprite.addDisposer(new Disposer(function () {\r\n removeFromQueue(sprite);\r\n }));\r\n registry.queue.push(sprite);\r\n }\r\n}\r\nexport function removeFromQueue(sprite) {\r\n var index = registry.queue.indexOf(sprite);\r\n if (index >= 0) {\r\n registry.queue.splice(registry.queue.indexOf(sprite), 1);\r\n var nextSprite = registry.queue[index];\r\n if (nextSprite) {\r\n queueHandler(nextSprite);\r\n }\r\n }\r\n}\r\nexport function viewPortHandler(sprite) {\r\n if (sprite.__disabled && $dom.isElementInViewport(sprite.htmlContainer)) {\r\n if (sprite.vpDisposer) {\r\n sprite.vpDisposer.dispose();\r\n }\r\n addToQueue(sprite);\r\n }\r\n}\r\nexport function queueHandler(sprite) {\r\n sprite.__disabled = false;\r\n sprite.tooltipContainer.__disabled = false;\r\n sprite.events.enableType(\"appeared\");\r\n if (sprite.showOnInit) {\r\n sprite.events.on(\"appeared\", function () {\r\n removeFromQueue(sprite);\r\n });\r\n }\r\n if (sprite.vpDisposer) {\r\n sprite.vpDisposer.dispose();\r\n }\r\n if (sprite instanceof Component) {\r\n sprite.invalidateData();\r\n sprite.reinit();\r\n sprite.events.once(\"datavalidated\", function () {\r\n if (sprite.showOnInit) {\r\n sprite.appear();\r\n }\r\n else {\r\n removeFromQueue(sprite);\r\n }\r\n });\r\n }\r\n else {\r\n if (sprite.showOnInit) {\r\n sprite.appear();\r\n }\r\n else {\r\n removeFromQueue(sprite);\r\n }\r\n }\r\n}\r\n/**\r\n * A shortcut to creating a chart instance.\r\n *\r\n * The first argument is either a reference to or an id of a DOM element to be\r\n * used as a container for the chart.\r\n *\r\n * The second argument is the type reference of the chart type. (for plain\r\n * JavaScript users this can also be a string indicating chart type)\r\n *\r\n * ```TypeScript\r\n * let chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n * ```\r\n * ```JavaScript\r\n * // Can pass in chart type reference like this:\r\n * var chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n *\r\n * // ... or chart class type as a string:\r\n * var chart = am4core.create(\"chartdiv\", \"PieChart\");\r\n * ```\r\n *\r\n * @param htmlElement Reference or id of the target container element\r\n * @param classType Class type of the target chart type\r\n * @return Chart instance\r\n */\r\nexport function create(htmlElement, classType) {\r\n // This is a nasty hack for the benefit of vanilla JS users, who do not\r\n // enjoy benefits of type-check anyway.\r\n // We're allowing passing in a name of the class rather than type reference\r\n // itself.\r\n var classError;\r\n if ($type.isString(classType)) {\r\n if ($type.hasValue(registry.registeredClasses[classType])) {\r\n classType = registry.registeredClasses[classType];\r\n }\r\n else {\r\n classType = registry.registeredClasses[\"Container\"];\r\n classError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n }\r\n }\r\n // Create the chart\r\n var chart = createChild(htmlElement, classType);\r\n // Error?\r\n if (classError) {\r\n chart.raiseCriticalError(classError);\r\n }\r\n return chart;\r\n}\r\n/**\r\n * A shortcut to creating a chart from a config object.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * let chart am4core.createFromConfig({ ... }, \"chartdiv\", am4charts.XYChart );\r\n * ```\r\n * ```JavaScript\r\n * var chart am4core.createFromConfig({ ... }, \"chartdiv\", \"XYChart\" );\r\n * ```\r\n *\r\n * If `chartType` parameter is not supplied it must be set in a config object,\r\n * via reference to chart type, e.g.:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * Or via string: (if you are using JavaScript)\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * A `container` can either be a reference to an HTML container to put chart\r\n * in, or it's unique id.\r\n *\r\n * If `container` is not specified, it must be included in the config object:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param config Config object in property/value pairs\r\n * @param htmlElement Container reference or ID\r\n * @param objectType Chart type\r\n * @return A newly created chart instance\r\n * @todo Throw exception if type is not correct\r\n */\r\nexport function createFromConfig(config, htmlElement, classType) {\r\n // Extract chart type from config if necessary\r\n if (!$type.hasValue(classType)) {\r\n classType = config.type;\r\n delete config.type;\r\n }\r\n // Extract element from config if necessary\r\n if (!$type.hasValue(htmlElement)) {\r\n htmlElement = config.container;\r\n delete config.container;\r\n }\r\n // Check if we need to extract actual type reference\r\n var finalType;\r\n var classError;\r\n if ($type.isString(classType) && $type.hasValue(registry.registeredClasses[classType])) {\r\n finalType = registry.registeredClasses[classType];\r\n }\r\n else if (typeof classType !== \"function\") {\r\n finalType = Container;\r\n classError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n }\r\n else {\r\n finalType = classType;\r\n }\r\n // Create the chart\r\n var chart = createChild(htmlElement, finalType);\r\n // Set config\r\n if (classError) {\r\n chart.raiseCriticalError(classError);\r\n }\r\n else {\r\n chart.config = config;\r\n }\r\n return chart;\r\n}\r\n/**\r\n * Applies a theme to System, and subsequently all chart instances created\r\n * from that point forward.\r\n *\r\n * amCharts supports multiple themes. Calling `useTheme` multiple times will\r\n * make the System apply multiple themes, rather than overwrite previously\r\n * set one.\r\n *\r\n * This enables combining features from multiple themes on the same chart.\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n * ```JavaScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n *\r\n * The above will apply both the Material color and animation options to all\r\n * charts created.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function useTheme(value) {\r\n if (registry.themes.indexOf(value) === -1) {\r\n registry.themes.push(value);\r\n }\r\n}\r\n/**\r\n * Removes a theme from \"active themes\" list, so it won't get applied to any\r\n * charts created subsequently.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function unuseTheme(value) {\r\n $array.remove(registry.themes, value);\r\n}\r\n/**\r\n * Removes all \"active\" themes. Any charts created subsequently will not have\r\n * any theme applied to them.\r\n */\r\nexport function unuseAllThemes() {\r\n registry.themes = [];\r\n}\r\n//# sourceMappingURL=Instance.js.map","/**\r\n * A collection of easing functions\r\n *\r\n * Parts of this collection are taken from D3.js library (https://d3js.org/)\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * The functions below are from D3.js library (https://d3js.org/)\r\n *\r\n * ----------------------------------------------------------------------------\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ----------------------------------------------------------------------------\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * LINEAR FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"linear\".\r\n */\r\nexport function linear(t) {\r\n return +t;\r\n}\r\n/**\r\n * Easing function: \"quadIn\".\r\n */\r\nexport function quadIn(t) {\r\n return t * t;\r\n}\r\n/**\r\n * Easing function: \"quadOut\".\r\n */\r\nexport function quadOut(t) {\r\n return t * (2 - t);\r\n}\r\n/**\r\n * Easing function: \"quadInOut\".\r\n */\r\nexport function quadInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t : --t * (2 - t) + 1) / 2;\r\n}\r\n/**\r\n * Easing function: \"polyIn\".\r\n */\r\nexport function polyIn(t, e) {\r\n return Math.pow(t, e);\r\n}\r\n/**\r\n * Easing function: \"polyOut\".\r\n */\r\nexport function polyOut(t, e) {\r\n return 1 - Math.pow(1 - t, e);\r\n}\r\n/**\r\n * Easing function: \"polyInOut\".\r\n */\r\nexport function polyInOut(t, e) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\r\n}\r\n/**\r\n * Easing function: \"polyIn3\".\r\n */\r\nexport function polyIn3(t) {\r\n return polyIn(t, 3);\r\n}\r\n/**\r\n * Easing function: \"polyOut3\".\r\n */\r\nexport function polyOut3(t) {\r\n return polyOut(t, 3);\r\n}\r\n/**\r\n * Easing function: \"polyInOut3\".\r\n */\r\nexport function polyInOut3(t) {\r\n return polyInOut(t, 3);\r\n}\r\n/**\r\n * ============================================================================\r\n * EXPONENTIAL FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"expIn\".\r\n */\r\nexport function expIn(t) {\r\n return Math.pow(2, 10 * t - 10);\r\n}\r\n/**\r\n * Easing function: \"expOut\".\r\n */\r\nexport function expOut(t) {\r\n return 1 - Math.pow(2, -10 * t);\r\n}\r\n/**\r\n * Easing function: \"expInOut\".\r\n */\r\nexport function expInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;\r\n}\r\n/**\r\n * ============================================================================\r\n * SINE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"sinIn\".\r\n */\r\nexport function sinIn(t) {\r\n return 1 - Math.cos(t * $math.HALFPI);\r\n}\r\n/**\r\n * Easing function: \"sinOut\".\r\n */\r\nexport function sinOut(t) {\r\n return Math.sin(t * $math.HALFPI);\r\n}\r\n/**\r\n * Easing function: \"sinInOut\".\r\n */\r\nexport function sinInOut(t) {\r\n return (1 - Math.cos($math.PI * t)) / 2;\r\n}\r\n/**\r\n * ============================================================================\r\n * CUBIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"cubicIn\".\r\n */\r\nexport function cubicIn(t) {\r\n return t * t * t;\r\n}\r\n/**\r\n * Easing function: \"cubicOut\".\r\n */\r\nexport function cubicOut(t) {\r\n return --t * t * t + 1;\r\n}\r\n/**\r\n * Easing function: \"cubicInOut\".\r\n */\r\nexport function cubicInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\r\n}\r\n/**\r\n * ============================================================================\r\n * CIRCLE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"circleIn\".\r\n */\r\nexport function circleIn(t) {\r\n return 1 - Math.sqrt(1 - t * t);\r\n}\r\n/**\r\n * Easing function: \"circleOut\".\r\n */\r\nexport function circleOut(t) {\r\n return Math.sqrt(1 - --t * t);\r\n}\r\n/**\r\n * Easing function: \"circleInOut\".\r\n */\r\nexport function circleInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\r\n}\r\n/**\r\n * ============================================================================\r\n * BOUNCE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar b1 = 4 / 11, b2 = 6 / 11, b3 = 8 / 11, b4 = 3 / 4, b5 = 9 / 11, b6 = 10 / 11, b7 = 15 / 16, b8 = 21 / 22, b9 = 63 / 64, b0 = 1 / b1 / b1;\r\n/**\r\n * Easing function: \"bounceIn\".\r\n */\r\nexport function bounceIn(t) {\r\n return 1 - bounceOut(1 - t);\r\n}\r\n/**\r\n * Easing function: \"bounceOut\".\r\n */\r\nexport function bounceOut(t) {\r\n t = +t;\r\n return t < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\r\n}\r\n/**\r\n * Easing function: \"bounceInOut\".\r\n */\r\nexport function bounceInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\r\n}\r\n/**\r\n * ============================================================================\r\n * ELASTIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar tau = 2 * Math.PI;\r\nvar amplitude = 1;\r\nvar period = 0.3 / tau;\r\nvar s = Math.asin(1 / amplitude) * period;\r\n/**\r\n * Easing function: \"elasticIn\".\r\n *\r\n * @function elasticIn\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticIn(t) {\r\n return amplitude * Math.pow(2, 10 * --t) * Math.sin((s - t) / period);\r\n}\r\n/**\r\n * Easing function: \"elasticOut\".\r\n *\r\n * @function elasticOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticOut(t) {\r\n return 1 - amplitude * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / period);\r\n}\r\n/**\r\n * Easing function: \"elasticInOut\".\r\n *\r\n * @function elasticInOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticInOut(t) {\r\n t = t * 2 - 1;\r\n return (t < 0\r\n ? amplitude * Math.pow(2, 10 * t) * Math.sin((s - t) / period)\r\n : 2 - amplitude * Math.pow(2, -10 * t) * Math.sin((s + t) / period)) / 2;\r\n}\r\n//# sourceMappingURL=Ease.js.map","/**\r\n * This module contains ColorSet object definition\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color, color } from \"./Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\nimport * as $utils from \"./Utils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a set of colors. Can also generate colors according to set rules.\r\n *\r\n * @important\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar ColorSet = /** @class */ (function (_super) {\r\n tslib_1.__extends(ColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the list of the colors in this set. (preset or auto-generated)\r\n */\r\n _this._list = [];\r\n /**\r\n * Current step in a color generator's cycle.\r\n */\r\n _this._currentStep = 0;\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n */\r\n _this._startIndex = 0;\r\n /**\r\n * Current pass in the color generator's cycle. Normally a generator would\r\n * cycle through all available hue range, then repeat it, alternating other\r\n * color properties, to generate distinctive colors.\r\n */\r\n _this._currentPass = 0;\r\n /**\r\n * A base color. If there are no colors pre-set in the color list, ColorSet\r\n * will use this color as a base when generating new ones, applying\r\n * `stepOptions` and `passOptions` to this base color.\r\n */\r\n _this.baseColor = new Color({\r\n r: 103,\r\n g: 183,\r\n b: 220\r\n });\r\n /**\r\n * Modifications to apply with each new generated color.\r\n */\r\n _this.stepOptions = {};\r\n /**\r\n * Modifications to apply on top of `stepOptions` for each \"pass\" of the\r\n * color generation.\r\n *\r\n * A \"pass\" is when ColorSet generates `minColors` number of colors.\r\n */\r\n _this.passOptions = {\r\n brighten: -0.2\r\n };\r\n /**\r\n * An index increment to use when iterating through color list.\r\n *\r\n * Default is 1, which means returning each and every color.\r\n *\r\n * Setting it to a bigger number will make ColorSet `next()` iterator skip\r\n * some colors.\r\n *\r\n * E.g. setting to 2, will return every second color in the list.\r\n *\r\n * This is useful, when the color list has colors that are too close each\r\n * other for contrast.\r\n *\r\n * However, having bigger number will mean that `next()` iterator will go\r\n * through the list quicker, and the generator will kick sooner.\r\n */\r\n _this.step = 1;\r\n /**\r\n * A number of colors to generate in one \"pass\".\r\n *\r\n * This setting can be automatically overridden, if ColorSet has a list of\r\n * pre-set colors. In such case ColorSet will generate exactly the same\r\n * number of colors with each pass as there were colors in original set.\r\n */\r\n _this.minColors = 20;\r\n /**\r\n * Do not let the \"lightness\" of generated color to fall below this\r\n * threshold.\r\n */\r\n _this.minLightness = 0.2;\r\n /**\r\n * Do not let the \"lightness\" of generated color to get above this threshold.\r\n */\r\n _this.maxLightness = 0.9;\r\n /**\r\n * Randomly shuffle generated colors.\r\n */\r\n _this.shuffle = false;\r\n /**\r\n * When colors are generated, based on `stepOptions`, each generated color\r\n * gets either lighter or darker.\r\n *\r\n * If this is set to `true`, color generator will switch to opposing spectrum\r\n * when reaching `minLightness` or `maxLightness`.\r\n *\r\n * E.g. if we start off with a red color, then gradually generate lighter\r\n * colors through rose shades, then switch back to dark red and gradually\r\n * increase the lightness of it until it reaches the starting red.\r\n *\r\n * If set to `false` it will stop there and cap lightness at whatever level\r\n * we hit `minLightness` or `maxLightness`, which may result in a number of\r\n * the same colors.\r\n */\r\n _this.wrap = true;\r\n /**\r\n * Re-use same colors in the pre-set list, when ColorSet runs out of colors,\r\n * rather than start generating new ones.\r\n */\r\n _this.reuse = false;\r\n /**\r\n * Saturation of colors. This will change saturation of all colors of color\r\n * set.\r\n *\r\n * It is recommended to set this in theme, as changing it at run time won't\r\n * make the items to redraw and change color.\r\n */\r\n _this.saturation = 1;\r\n _this.className = \"ColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ColorSet.prototype, \"list\", {\r\n /**\r\n * Returns current list of colors.\r\n *\r\n * If there are none, a new list of colors is generated, based on various\r\n * ColorSet settings.\r\n *\r\n * @return Color list\r\n */\r\n get: function () {\r\n if (!this._list) {\r\n this.generate(this.minColors);\r\n }\r\n return this._list;\r\n },\r\n /**\r\n * Sets a list of pre-defined colors to use for the iterator.\r\n *\r\n * @param value Color list\r\n */\r\n set: function (value) {\r\n this._list = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets reusable color.\r\n *\r\n * @param index Index of color\r\n * @return Color\r\n */\r\n ColorSet.prototype.getReusableColor = function (index) {\r\n if (this._list.length == 0) {\r\n this.generate(1);\r\n return this.list[0];\r\n }\r\n else {\r\n var tmpstep = index - (Math.floor(index / this._list.length) * this.list.length);\r\n return this.list[tmpstep];\r\n }\r\n };\r\n /**\r\n * Returns next color in the list using internal iterator counter.\r\n *\r\n * If `step` is set to something other than 1, it may return other color than\r\n * exact next one in the list.\r\n *\r\n * @return Color\r\n */\r\n ColorSet.prototype.next = function () {\r\n var color;\r\n if (this.list.length <= this._currentStep) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(this._currentStep);\r\n }\r\n else {\r\n this.generate(this.minColors);\r\n color = this.list[this._currentStep];\r\n }\r\n }\r\n else {\r\n color = this.list[this._currentStep];\r\n }\r\n this._currentStep += this.step;\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Returns a color at specific index in the list.\r\n *\r\n * @param i Index\r\n * @return Color\r\n */\r\n ColorSet.prototype.getIndex = function (i) {\r\n var color;\r\n if (this.list.length <= i) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(i);\r\n }\r\n else {\r\n this.generate(this.minColors);\r\n color = this.getIndex(i);\r\n }\r\n }\r\n else {\r\n color = this.list[i];\r\n }\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Resets internal iterator.\r\n *\r\n * Calling `next()` after this will return the very first color in the color\r\n * list, even if it was already returned before.\r\n */\r\n ColorSet.prototype.reset = function () {\r\n this._currentStep = this._startIndex;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this._currentStep;\r\n },\r\n /**\r\n * Sets current color iteration. You can use this property to skip some\r\n * colors from iteration. E.g. setting it to `10` will skip first ten\r\n * colors.\r\n *\r\n * Please note that the number is zero-based.\r\n *\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n this._currentStep = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorSet.prototype, \"startIndex\", {\r\n /**\r\n * @return Index\r\n */\r\n get: function () {\r\n return this._startIndex;\r\n },\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n *\r\n * @default 0\r\n * @since 4.4.9\r\n * @param value Index\r\n */\r\n set: function (value) {\r\n this._startIndex = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates colors based on the various ColorSet settings.\r\n *\r\n * @param count Number of colors to generate\r\n */\r\n ColorSet.prototype.generate = function (count) {\r\n // Init\r\n var curColor = this.currentColor;\r\n var hsl = $colors.rgbToHsl($type.getValue(curColor.rgb));\r\n var hueStep = $type.hasValue(this.stepOptions.hue) ? this.stepOptions.hue : 1 / count;\r\n var mods = {\r\n brighten: 0,\r\n lighten: 0,\r\n hue: hsl.h,\r\n lightness: hsl.l,\r\n saturation: hsl.s\r\n };\r\n // Generate list of hues, and shuffle them\r\n var hues = [];\r\n if (this.reuse) {\r\n for (var i = 0; i < count; i++) {\r\n hues.push($colors.rgbToHsl($type.getValue(this._list[i].rgb)).h);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < count; i++) {\r\n var h = hsl.h + hueStep * i;\r\n if (this.wrap && (h > 1)) {\r\n h -= 1;\r\n }\r\n hues.push(h);\r\n }\r\n }\r\n // Shuffle colors randomly\r\n if (this.shuffle) {\r\n hues.sort(function (a, b) {\r\n return Math.random() - 0.5;\r\n });\r\n }\r\n // Generate colors by rotating hue\r\n for (var i = 0; i < count; i++) {\r\n // Update hue\r\n if (this.reuse) {\r\n hsl = $colors.rgbToHsl($type.getValue(this._list[i].rgb));\r\n }\r\n else {\r\n hsl.h = hues.shift();\r\n }\r\n // Apply HSL mods\r\n this.applyStepOptions(hsl, mods, i + 1, this._currentPass);\r\n // Convert back to Color\r\n var c = color($colors.hslToRgb(hsl));\r\n // Apply regular color mods\r\n var brighten = (this.stepOptions.brighten || 0) * (i + 1) + (this.passOptions.brighten || 0) * this._currentPass;\r\n if (brighten != 0) {\r\n if (this.wrap) {\r\n brighten = $utils.fitNumberRelative(brighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n brighten = $utils.fitNumber(brighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.brighten(brighten);\r\n }\r\n var lighten = (this.stepOptions.lighten || 0) * (i + 1) + (this.passOptions.lighten || 0) * this._currentPass;\r\n if (lighten != 0) {\r\n if (this.wrap) {\r\n lighten = $utils.fitNumberRelative(lighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n lighten = $utils.fitNumber(lighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.lighten(lighten);\r\n }\r\n this._list.push(c);\r\n }\r\n this._currentPass++;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentColor\", {\r\n /**\r\n * Returns current last color. It's either the last color in the list of\r\n * colors, or `baseColor` if list is empty.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (this._list.length == 0) {\r\n return this.baseColor.saturate(this.saturation);\r\n }\r\n else {\r\n return this._list[this._list.length - 1].saturate(this.saturation);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates modifiers for color, based on what step and pass.\r\n *\r\n * @param hsl Curren HSL value of the color to modify\r\n * @param base The modifiers that were before modification to use as a base\r\n * @param step Current step\r\n * @param pass Current pass\r\n */\r\n ColorSet.prototype.applyStepOptions = function (hsl, base, step, pass) {\r\n // Process lightness\r\n hsl.l = base.lightness + (this.stepOptions.lightness || 0) * step + (this.passOptions.lightness || 0) * pass;\r\n if (this.wrap) {\r\n if (hsl.l > 1) {\r\n hsl.l = hsl.l - Math.floor(hsl.l);\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = -(hsl.l - Math.floor(hsl.l));\r\n }\r\n hsl.l = $utils.fitNumberRelative(hsl.l, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n if (hsl.l > 1) {\r\n hsl.l = 1;\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = 0;\r\n }\r\n hsl.l = $utils.fitNumber(hsl.l, this.minLightness, this.maxLightness);\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 ColorSet.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up axis ranges\r\n if ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n for (var i = 0, len = config.list.length; i < len; i++) {\r\n if (!(config.list[i] instanceof Color)) {\r\n config.list[i] = color(config.list[i]);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return ColorSet;\r\n}(BaseObject));\r\nexport { ColorSet };\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[\"ColorSet\"] = ColorSet;\r\n//# sourceMappingURL=ColorSet.js.map"],"sourceRoot":""}