zoomChart.js 857 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";var ZoomCharts=ZoomCharts||{};!function(t){var e=t.Configuration||(t.Configuration={}),i=t.Internal||(t.Internal={});
  2. /*!
  3. @license
  4. DVSL Charting library, version 1.16.5.
  5. (c) 2013 - 2017 Data Visualization Software Lab
  6. https://zoomcharts.com
  7. Embedded 3rd party software libraries:
  8. CssColorParser.js
  9. author : Dean McNamee <dean@gmail.com>, 2012.
  10. license : MIT
  11. github.com/deanm/css-color-parser-js
  12. SHA-256 implementation in JavaScript
  13. author : Chris Veness
  14. license: MIT
  15. github.com/chrisveness/crypto
  16. jsrsasign (RSA-Sign JavaScript Library)
  17. version : 4.7.2
  18. author : Kenji Urushima
  19. license : MIT
  20. kjur.github.io/jsrsasign/
  21. jsbn (RSA and ECC in JavaScript)
  22. version : 1.4
  23. author : Tom Wu
  24. license : BSD (http://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE)
  25. www-cs-students.stanford.edu/~tjw/jsbn/
  26. */
  27. t.PackageInfo={LibraryName:"zoomcharts",Version:"1.16.5",Revision:"c815cfd8b472475fdca6f5fdf81f200303706965",Built:"2017-02-20"};var n=function(t,e){function i(){this.constructor=t}t.__baseType=e;for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)};!function(i){var s=i.GeoChart||(i.GeoChart={}),r=i.FacetChart||(i.FacetChart={}),a=i.PieChart||(i.PieChart={}),o=i.TimeChart||(i.TimeChart={}),l=i.LinearChart||(i.LinearChart={}),h=i.NetChart||(i.NetChart={}),u=i.ItemsChart||(i.ItemsChart={}),c=i.Resources||(i.Resources={}),d=i.Base||(i.Base={});"undefined"!=typeof module&&module.exports&&(module.exports.Internal=i),function(s){function r(){}function a(t,e){for(var i in e)e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=e[i])}var o=s.Bar||(s.Bar={}),l=Object.prototype.hasOwnProperty,h=("undefined"==typeof console?null:console)||{};h.log||(h.log=r),h.warn||(h.warn=r),h.error||(h.error=r),h.info||(h.info=r),s.overlayConsole=!1;var u=function(){function t(){}return t.exportSymbol=function(t,e){"undefined"!=typeof window&&(window[t]=e),"undefined"!=typeof module&&module.exports&&(module.exports[t]=e)},t.extendStyleTo=function(t,e){for(var i=Object.keys(t),n=0;n<i.length;n++){var s=i[n],r=t[s];void 0!==r&&(e[s]=r)}},t.extendDataItem=function(e,i){for(var n=e,s=Object.keys(i),r=0;r<s.length;r++){var a=s[r],o=i[a];"style"===a?n.style?t.extendDeep(n.style,o):n.style=t.realClone(o):n[a]=o}return n},t.extendDeep=function(e,i){if(null==e)throw new Error("Target object is not defined.");if(!t.isObjectOrArray(e))throw new Error("Target is not an object.");for(var n=Object.keys(i),s=0;s<n.length;s++){var r=n[s],a=i[r],o=e[r];null==o&&t.isObjectOrArray(a)&&!t.isDomObject(a)?e[r]=this.realClone(a):t.isObjectOrArray(o)&&t.isObjectOrArray(a)&&!t.isDomObject(o)&&!t.isDomObject(a)?this.extendDeep(o,a):e[r]=a}},t.extendCopy=function(t,e,i){if(void 0===i&&(i=null),!e)return t;for(var n=Object.keys(e),s=0;s<n.length;s++){var r=n[s],a=e[r];if(i&&(a=i(r,a)),void 0!==a){var o=t[r];this.isDomObject(a)?t[r]=a:this.isObjectOrArray(o)&&this.isObjectOrArray(a)?this.extendCopy(o,a,i):this.isObjectOrArray(a)?Array.isArray(a)?t[r]=this.extendCopy([],a,i):t[r]=this.extendCopy({},a,i):t[r]=a}}return t},t.clone=function(e){if(null==e)return e;var i;i=t.isObjectOrArray(e)?new e.constructor:e.constructor();for(var n=Object.keys(e),s=0;s<n.length;s++){var r=n[s],a=e[r];i[r]=a}return i},t.isObjectOrArray=function(t){return null!==t&&"object"==typeof t},t.isDomObject=function(t){return t instanceof Element||t instanceof CanvasGradient||t instanceof CanvasPattern},t.isFunction=function(t){return"function"==typeof t},t.isNumber=function(t){return!isNaN(t)&&("number"==typeof t||t instanceof Number)},t.isString=function(t){return"string"==typeof t||t instanceof String},t.tryParseInt=function(t,e){void 0===e&&(e=0);var i=parseInt(t,10);return isNaN(i)?e:i},t.tryParseFloat=function(t,e){void 0===e&&(e=0);var i=parseFloat(t);return isNaN(i)?e:i},t.hasProperty=function(t,e){return l.call(t,e)},t.hasProperties=function(t){return!!t&&Object.keys(t).length>0},t.removePropertyValue=function(t){var e=Object.keys(t);if(0===e.length)return null;var i=e[0],n=t[i];return delete t[i],{key:i,value:n}},t.countProperties=function(t){return Object.keys(t).length},t.realClone=function(t){if(this.isFunction(t)||this.isDomObject(t))return t;if(Array.isArray(t)){for(var e=new Array(t.length),i=0;i<t.length;i++)e[i]=this.realClone(t[i]);return e}if(this.isObjectOrArray(t)){for(var n=new t.constructor,s=Object.keys(t),i=0;i<s.length;i++){var r=s[i];n[r]=this.realClone(t[r])}return n}return t},t.realCloneSafe=function(t,e){if(void 0===e&&(e=[]),this.isFunction(t)||this.isDomObject(t))return t;if(Array.isArray(t)){for(var i=0;i<e.length;i++){var n=e[i];if(n.from===t)return n.to}var s=new Array(t.length);e.push({from:t,to:s});for(var i=0;i<t.length;i++)s[i]=this.realCloneSafe(t[i],e);return s}if(this.isObjectOrArray(t)){for(var i=0;i<e.length;i++){var n=e[i];if(n.from===t)return n.to}var r=new t.constructor;e.push({from:t,to:r});for(var a=Object.keys(t),i=0;i<a.length;i++){var o=a[i];r[o]=this.realCloneSafe(t[o],e)}return r}return t},t.removeFromArray=function(t,e){for(var i,n=!1;(i=t.indexOf(e))>-1;)t.splice(i,1),n=!0;return n},t.removeFromArrayHasty=function(t,e){var i=t.indexOf(e);if(i<0)return!1;var n=t.pop();return i!==t.length&&(t[i]=n),!0},t.arrayToMap=function(t,e){for(var i={},n=0;n<t.length;n++){var s=t[n];s.index=n,i[s[e]]=s}return i},t.overlayConsoleMessage=function(e,i,n){var s=document.getElementById("zoomChartsOverlayConsole");s||(s=document.createElement("div"),s.id="zoomChartsOverlayConsole",t.extendCopy(s.style,{position:"absolute",top:"10px",left:"10px",width:"50%",height:"300px",overflow:"auto",backgroundColor:"rgba(255,255,255,0.75)",border:"1px solid black",zIndex:"99999"}),document.body.appendChild(s));var r=document.createElement("div");r.style.color="error"===e?"red":"warn"===e?"yellow":"black",r.innerText=i+n.map(function(t){return JSON.stringify(t)}).join(""),s.appendChild(r),s.scrollTop=s.scrollHeight},t.log=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];s.overlayConsole?t.overlayConsoleMessage("log",e,i):i&&i.length?h.info.apply(h,[e].concat(i)):h.info(e)},t.warn=function(e,i,n){if(void 0===n&&(n=null),n){var r=(new Date).getTime();if(this._previousConsoleMessages[e]>r)return;n===!0&&(n=5e3),this._previousConsoleMessages[e]=r+n}s.overlayConsole?t.overlayConsoleMessage("warn",e,i):i&&i.length?h.warn.apply(h,[e].concat(i)):h.warn(e)},t.error=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];s.overlayConsole?t.overlayConsoleMessage("error",e,i):i&&i.length?h.error.apply(h,[e].concat(i)):h.error(e)},t.createDom=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null);var s=document.createElement(t);return null!==e&&(s.className=e),null!==i&&(s.innerHTML=i),null!==n&&n.appendChild(s),s},t.addClass=function(t,e){if(e=(e||"").trim()){var i=e.indexOf(" ");if(i>-1&&(this.addClass(t,e.substr(i+1)),e=e.substr(0,i)),t.classList)t.classList.add(e);else{var n=t.className.length>0&&new RegExp("(^|s)"+e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")+"(s|$)").test(t.className);n||(t.className.length>0&&(e=" "+e),t.className=e)}}},t.removeClass=function(t,e){if(e=(e||"").trim()){var i=e.indexOf(" ");if(i>-1&&(this.removeClass(t,e.substr(i+1)),e=e.substr(0,i)),t.classList)t.classList.remove(e);else{var n=function(t,i){return i===e?"":t};t.className=t.className.replace(/(\S+)\s*/g,n).trim()}}},t.isStyleSheetDefined=function(t,e){var i=document.createElement("dvsl-test"),n=document.body;n.appendChild(i);try{var s=window.getComputedStyle(i),r=s[e];return i.className=t,n.removeChild(i),n.appendChild(i),r!==s[e]}finally{n.removeChild(i)}},t.listen=function(t,e,i){t.addEventListener(e,i)},t.unlisten=function(t,e,i){t.removeEventListener(e,i)},t.stopPropagation=function(t){t.stopPropagation()},t.canvasScaling=function(){var t,e;return window.screen.deviceXDPI?(t=window.screen.deviceXDPI/window.screen.logicalXDPI,e=window.screen.deviceYDPI/window.screen.logicalYDPI):t=e=window.devicePixelRatio?window.devicePixelRatio:1,{x:t,y:e}},t.convertPointFromPageToNode=function(t,e,i,n,s){if(window&&window.webkitConvertPointFromPageToNode){var r=window.webkitConvertPointFromPageToNode(t,new WebKitPoint(e,i));if(r)return r}var a=t.getBoundingClientRect();return{x:n-a.left,y:s-a.top}},t.elementPos=function(t){var e=t.getBoundingClientRect(),i=e.top+(window.pageYOffset||document.documentElement.scrollTop)-(document.documentElement.clientTop||0),n=e.left+(window.pageXOffset||document.documentElement.scrollLeft)-(document.documentElement.clientLeft||0);return{left:n,top:i}},t.isParentOf=function(t,e){for(;e;){if(e===t)return!0;e=e.parentElement}return!1},t.getProp=function(t,e,i){void 0===i&&(i=!1);for(var n=0,s=e.split(".");n<s.length;n++){var r=s[n];if(null==t||!this.hasProperty(t,r))return;if(i&&n===s.length-1){var a=t[r];delete t[r],t=a}else t=t[r]}return t},t.wrapValue=function(t,e){for(var i=t,n=e.split(".").reverse(),s=0;s<n.length;s++){var r=n[s];a={},a[r]=i,i=a}return i;var a},t.hasProp=function(e,i){return void 0!==t.getProp(e,i)},t.sign=function(t){return t?t<0?-1:1:0},t.reversePolyline=function(t){var e=[];if(t.length%2!==0)throw new Error("The length of a given polyline must be dividable by 2");for(var i=t.length-1;i>=0;i+=-2)e.push(t[i-1],t[i]);return e},t.toleranceMax=function(t,e,i){return t>=e*i?t:e},t.toleranceMin=function(t,e,i){return t*i<=e?t:e},t.getIdentifierStr=function(){return t.SeparatorChar+(t.nextIdentifier++).toString()},t.doPostRequest=function(t,e,i,n,s){this.isString(i)||(i=JSON.stringify(i)),this.doRequestRaw(t,e,"POST",i,n,s)},t.doRequest=function(t,e,i,n,s){if(i&&i.length){t+=t.indexOf("?")!==-1?"&":"?";for(var r=0;r<i.length;r++){var a=i[r];r>0&&(t+="&"),t+=encodeURIComponent(a[0])+"="+encodeURIComponent(a[1])}}this.doRequestRaw(t,e,"GET","",n,s)},t.doRequestRaw=function(t,e,i,n,s,r){var a;if("undefined"==typeof XMLHttpRequest)throw new Error("Cannot create XMLHttpRequest. Please verify if the feature is not disabled in the browser configuration.");a=new XMLHttpRequest,a.onreadystatechange=function(){4===a.readyState&&(200===a.status?s(a.responseText):r(a.responseText))};try{a.open(i,t,!0),a.timeout=e,a.ontimeout=function(){r('{"error": "Request timeout."}')},a.send(n)}catch(t){return void window.setTimeout(function(){return r(t)},1)}},t.openUrl=function(t,e){return window.open(t,e||"_blank")},t.parseData=function(e,i,n){void 0===n&&(n=!1);var s=null,r=null;if(i=i.toLowerCase(),"json"===i||"geojson"===i)if(t.isString(e))try{r=JSON.parse(e)}catch(t){s=n?e:"Failed to parse JSON response: "+t+". Response text: "+e}else r=e;else s="Unsupported data format: "+i;return null==r&&null==s&&(s="NULL response"),s?{error:s}:r},t.numberFormat=function(t,e,i,n){void 0===e&&(e=2),void 0===i&&(i="."),void 0===n&&(n="聽");var s=parseFloat(t);if(isNaN(s))return"鈥�";var r;s<0?(r="-",s=-s):r="";for(var a,o=Math.floor(s),l=s-o,h=i+l.toFixed(e).substr(2);;){if(a=o%1e3,h=a.toFixed(0)+h,!(o>=1e3))break;o=Math.floor(o/1e3),a<10?h="00"+h:a<100&&(h="0"+h),h=n+h}return r+h},t.buildImage=function(t,e,i,n){var s=this,r=new Image,a=function(){return i(r)},o=function(a){e?s.buildImage(t,null,i,n):n(r)};return e&&(r.crossOrigin=e),r.src=t,r.complete?r.width>0?a():setTimeout(a,0):(r.onload=a,r.onerror=o),r},t.sort=function(t,e){e||(e=function(t,e){return t-e});for(var i,n,s=t,r=0|s.length,a=0;a<=r-2;a+=2)i=s[a],n=s[a+1],e(i,n)>0&&(s[a]=n,s[a+1]=i);for(var o=s.slice(0),l=2;l<r;){for(var h=l<<1,u=0;u<=r-1;u+=h){var c=u,d=u+l;if(d>=r)for(var a=c;a<=r-1;a++)o[a]=s[a];else{var p=d,f=Math.min(d+l,r),g=u;for(i=s[c],n=s[d];;)if(e(i,n)<=0){if(o[g]=i,g=g+1|0,c=c+1|0,c===p){for(o[g]=n,g=g+1|0,d=d+1|0;d<f;)o[g]=s[d],g=g+1|0,d=d+1|0;break}i=s[c]}else{if(o[g]=n,g=g+1|0,d=d+1|0,d===f){for(o[g]=i,g=g+1|0,c=c+1|0;c<p;)o[g]=s[c],g=g+1|0,c=c+1|0;break}n=s[d]}}}l=h;var m=o;o=s,s=m}if(t!==s){for(var a=0;a<=r-1;a++)t[a]=s[a];s.length=0}else o.length=0;return t},t.binSearch=function(t,e){for(var i=0,n=t.length-1;i<n;){var s=(n+i)/2|0;if(t[s]<e)i=s+1;else{if(!(t[s]>e)){for(;s>0&&t[s-1]===e;)s-=1;return s}n=s}}return i<t.length&&t[i]<e?i+1:i},t.listenResize=function(e,i){var n=document.documentMode;if(n&&n<11)e.onresize=i;else{var s=e,r=document.createElement("div"),a=function(e){i(),t.updateResizeTriggers(r)};"static"===window.getComputedStyle(s).position&&(s.style.position="relative"),s.__resizeTriggers__=r,r.className="DVSL-resize-triggers",r.innerHTML='<div class="DVSL-expand-trigger"><div></div></div><div class="DVSL-contract-trigger"></div>',s.insertBefore(r,s.firstChild),t.updateResize(r),s.__resizeListener__=a,s.addEventListener("scroll",a,!0)}},t.updateResize=function(t){var e=t.__resizeTriggers__;e&&this.updateResizeTriggers(e)},t.updateResizeTriggers=function(t){var e=t.firstElementChild,i=t.lastElementChild,n=e.firstElementChild;i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight,n.style.width=e.offsetWidth+1+"px",n.style.height=e.offsetHeight+1+"px",e.scrollLeft=e.scrollWidth,e.scrollTop=e.scrollHeight},t.unlistenResize=function(t){var e=t,i=e.__resizeTriggers__;i?(e.removeEventListener("scroll",e.__resizeListener__,!0),i.parentNode&&i.parentNode.removeChild(i),delete e.__resizeListener__,delete e.__resizeTriggers__):delete t.onresize},t.decodeEntities=function(e){return e.indexOf("&")===-1?e:(t.decodeTextarea||(t.decodeTextarea=document.createElement("textarea")),t.decodeTextarea.innerHTML=e,t.decodeTextarea.value)},t.base64Encode=function(t){if(window.btoa)return window.btoa(t);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="",n=0,s=0;t.charAt(0|s)||(e="=",s%1);i+=e.charAt(63&n>>8-s%1*8)){var r=t.charCodeAt(s+=.75);if(r>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|r}return i},t.compareVersions=function(t,e){for(var i=t.split("."),n=i.length,s=e.length,r=0;r<Math.max(n,s);r++){var a=r<n?parseInt(i[r],10):0,o=r<s?e[r]:0;if(a>o)return!0;if(a<o)return!1}return!0},t.aggregate=function(t,e,i){for(var n=0,s=this.aggregationCallbacks[t],r=s.start;e();){var a=i();s.increment(r,a),n+=1}return n>0?s.result(r,n):null},t._previousConsoleMessages={},t.SeparatorChar=String.fromCharCode(63743),t.nextIdentifier=0,t.decodeTextarea=null,t.aggregationCallbacks={sum:{start:0,increment:function(t,e){return t+e},result:function(t,e){return t}},min:{start:1/0,increment:function(t,e){return Math.min(t,e)},result:function(t,e){return t}},max:{start:-(1/0),increment:function(t,e){return Math.max(t,e)},result:function(t,e){return t}},avg:{start:0,increment:function(t,e){return t+e},result:function(t,e){return t/e}},count:{start:0,increment:function(t,e){return 0},result:function(t,e){return e}},first:{start:null,increment:function(t,e){return null!==t&&void 0!==t?t:e},result:function(t,e){return t}},last:{start:null,increment:function(t,e){return null!==e&&void 0!==e?e:t},result:function(t,e){return t}}},t}();if(s.Helpers=u,"undefined"!=typeof window){var d=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,p=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame;if(!d){var f=0;d=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-f)),n=window.setTimeout(function(){return t(e+i)},i);return f=e+i,n},p=window.clearTimeout}p||(p=function(){}),u.requestAnimationFrame=function(t){return d.call(window,t)},u.cancelAnimationFrame=function(t){return p.call(window,t)};var g=(new Date).getTime();"performance"in window==!1?u.performanceNow=function(){return(new Date).getTime()-g}:"now"in window.performance==!1?(performance.timing&&performance.timing.navigationStart&&(g=performance.timing.navigationStart),u.performanceNow=function(){return(new Date).getTime()-g}):u.performanceNow=function(){return window.performance.now()};var m=g-u.performanceNow();u.timeToPerfNow=function(t){return t-m}}var v=function(){function t(){this.id="default",this.url=null,this.urlParameters=[],this.postprocessorFunction=null,this.preloaded=null,this.format="JSON",this.requestTimeout=4e4,this.numberOfParallelRequests=3}return t}();s.SettingsData=v;var y=function(){function t(t,e){this.removed=!1,this.requestScheduled=!1,this.requestsRunning=!1,this.requestCount=0,this.dataSettings=e,this.chart=t,this.settings=t.settings}return t.doRequest=function(t,e,i,n,s){if(e.urlParameters.length){i=i.slice();for(var r=0;r<e.urlParameters.length;r++){var a=e.urlParameters[r];i.push([a.name,a.value])}}var o;o=e.postprocessorFunction?function(t){return n(e.postprocessorFunction(t))}:n,u.doRequest(t,e.requestTimeout,i,o,s)},t.prototype.buildRequest=function(){return null},t.prototype.verifyData=function(t,e){return!0},t.prototype.addVerifiedData=function(t,e){return{}},t.prototype.requestFailedPermanently=function(t){},t.prototype.remove=function(){this.removed=!0},t.prototype.hasPendingRequests=function(){return!this.removed&&this.requestCount>0},t.prototype.addData=function(t){this._dataArrived(null,t)},t.prototype.applyPreloadedData=function(){this.dataSettings.preloaded&&this._dataArrived(null,this.dataSettings.preloaded)},t.prototype.scheduleRequests=function(t){var e=this;void 0===t&&(t=!1),t?this._runRequests():this.requestScheduled||(this.requestScheduled=!0,setTimeout(function(){return e._runRequests()},0))},t.prototype._runRequests=function(){var t=this;if(!this.removed&&!this.requestsRunning){this.requestScheduled=!1;var e;try{for(this.requestsRunning=!0;this.requestCount<this.dataSettings.numberOfParallelRequests&&(e=this.buildRequest(),null!==e);)!function(e){var i=function(i){return t._dataArrived(e,i)},n=function(i){return t._dataError(e,i)};t.requestCount+=1,t.chart.log("Requesting data for",e),t.dataFunc(e,i,n)}(e)}finally{this.requestsRunning=!1}}},t.prototype._dataError=function(t,e){if(!this.removed){var i=u.parseData(e,this.dataSettings.format,!0),n=i.error?i.error:"Unknown error";t?(this.requestCount-=1,this.chart.error("Data request failed: "+n,t)):this.chart.error("Data loading failed: "+n),this.requestFailedPermanently(t),this._runRequests()}},t.prototype._dataArrived=function(t,e){if(!this.removed){var i=u.parseData(e,this.dataSettings.format);if(t?(this.requestCount-=1,i.error?this.chart.error("Data request succeeded, but contained an error: "+i.error,t):this.chart.log("Data arrived for request",t)):i.error?this.chart.error("Loaded data contains error: "+i.error):this.chart.log("Data loaded"),!i.error&&this.verifyData(t,i)){var n=this.addVerifiedData(t,i);n.dataArrived||(n.dataArrived={}),n.dataArrived[this.dataSettings.id]=!0,this.chart.events.notifySceneChanges(n)}else t&&this.requestFailedPermanently(t);this._runRequests()}},t}();s.Data=y;var S=function(){function t(){}return t.detect=function(){return this._cached||this.run()},t.run=function(){var t,e=window,i=document.body;document.domain&&(t=document.createElement("iframe"),i.appendChild(t),e=t.contentWindow);var n;try{n=this.check(e)}catch(t){n=this.check(window)}return this._cached=n,t&&i.removeChild(t),n},t.check=function(t){return{isSafariDesktop:!!t.safari&&!!t.safari.pushNotification,isChrome:!!t.chrome&&!!t.chrome.loadTimes}},t._cached=null,t}();s.Browser=S;var b=function(){function t(t,e,i,n){this.consumed=!1,this.defaultPrevented=!1,this.x=0,this.y=0,this.dx=0,this.dy=0,this.wheely=0,this.wheelx=0,this.identifier="0",this.pressed=!1,this.touch=!1,this.pageX=0,this.pageY=0,this.shiftKey=!1,this.altKey=!1,this.ctrlKey=!1,this.target=null,this.isRightMB=!1,this._vx=null,this._vy=null,this.velocityPointer=null,this._leaving=!1,this.swipeUp=!1,this.swipeDown=!1,this.swipeLeft=!1,this.swipeRight=!1,this.swipeSpeed=null,this.capture=!1,this.hovered=!1,this.cursor=null,this.changedPointerCount=1,this.identifier=n,this.timeStamp=i,this.y=e,this.x=t}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},Object.defineProperty(t.prototype,"vx",{get:function(){return null===this._vx&&null!==this.velocityPointer&&this.velocityPointer.calculatePosAndSpeed(this),this._vx||0},set:function(t){this._vx=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vy",{get:function(){return null===this._vy&&null!==this.velocityPointer&&this.velocityPointer.calculatePosAndSpeed(this),this._vy||0},set:function(t){this._vy=t},enumerable:!0,configurable:!0}),t.prototype.distance=function(t){return Math.sqrt((t.x-this.x)*(t.x-this.x)+(t.y-this.y)*(t.y-this.y))},t.prototype.isWithinDistance=function(t,e,i){if(!t)return!1;var n=this.pageX-t.pageX,s=this.pageY-t.pageY;return n*n+s*s<e*e&&(null==i||t.timeStamp+i>this.timeStamp)},t}();s.MouseEvent=b;var C=function(){function t(t,e){this.noClick=!1,this.scrolling=!1,this.ptsIndex=0,this.ptsLength=3,this.ptsMax=72,this.settings=e,this.identifier=t.identifier,this.touch=!1,this.x=t.x,this.y=t.y,this.pageX=t.pageX,this.pageY=t.pageY,this.timeStamp=t.timeStamp,"undefined"!=typeof Int32Array?this.pts=new Int32Array(this.ptsMax):this.pts=new Array(this.ptsMax),this.pts[0]=0|this.x,this.pts[1]=0|this.y,this.pts[2]=0}return t.prototype.moveTo=function(t){var e=this.ptsIndex+this.ptsLength,i=t.timeStamp-this.timeStamp|0,n=this.ptsMax;i===this.pts[e-1]&&(this.ptsLength-=3,e-=3),t.x||t.y?(t.dx=t.x-this.x,t.dy=t.y-this.y,this.x=t.x,this.y=t.y):(t.dx=0,t.dy=0,t.x=this.x,t.y=this.y),e===this.ptsMax&&(e=0),this.pts[e++]=0|this.x,this.pts[e++]=0|this.y,this.pts[e++]=0|i,(this.ptsLength+=3)>n&&(this.ptsLength-=3,n===(this.ptsIndex+=3)&&(this.ptsIndex=0))},t.prototype.getPosAndSpeed=function(t){t.touch=this.touch,t.velocityPointer=this,t.vx=null,t.vy=null},t.prototype.calculatePosAndSpeed=function(t){var e,i,n=this.pts,s=this.ptsMax,r=10*s,a=50,o=(t.timeStamp-this.timeStamp|0)-r;for(e=this.ptsIndex;e<this.ptsIndex+this.ptsLength&&(i=e%s,!(n[i+2]>o));e+=3);return r=(t.timeStamp-this.timeStamp|0)-n[i+2],e===this.ptsIndex+this.ptsLength||r<a?(t.vx=0,void(t.vy=0)):(t.vx=(this.x-n[i+0])/r,void(t.vy=(this.y-n[i+1])/r))},t}(),x=function(){function t(e,i,n){var s=this;void 0===n&&(n=null),this.scaleX=1,this.scaleY=1,this.nextFakeMouseId=1,this.doubleClickTimeout=null,this.longPressTimeout=null,this.longPressInitiator=null,this.listeners={},this.downPointers={},this.inPointers={},this.containerList=[],this.clickCounter=1,this.lastClickEvent=null,this.topWindowEvents={},this.ID_MOUSE="mouse",this.settings=i,this.container=e,this.lastEvent=null,this.lastTouchEvent=null,this.clickEvent=null,this.containerEvents={contextmenu:function(t){return s.filterEvent(t)&&s.handleCMenu(t)},wheel:function(t){return s.filterEvent(t)&&s.handleMouseWheel(t)},dragover:function(t){return s.filterEvent(t)&&s.handleMouseMove(t)}};var r="undefined"!=typeof PointerEvent,a="undefined"!=typeof TouchEvent,o=!r&&"undefined"!=typeof MSPointerEvent;o?(this.container.style.msTouchAction="none",this.windowEvents=(c={},c.MSPointerDown=function(t){return s.filterEvent(t)&&s.handlePointerDown(t)},c.MSPointerMove=function(t){return s.filterEvent(t)&&s.handlePointerMove(t)},c.MSPointerUp=function(t){return s.filterEvent(t)&&s.handlePointerUp(t)},c.MSPointerCancel=function(t){return s.filterEvent(t)&&s.handlePointerCancel(t)},c)):r&&!a?(this.container.style.touchAction="none",this.windowEvents=(d={},d.pointerdown=function(t){return s.filterEvent(t)&&s.handlePointerDown(t)},d.pointermove=function(t){return s.filterEvent(t)&&s.handlePointerMove(t)},d.pointerup=function(t){return s.filterEvent(t)&&s.handlePointerUp(t)},d.pointercancel=function(t){return s.filterEvent(t)&&s.handlePointerCancel(t)},d)):(this.windowEvents={mousedown:function(t){return s.filterEvent(t)&&s.handleMouseDown(t)},mouseup:function(t){return s.filterEvent(t)&&s.handleMouseUp(t)},mousemove:function(t){return s.filterEvent(t)&&s.handleMouseMove(t)},touchstart:function(t){return s.filterEvent(t)&&s.handleTouchStart(t)},touchend:function(t){return s.filterEvent(t)&&s.handleTouchEnd(t)},touchcancel:function(t){return s.filterEvent(t)&&s.handleTouchCancel(t)},touchmove:function(t){return s.filterEvent(t)&&s.handleTouchMove(t)}},this.topWindowEvents={mouseup:function(t){return s.filterEvent(t)&&s.handleMouseUp(t)},touchend:function(t){return s.filterEvent(t)&&s.handleTouchEnd(t)}}),!t._ignoreWindowTop&&window.top&&this.addTopWindowHandlers(),S.detect().isSafariDesktop&&this.addSelectPrevention();for(var l in this.windowEvents)u.listen(window,l,this.windowEvents[l]);if(this.addContainer(e),n)for(var h=0;h<n.length;h++)this.addContainer(n[h]);var c,d}return t.prototype.addSelectPrevention=function(){var t=this;document.addEventListener("selectstart",function(e){Object.keys(t.downPointers).length&&e.preventDefault()})},t.prototype.addTopWindowHandlers=function(){try{for(var e in this.topWindowEvents)u.listen(window.top,e,this.topWindowEvents[e])}catch(e){t._ignoreWindowTop=!0}},t.prototype.addContainer=function(t){this.containerList.push(t);var e;for(e in this.containerEvents)u.listen(t,e,this.containerEvents[e]);for(e in this.windowEvents)u.listen(t,e,this.windowEvents[e])},t.prototype.remove=function(){for(var e in this.windowEvents)u.unlisten(window,e,this.windowEvents[e]);if(!t._ignoreWindowTop)for(var e in this.topWindowEvents)u.unlisten(window.top,e,this.topWindowEvents[e]);for(var i=0;i<this.containerList.length;i++){var n=this.containerList[i];for(var e in this.containerEvents)u.unlisten(n,e,this.containerEvents[e])}},t.prototype.listen=function(t,e){this.listeners[t]=e},t.prototype.processConsumed=function(t,e,i){e&&(u.stopPropagation(t),i&&t.preventDefault())},t.prototype.capturePointer=function(t){var e=t.target;e.setPointerCapture?e.setPointerCapture(t.pointerId):e.msSetPointerCapture?e.msSetPointerCapture(t.pointerId):this.captureMouse(t)},t.prototype.releasePointer=function(t){this.releaseMouse(t)},t.prototype.releaseMouse=function(t){document.releaseCapture&&document.releaseCapture()},t.prototype.captureMouse=function(t){var e=t.target;e.setCapture&&e.setCapture(!0)},t.prototype.filterEvent=function(t){return t!==this.lastEvent&&(this.lastEvent=t,!0)},t.prototype.handlePointerDown=function(t){var e=this.buildEvent(t,t.pointerId.toString(),t.timeStamp,t.buttons>0);t.currentTarget!==window&&this.capturePointer(t),this.downHappened(e),this.processConsumed(t,e.consumed)},t.prototype.handlePointerMove=function(t){var e=this.buildEvent(t,t.pointerId.toString(),t.timeStamp,t.buttons>0);this.moveHappened(e),this.processConsumed(t,e.consumed,!0)},t.prototype.handlePointerUp=function(t){if(0===t.buttons){var e=this.buildEvent(t,t.pointerId.toString(),t.timeStamp,!1);this.releasePointer(t),this.upHappened(e),this.processConsumed(t,e.consumed)}},t.prototype.handlePointerCancel=function(t){var e=this.buildEvent(t,t.pointerId.toString(),t.timeStamp,!1);this.cancelHappened(e)},t.prototype.handleMouseDown=function(t){if(!(t.timeStamp<this.lastTouchEvent)){var e=this.buildEvent(t,this.ID_MOUSE,t.timeStamp,!0);t.currentTarget!==window&&this.captureMouse(t),this.downHappened(e),this.processConsumed(t,e.consumed)}},t.prototype.handleCMenu=function(t){this.processConsumed(t,!0,!0)},t.prototype.handleMouseWheel=function(t){if(this.isTargetOkay(t.target)&&(!this.settings.mouseWheelRequiresFocus||document.activeElement===this.container)){if(5===t.mozInputSource||0===t.deltaX&&0===t.deltaY)return void u.stopPropagation(t);if(t.deltaMode!==t.DOM_DELTA_PAGE){var e=this.buildEvent(t,this.ID_MOUSE,t.timeStamp,!0),i=t.deltaMode===t.DOM_DELTA_LINE?-40:-1;e.wheely=t.deltaY*i,e.wheelx=t.deltaX*i,this.wheelHappened(e),this.processConsumed(t,e.consumed,!0)}}},t.prototype.handleMouseUp=function(t){if(t.shiftKey&&t.ctrlKey)return this.ID_MOUSE="mouse"+this.nextFakeMouseId,void(this.nextFakeMouseId+=1);var e=this.buildEvent(t,this.ID_MOUSE,t.timeStamp,!1);this.releaseMouse(t),this.upHappened(e),this.processConsumed(t,e.consumed)},t.prototype.handleMouseMove=function(t){if(!(t.timeStamp<this.lastTouchEvent)){var e=this.buildEvent(t,this.ID_MOUSE,t.timeStamp,!1);this.moveHappened(e),this.processConsumed(t,e.consumed,!0)}},t.prototype.handleTouchStart=function(t){this.lastTouchEvent=t.timeStamp+2e3,this.removeLostTouches(t,t.touches,t.changedTouches);for(var e,i=!1,n=t.changedTouches||t.touches,s=0;s<n.length;s++){var r=n[s];e=this.buildTouchEvent(t,r,!0,n.length),this.downHappened(e),i=i||e.consumed}this.processConsumed(t,i)},t.prototype.handleTouchEnd=function(t){this.lastTouchEvent=t.timeStamp+2e3;for(var e=t.changedTouches||t.touches,i=!1,n=0;n<e.length;n++){var s=e[n],r=this.buildTouchEvent(t,s,!1,e.length),a=this.buildTouchEvent(t,s,!1,e.length);a.x=a.y=a.pageX=a.pageY=-1e9,this.upHappened(r),this.pointerLeave(a),i=i||r.consumed||a.consumed,this.removeLostTouches(t,t.touches)}this.processConsumed(t,i)},t.prototype.handleTouchCancel=function(t){this.lastTouchEvent=t.timeStamp+2e3;for(var e=t.changedTouches||t.touches,i=0;i<e.length;i++){var n=e[i],s=this.buildTouchEvent(t,n,!1,e.length);this.cancelHappened(s)}this.removeLostTouches(t,t.touches)},t.prototype.handleTouchMove=function(t){this.lastTouchEvent=t.timeStamp+2e3;var e=!1;this.removeLostTouches(t,t.touches);for(var i,n=t.changedTouches||t.touches,s=0;s<n.length;s++){var r=n[s];i=this.buildTouchEvent(t,r,!0,n.length),this.moveHappened(i),e=e||i.consumed}this.processConsumed(t,e,!0)},t.prototype.removeLostTouches=function(t,e,i){void 0===i&&(i=null);for(var n=Object.create(null),s=0;s<e.length;s++){var r=e[s];n[r.identifier]=!0}for(var a in this.downPointers){var o=this.downPointers[a];if(this.downPointers.hasOwnProperty(a)&&!n[a]){var l=this.rebuildEvent(t,o,!1);this.upHappened(l)}}if(null!==i)for(var s=0;s<i.length;s++){var r=i[s],o=this.downPointers[r.identifier];if(o){var l=this.rebuildEvent(t,o,!1);this.upHappened(l)}}},t.prototype.rebuildEvent=function(t,e,i){var n=new b(e.x,e.y,t.timeStamp,e.identifier);return n.pageX=e.pageX,n.pageY=e.pageY,n.pressed=i,n.shiftKey=t.shiftKey,n.altKey=t.altKey,n.ctrlKey=t.ctrlKey,n},t.prototype.buildTouchEvent=function(t,e,i,n){var s=u.convertPointFromPageToNode(this.container,e.pageX,e.pageY,e.clientX,e.clientY),r=s.x,a=s.y,o=new b(Math.round(r*this.scaleX),Math.round(a*this.scaleY),t.timeStamp,""+e.identifier);return o.target=e.target||t.target||t.srcElement,o.pageX=e.pageX,o.pageY=e.pageY,o.shiftKey=t.shiftKey,o.altKey=t.altKey,o.ctrlKey=t.ctrlKey,o.pressed=i,o.changedPointerCount=n,o.touch=!0,o},t.prototype.buildEvent=function(t,e,i,n,s){void 0===s&&(s=1);var r,a,o=t.pageX,l=t.pageY,h=(!t.currentTarget||t.currentTarget===this.container)&&t.target===this.container;if(h&&void 0!==t.offsetX)r=t.offsetX,a=t.offsetY;else if(h&&void 0!==t.layerX)r=t.layerX,a=t.layerY;else{var c=u.convertPointFromPageToNode(this.container,o,l,t.clientX,t.clientY);r=c.x,a=c.y}var d=new b(Math.round(r*this.scaleX),Math.round(a*this.scaleY),i,""+e);return d.target=t.target||t.srcElement,d.pageX=o,d.pageY=l,d.shiftKey=t.shiftKey,d.altKey=t.altKey,d.ctrlKey=t.ctrlKey,d.pressed=n,d.changedPointerCount=s,d.touch="touch"===t.pointerType||2===t.pointerType,t.which?d.isRightMB=3===t.which:d.isRightMB=2===t.button,d},t.prototype.downHappened=function(e){if(e.pressed=!0,this.fireEvent(t.EVENT_GLOBAL_DOWN,e),this.isTargetOkay(e.target)&&!this.downPointers[e.identifier]){this.click_Hold();var i=new C(e,this.settings);this.downPointers[e.identifier]=i,i.touch=e.touch,this.inPointers[e.identifier]=!0,this.fireEvent(t.EVENT_DOWN,e),this.startLongPress(e)}},t.prototype.upHappened=function(e){var i=this.downPointers[e.identifier];if(i){this.cancelLongPress(),i.moveTo(e),i.getPosAndSpeed(e),delete this.downPointers[e.identifier];var n=e.vx,s=e.vy,r=Math.abs(n),a=Math.abs(s);r>2*a?(e.swipeSpeed=r,n>0?e.swipeLeft=!0:e.swipeRight=!0):a>2*r&&(e.swipeSpeed=a,s<0?e.swipeUp=!0:e.swipeDown=!0),this.fireEvent(t.EVENT_UP,e),!i.noClick&&e.isWithinDistance(i,this.settings.clickSensitivity,this.settings.doubleClickTimeout)&&this.click_Next(e)}},t.prototype.cancelHappened=function(e){this.downPointers[e.identifier]&&(this.cancelLongPress(),delete this.downPointers[e.identifier],this.fireEvent(t.EVENT_CANCEL,e))},t.prototype.moveHappened=function(e){var i=this.downPointers[e.identifier];e.pressed=void 0!==i&&null!==i,void 0!==i&&null!==i?(this.cancelLongPress(e),i.scrolling=!0,i.moveTo(e),i.getPosAndSpeed(e),this.fireEvent(t.EVENT_DRAG,e),this.click_Cancel(e)):this.click_OnMove(e)||(this.isTargetOkay(e.target)?(this.inPointers[e.identifier]=!0,this.fireEvent(t.EVENT_MOVE,e)):this.pointerLeave(e))},t.prototype.wheelHappened=function(e){this.fireEvent(t.EVENT_WHEEL,e)},t.prototype.pointerLeave=function(e){this.inPointers.hasOwnProperty(e.identifier)&&(this.click_Cancel(e)||this.fireEvent(t.EVENT_LEAVE,e),delete this.inPointers[e.identifier])},t.prototype.click_Next=function(e){var i=this;if(e.isRightMB)return void this.fireEvent(t.EVENT_RCLICK,e);this.settings.scrollIntoView&&this.container.scrollIntoView();
  28. var n;switch(this.clickCounter){case 1:n=t.EVENT_CLICK;break;case 2:n=t.EVENT_DBLCLICK;break;default:case 3:n=t.EVENT_TPLCLICK}var s=null!==this.clickEvent&&this.clickEvent.timeStamp+this.settings.doubleClickTimeout>=e.timeStamp&&this.clickEvent.distance(e)<this.settings.doubleClickSensitivity;s&&clearTimeout(this.doubleClickTimeout),(s||1===this.clickCounter)&&(this.settings.noClickOnDoubleClick&&(this.doubleClickTimeout=setTimeout(function(){return i.fireClick(n)},this.settings.doubleClickTimeout)),this.settings.noClickOnDoubleClick||this.fireEvent(n,e),this.lastClickEvent=n),this.fireEvent(t.EVENT_INSTACLICK,e),this.clickEvent=e,this.clickCounter++,this.settings.noClickOnDoubleClick||setTimeout(function(){i.clickEvent=i.lastClickEvent=null,i.clickCounter=1},this.settings.doubleClickTimeout)},t.prototype.click_Cancel=function(t){return!(!this.clickEvent||this.clickEvent.identifier!==t.identifier)&&(this.clickEvent._leaving=!0,!0)},t.prototype.click_Hold=function(){void 0!==this.doubleClickTimeout&&null!==this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null)},t.prototype.click_OnMove=function(t){return!(!this.clickEvent||!this.settings.noClickOnDoubleClick)&&(this.clickEvent.distance(t)<this.settings.doubleClickSensitivity||(this.fireEvent(this.lastClickEvent,this.clickEvent),this.clickEvent=this.lastClickEvent=null,this.clickCounter=1,!1))},t.prototype.fireClick=function(e){this.clickEvent&&(this.fireEvent(e,this.clickEvent),this.clickEvent._leaving&&this.fireEvent(t.EVENT_LEAVE,this.clickEvent),this.clickEvent=null,this.clickCounter=1)},t.prototype.startLongPress=function(e){var i=this;if(!e.isRightMB){var n=function(){i.longPressTimeout=null,e.consumed=!1,i.downPointers[e.identifier].noClick=!0,i.fireEvent(t.EVENT_LONGPRESS,e),e.consumed||(e.touch&&i.cancelHappened(e),i.fireEvent(t.EVENT_RCLICK,e))};this.cancelLongPress(),this.longPressTimeout=setTimeout(n,this.settings.longPressTimeout),this.longPressInitiator=e}},t.prototype.cancelLongPress=function(t){if(null!==this.longPressTimeout){if(t&&t.isWithinDistance(this.longPressInitiator,this.settings.longPressSensitivity))return;clearTimeout(this.longPressTimeout),this.longPressTimeout=null}},t.prototype.fireEvent=function(t,e){this.listeners[t]&&this.listeners[t].call(this,e)},t.prototype.isTargetOkay=function(t){return this.containerList.indexOf(t)!==-1||u.isParentOf(this.container,t)},t._ignoreWindowTop=!1,t.EVENT_MOVE="move",t.EVENT_DOWN="down",t.EVENT_GLOBAL_DOWN="gdown",t.EVENT_DRAG="drag",t.EVENT_CANCEL="cancel",t.EVENT_UP="up",t.EVENT_LEAVE="leave",t.EVENT_CLICK="click",t.EVENT_RCLICK="rclick",t.EVENT_DBLCLICK="dblclick",t.EVENT_INSTACLICK="instaclick",t.EVENT_LONGPRESS="longpress",t.EVENT_TPLCLICK="tplclick",t.EVENT_WHEEL="mwheel",t.EVENT_KEY="key",t}();s.MouseEvents=x;var w=function(){function t(){this.timeStamp=0,this.dtime=0,this.animating=!1,this.isExport=!1,this.context=null,this.scaleX=1,this.scaleY=1,this.labelRenderer=null,this.changes={}}return t}();s.UpdateEvent=w;var L=function(){function t(){this.keyCode=null,this.capture=!1,this.consumed=!1,this.noDefault=!1,this.cursor=null,this.target=null}return t}();s.KeyEvent=L;var A=function(){function t(){this.animationOrder=0,this.updateOrder=0,this.paintOrder=0}return t.prototype.remove=function(){},t.prototype.onSceneChange=function(t){},t.prototype.getPanels=function(t){return[]},t.prototype.doAnimations=function(t){},t.prototype.paintScene=function(t){},t.prototype.previewMouseEvent=function(t,e){this["preview"+t](e)},t.prototype.onMouseEvent=function(t,e){this["on"+t](e)},t.prototype.onClick=function(t){},t.prototype.onInstantClick=function(t){},t.prototype.onLongPress=function(t){},t.prototype.onRightClick=function(t){},t.prototype.onDoubleClick=function(t){},t.prototype.onTripleClick=function(t){},t.prototype.onPointerDown=function(t){},t.prototype.onPointerUp=function(t){},t.prototype.onPointerDrag=function(t){},t.prototype.onPointerMove=function(t){},t.prototype.onPointerOut=function(t){},t.prototype.onPointerCancel=function(t){},t.prototype.onWheel=function(t){},t.prototype.onKeyDown=function(t){},t.prototype.onGlobalPointerDown=function(t){},t.prototype.previewDoubleClick=function(t){},t.prototype.previewTripleClick=function(t){},t.prototype.previewRightClick=function(t){},t.prototype.previewClick=function(t){},t.prototype.previewInstantClick=function(t){},t.prototype.previewLongPress=function(t){},t.prototype.previewWheel=function(t){},t.prototype.previewGlobalPointerDown=function(t){},t.prototype.previewPointerDown=function(t){},t.prototype.previewPointerUp=function(t){},t.prototype.previewPointerDrag=function(t){},t.prototype.previewPointerMove=function(t){},t.prototype.previewPointerOut=function(t){},t.prototype.previewPointerCancel=function(t){},t.prototype.containsCoordinate=function(t,e){var i=this.getPanels(!1);if(!i||!i.length)return!1;for(var n=0;n<i.length;n++){var s=i[n];if(s.left<t&&s.right>t&&s.top<e&&s.bottom>e)return!0}return!1},t}();s.ChartElement=A;var T=function(){function t(t,e,i,n){this.side="top",this.align="fill",this.floating=!1,this.margin=0,this.location="outside",this.packingOrder=void 0,void 0!==t&&(this.side=t),void 0!==e&&(this.align=e),void 0!==i&&(this.margin=i),void 0!==n&&(this.packingOrder=n)}return t}();s.SettingsChartPanel=T;var M=function(){function t(){this.packingOrder=0,this.location="outside",this.side="top",this.align="fill",this.outsideEdge=!1,this.floating=!1,this.desiredWidth=0,this.desiredHeight=0,this.margin=0,this.left=0,this.top=0,this.right=0,this.bottom=0,this.visible=!1,this.enableClipping=!1,this._tempData=null}return t.prototype.pushClip=function(t){this.enableClipping&&s.Graphics.pushClip(t,this.left,this.top,this.right-this.left,this.bottom-this.top)},t.prototype.popClip=function(t){this.enableClipping&&s.Graphics.popClip(t)},t.prototype.computeSize=function(t,e,i,n){return{width:this.desiredWidth,height:this.desiredHeight}},t.prototype.placePanel=function(t,e,i,n){this.bottom=n,this.right=i,this.top=e,this.left=t},t}();s.ChartPanel=M;var k=function(){function t(t){this.framesCount=0,this.shell=t,this.measureFpsIters=0,this.measureFpsT0=0,this.measureFpsIter=0,this.measureFpsCallback=null}return t.prototype.hasPendingRequests=function(){return this.shell.chart.hasPendingRequests()},t.prototype.measureFps=function(t,e){var i=this;this.measureFpsCallback=e,this.measureFpsIters=t;var n=this.shell.settings.advanced.useAnimationFrame;if(n){this.shell.chart.updateSettings({advanced:{useAnimationFrame:!1}});var s=this.measureFpsCallback;this.measureFpsCallback=function(t,e,n){i.shell.chart.updateSettings({advanced:{useAnimationFrame:!0}}),s&&s.call(window,t,e,n)}}return this.measureFpsIter=0,this.measureFpsT0=(new Date).getTime(),this.shell.events.notifySceneChanges({requestPaint:!0}),!0},t.prototype.paintDone=function(){if(this.framesCount+=1,this.measureFpsIters){this.measureFpsIter+=1;var t=(new Date).getTime()-this.measureFpsT0;if(this.measureFpsIter>=this.measureFpsIters&&t>4e3||t>1e4&&this.measureFpsIter>=5){var e=1e3*this.measureFpsIter/Math.max(1e-4,t);this.measureFpsCallback(e,this.measureFpsIter,t),this.measureFpsCallback=null,this.measureFpsIters=0}else this.shell.events.notifySceneChanges({requestPaint:!0})}},t}();s.Profiler=k;var P=function(){function t(){this.subchart=null,this.element=null}return t}(),I=function(){function t(t,e){this.sceneChanges={},this.forceFloating=!1,this._paintSuspended=0,this.pointerState={},this.animationOrder=[],this.updateOrder=[],this.paintOrder=[],this.subcharts=[],this._lastPanelCount=[0,0,0],this.chartBounds=new gt(0,0,1,1),this.chartOuterBounds=new gt(0,0,1,1),this.chartBoundsIsOuter=!0,this.chart=t,this.shell=e,this.scene=t.scene}return t.panelSortCallback=function(t,e){return t.packingOrder-e.packingOrder},t.prototype.addElement=function(t){if(!t)throw new Error("`element` must be defined.");return this.paintOrder.push(t),this.updateOrder.push(t),this.animationOrder.push(t),this.refreshElementOrder(),t},t.prototype.refreshElementOrder=function(){this.animationOrder.sort(function(t,e){return t.animationOrder-e.animationOrder}),this.paintOrder.sort(function(t,e){return t.paintOrder-e.paintOrder}),this.updateOrder.sort(function(t,e){return t.updateOrder-e.updateOrder})},t.prototype.removeElement=function(t){u.removeFromArray(this.paintOrder,t),u.removeFromArray(this.animationOrder,t),u.removeFromArray(this.updateOrder,t)},t.prototype.addSubchart=function(t){this.subcharts.push(t)},t.prototype.removeSubchart=function(t){u.removeFromArray(this.subcharts,t);for(var e in this.pointerState){var i=this.pointerState[e];i.subchart===t&&(i.subchart=null)}},t.prototype.suspendPaint=function(){this._paintSuspended++},t.prototype.resumePaint=function(){this._paintSuspended--,this._paintSuspended<=0&&(this._paintSuspended=0,this.requestPaint())},t.prototype.notifySceneChanges=function(t){if(u.hasProperties(t)){var e=t.settingsChanges;void 0!==e&&e instanceof s.Settings?(this.sceneChanges.settingsChanges=u.extendCopy(this.sceneChanges.settingsChanges||{},e,function(t,e){return"_"===t[0]||e}),delete t.settingsChanges,u.extendDeep(this.sceneChanges,t),t.settingsChanges=e):u.extendDeep(this.sceneChanges,t),this.requestPaint()}},t.prototype.requestPaint=function(){this._paintSuspended<=0&&this.shell.requestPaint()},t.prototype.paintNow=function(t){void 0===t&&(t=!1),this.shell.paintNow(t=!1)},t.prototype.clearSceneChanges=function(t){for(var e in t)delete this.sceneChanges[e]},t.prototype.onMouseEvent=function(t,e){var i=e.name;t.changes={},t.capture=!1;var n,s,r=null,a=null,o=void 0,l=t.identifier,h=this.pointerState[l];h||(h=new P,h.identifier=l,this.pointerState[l]=h);for(var u=0;u<this.updateOrder.length;u++)s=this.updateOrder[u],s.previewMouseEvent(i,t);if(h.subchart){var c=h.subchart.events;c.onMouseEvent(t,e),t.consumed||t.hovered||t.capture?(a=h.subchart,t.capture=!0,o=t.cursor):c.onMouseEvent(t,{ev:x.EVENT_LEAVE,name:"PointerOut"})}if(n=s=h.element,s&&(s.onMouseEvent(i,t),(t.consumed||t.capture||e.captures&&e.needsCapture)&&!e.releasesCapture&&(r=s,t.capture=!0,o=t.cursor)),!t.capture&&!e.needsCapture)for(var d=this.subcharts.length-1;d>=0;d-=1){var p=this.subcharts[d],c=p.events;if(c.chartOuterBounds.containsPoint(t.x,t.y)){if(c.onMouseEvent(t,e),t.consumed||t.hovered||t.capture){a=p,t.capture=!0;break}c.onMouseEvent(t,{ev:x.EVENT_LEAVE,name:"PointerOut"})}}if(!t.capture&&!e.needsCapture)for(var u=0;u<this.updateOrder.length;u++)if(s=this.updateOrder[u],s!==n&&(s.onMouseEvent(i,t),t.consumed||t.capture)){o=t.cursor,r=s,t.capture=!0;break}void 0!==o&&(t.cursor=o),(e.releasesCapture||e.captures)&&(h.element=e.captures?r:null,h.subchart=e.captures?a:null),this.notifySceneChanges(t.changes)},t.prototype.setNewSize=function(t,e,i){!i&&this.chartBounds.equals(t)&&e===this.chartBoundsIsOuter||(this.chartBounds=t.clone(),this.chartBoundsIsOuter=e,this.notifySceneChanges({bounds:!0}))},t.prototype.updateLayout=function(e){for(var i=this.scene,n=new Array(this._lastPanelCount[0]),s=new Array(this._lastPanelCount[1]),r=new Array(this._lastPanelCount[2]),a=0,o=0,l=0,h=0;h<this.paintOrder.length;h++)for(var c=this.paintOrder[h],d=c.getPanels(e.isExport),p=0;p<d.length;p++){var f=d[p],g=f.location;"external"===g?r[l++]=f:"outside"===g?s[o++]=f:"inside"===g&&(n[a++]=f)}this._lastPanelCount=[a,o,l],n.length=a,s.length=o,r.length=l,u.sort(n,t.panelSortCallback),u.sort(s,t.panelSortCallback),u.sort(r,t.panelSortCallback);var m,v,y;if(this.chartBoundsIsOuter){m=this.chartBounds.clone();for(var S=0;S<l;S++)this._placePanel(r[S],m,!0,e);v=this.chartBounds.clone(),y=this.chartBounds.clone();for(var S=0;S<o;S++)this._placePanel(s[S],y,!1,e)}else{y=this.chartBounds.clone(),v=this.chartBounds.clone();for(var S=0;S<o;S++)this._placePanel(s[S],v,!0,e);m=v.clone();for(var S=0;S<l;S++)this._placePanel(r[S],m,!0,e)}this.chartOuterBounds=v,i.chartLeft=v.x0,i.chartTop=v.y0,i.chartHeight=v.h(),i.chartWidth=v.w();for(var S=0;S<l;S++)this._placePanelFinal(r[S],y);for(var S=0;S<o;S++){var f=s[S];this._placePanelFinal(f,f.outsideEdge?v:y)}i.x0===y.x0&&i.y0===y.y0&&i.width===y.w()&&i.height===y.h()||this.chart.events.notifySceneChanges({bounds:!0}),i.x0=y.x0,i.y0=y.y0,i.width=y.w(),i.height=y.h(),i.leftMargin=y.x0-v.x0,i.rightMargin=v.x1-y.x1,i.topMargin=y.y0-v.y0,i.bottomMargin=v.y1-y.y1;for(var S=0;S<a;S++){var f=n[S];this._placePanel(f,y,!1,e),this._placePanelFinal(f,y)}return m},t.prototype._placePanel=function(t,e,i,n){var s=e.x0,r=e.y0,a=e.x1,o=e.y1,l=t.margin||0,h=t.computeSize(e.x1-e.x0,e.y1-e.y0,n.context,n.labelRenderer),u=h.width||0,c=h.height||0;u+=2*l,c+=2*l,i?"top"===t.side?(o=r,r=o-c,t.floating||this.forceFloating||(e.y0=r)):"bottom"===t.side?(r=o,o=r+c,t.floating||this.forceFloating||(e.y1=o)):"left"===t.side?(a=s,s=a-u,t.floating||this.forceFloating||(e.x0=s)):"right"===t.side&&(s=a,a=s+u,t.floating||this.forceFloating||(e.x1=a)):"top"===t.side?(o=Math.min(o,r+c),t.floating||this.forceFloating||(e.y0=o)):"bottom"===t.side?(r=Math.max(r,o-c),t.floating||this.forceFloating||(e.y1=r)):"left"===t.side?(a=Math.min(a,s+u),t.floating||this.forceFloating||(e.x0=a)):"right"===t.side&&(s=Math.max(s,a-u),t.floating||this.forceFloating||(e.x1=s)),t._tempData={left:s,right:a,top:r,bottom:o,desiredWidth:u,desiredHeight:c}},t.prototype._placePanelFinal=function(t,e){var i=t._tempData.left,n=t._tempData.right,s=t._tempData.top,r=t._tempData.bottom,a=t._tempData.desiredWidth,o=t._tempData.desiredHeight;if("outside"===t.location&&("top"===t.side||"bottom"===t.side?(i=Math.max(i,e.x0),n=Math.min(n,e.x1)):(s=Math.max(s,e.y0),r=Math.min(r,e.y1))),"left"===t.align)n=Math.min(n,i+a);else if("right"===t.align)i=Math.max(i,n-a);else if("top"===t.align)r=Math.min(r,s+o);else if("bottom"===t.align)s=Math.max(s,r-o);else if("center"===t.align){var l=Math.max(0,n-i-a)/2,h=Math.max(0,r-s-o)/2;i+=l,n-=l,s+=h,r-=h}var u=t.margin;t.placePanel(i+u,s+u,n-u,r-u)},t.prototype.animateFrame=function(t){this.shell.prepareContext(t),t.changes=this.sceneChanges,this.sceneChanges={};for(var e=0;e<this.updateOrder.length;e++){var i=this.updateOrder[e];i.onSceneChange(t)}t.changes.bounds&&this.updateLayout(t);for(var n=0;n<this.animationOrder.length;n++){var s=this.animationOrder[n];s.doAnimations(t)}for(var r=0;r<this.paintOrder.length;r++){var a=this.paintOrder[r];a.paintScene(t)}t.changes.position&&this.chart.notifyPositionChange(this.chart.createEventArguments(null,"api")),t.changes=null;var o=[];for(var l in this.pointerState){var h=this.pointerState[l];h.subchart&&o.push(h.subchart)}for(var u=0;u<this.subcharts.length;u+=1){var c=this.subcharts[u];if(!(o.indexOf(c)>-1)){var d=c.events;(d.sceneChanges.bounds||d.chartOuterBounds.overlaps(this.chartOuterBounds))&&d.animateFrame(t)}}for(var u=0;u<o.length;u+=1){var c=o[u];c.events.animateFrame(t)}this.shell.finalizeContext(t)},t.prototype.doPaint=function(t){for(var e=0;e<this.paintOrder.length;e++){var i=this.paintOrder[e];i.paintScene(t)}for(var n=0;n<this.subcharts.length;n+=1){var s=this.subcharts[n],r=s.events;r.chartOuterBounds.overlaps(this.chartOuterBounds)&&r.doPaint(t)}},t}();s.ChartEvents=I;var D=function(){function t(){this.enabled=!1,this.enabledOnExport=!1,this.url="http://zoomcharts.com",this.urlTarget="_blank",this.image="builtin://logo-supported-by",this.imageScaling=.5,this.location="outside",this.imageExport=null}return t}();s.SettingsCredits=D;var F=function(t){function e(e,i){var n=this;t.call(this),this.animationOrder=2e3,this.paintOrder=60,this.updateOrder=400,this.settings=i,this.chart=e,this.scene=e.scene,(i.enabledOnExport||i.enabled)&&(this.chart.assetsLoader.getAssetImage(this.settings.image,function(t){return n.imageLoaded(t)}),this.settings.imageExport&&this.settings.image!==this.settings.imageExport&&this.chart.assetsLoader.getAssetImage(this.settings.imageExport,function(t){return n.imageLoaded(t)}));var s=this.panel=new M;s.packingOrder=0,s.side="bottom",s.align="right",s.visible=!1,s.margin=3}return n(e,t),e.prototype.onSceneChange=function(t){var e=t.changes;e.settings&&e.settingsChanges.credits&&(e.bounds=!0)},e.prototype.getPanels=function(t){var e=this,i=this.settings,n=t?i.enabledOnExport:i.enabled,s=this.panel;if(n){s.location="outside",s.outsideEdge=!0,"outside"===i.location?(s.floating=!1,t&&!i.enabled&&(s.location="external")):s.floating=!0;var r=this.chart.assetsLoader.getAssetImage(i.image,function(t){return e.imageLoaded(t)});if(r)return s.desiredWidth=r.width*i.imageScaling,s.desiredHeight=r.height*i.imageScaling,s.visible=!0,[s]}return s.visible=!1,[]},e.prototype.paintScene=function(t){var e=this,i=this.panel;if(i.visible){var n=this.chart.assetsLoader.getAssetImage(this.settings.image,function(t){return e.imageLoaded(t)}),s=this.settings.imageExport?this.chart.assetsLoader.getAssetImage(this.settings.imageExport,function(t){return e.imageLoaded(t)}):n;t.isExport&&(n=s),n?t.context.drawImage(n,0,0,n.width,n.height,i.left,i.top,i.right-i.left,i.bottom-i.top):t.animating=!0}},e.prototype.onPointerMove=function(t){var e=t.x,i=t.y,n=this.panel;n.visible&&e>=n.left&&i>=n.top&&e<=n.right&&i<=n.bottom&&this.settings.url&&(t.cursor="pointer")},e.prototype.onClick=function(t){var e=t.x,i=t.y,n=this.panel,s=this.settings;n.visible&&e>=n.left&&i>=n.top&&e<=n.right&&i<=n.bottom&&s.url&&(u.openUrl(s.url,s.urlTarget),t.consumed=!0)},e.prototype.imageLoaded=function(t){this.chart.updateSize(!0),this.chart.events.notifySceneChanges({settings:!0,settingsChanges:{credits:!0}})},e}(A);s.Credits=F;var N=function(){function t(){}return t.isLight=function(t){return null==t?null:.299*t.R+.587*t.G+.114*t.B>128},t.format=function(t){return null==t?null:"rgba("+(0|t.R)+","+(0|t.G)+","+(0|t.B)+","+t.A.toFixed(3)+")"},t.areEqual=function(t,e){return null==t?null==e:null!=e&&(t.R===e.R&&t.G===e.G&&t.B===e.B&&t.A===e.A)},t.parse=function(t){var e=E.parseCSSColor(t);return null==e&&t&&u.warn("Color value '"+t+"' could not be parsed.",null,!0),e},t.normalize=function(t){return this.format(E.parseCSSColor(t))},t.derive=function(t,e,i){var n="string"==typeof t,s=n?this.parse(t):t,r=255*(e-1),a={R:Math.round(Math.min(255,Math.max(0,s.R+r))),G:Math.round(Math.min(255,Math.max(0,s.G+r))),B:Math.round(Math.min(255,Math.max(0,s.B+r))),A:Math.min(1,s.A*i)};return n?this.format(a):a},t.blend=function(t,e,i,n){void 0===n&&(n=!0);var s,r="string"==typeof t,a=r?this.parse(t):t,o=r?this.parse(e):e;if(n){var l=1-i;s={R:Math.round(o.R*i+a.R*l),G:Math.round(o.G*i+a.G*l),B:Math.round(o.B*i+a.B*l),A:o.A*i+a.A*l}}else s=this._blendSlow(a,o,i);return r?this.format(s):s},t._blendSlow=function(t,e,i){var n=this._rgb2lab(t),s=this._rgb2lab(e),r=1-i,a=Math.round(s.L*i+n.L*r),o=Math.round(s.A*i+n.A*r),l=Math.round(s.B*i+n.B*r),h=this._lab2rgb(a,o,l);return h.R=Math.max(0,Math.min(255,h.R)),h.G=Math.max(0,Math.min(255,h.G)),h.B=Math.max(0,Math.min(255,h.B)),h.A=e.A*i+t.A*r,h},t.colorTone=function(t,e,i){var n=this.parse(t),s=this.derive(n,e,i);return{color:this.format(s),opacity:n.A}},t.copyHue=function(t,e){var i="string"==typeof t,n=i?this.parse(t):t,s=i?this.parse(e):e,r=(n.R+n.G+n.B)/765,a=(s.R+s.G+s.B)/765,o={R:Math.round(n.R/r*a),G:Math.round(n.G/r*a),B:Math.round(n.B/r*a),A:s.A};return i?this.format(o):o},t.inverse=function(t){var e="string"==typeof t,i=e?this.parse(t):t,n={R:255-i.R,G:255-i.G,B:255-i.B,A:i.A};return e?this.format(n):n},t._rgb2xyz=function(t){var e=t.R/255,i=t.G/255,n=t.B/255;return e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,{X:.4124*e+.3576*i+.1805*n,Y:.2126*e+.7152*i+.0722*n,Z:.0193*e+.1192*i+.9505*n}},t._rgb2lab=function(t){if(t._lab)return t._lab;var e=this._rgb2xyz(t),i=e.X/.95047,n=e.Y,s=e.Z/1.08883;return i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,t._lab={L:116*n-16,A:500*(i-n),B:200*(n-s)}},t._xyz2rgb=function(t,e,i){var n=3.2406*t+e*-1.5372+i*-.4986,s=t*-.9689+1.8758*e+.0415*i,r=.0557*t+e*-.204+1.057*i;return n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:12.92*s,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,{R:Math.round(255*n),G:Math.round(255*s),B:Math.round(255*r),A:1}},t._lab2rgb=function(t,e,i){var n=(t+16)/116,s=e/500+n,r=n-i/200;n=n>this._lab2rgbConst?Math.pow(n,3):(n-16/116)/7.787,s=s>this._lab2rgbConst?Math.pow(s,3):(s-16/116)/7.787,r=r>this._lab2rgbConst?Math.pow(r,3):(r-16/116)/7.787;var a=this._xyz2rgb(.95047*s,n,1.08883*r);return a._lab={L:t,A:e,B:i},a},t._lab2rgbConst=Math.pow(.008856,1/3),t}();s.Colors=N;var E=function(){function t(){}return t.clamp_css_byte=function(t){return t=Math.round(t),t<0?0:t>255?255:t},t.clamp_css_float=function(t){return t<0?0:t>1?1:t},t.parse_css_int=function(e){return"%"===e[e.length-1]?t.clamp_css_byte(parseFloat(e)/100*255):t.clamp_css_byte(parseInt(e,10))},t.parse_css_float=function(e){return"%"===e[e.length-1]?t.clamp_css_float(parseFloat(e)/100):t.clamp_css_float(parseFloat(e))},t.css_hue_to_rgb=function(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t},t.parseCSSColor=function(e){if(null==e)return{R:0,G:0,B:0,A:0};var i=e.replace(RegExp(" ","g"),"").toLowerCase();if(i in t.kCSSColorTable){var n=t.kCSSColorTable[i];return{R:n[0],G:n[1],B:n[2],A:n[3]}}if("#"===i[0]){if(4===i.length){var s=parseInt(i.substr(1),16);return s>=0&&s<=4095?{R:(3840&s)>>4|(3840&s)>>8,G:240&s|(240&s)>>4,B:15&s|(15&s)<<4,A:1}:null}if(7===i.length){var s=parseInt(i.substr(1),16);return s>=0&&s<=16777215?{R:(16711680&s)>>16,G:(65280&s)>>8,B:255&s,A:1}:null}return null}var r=i.indexOf("("),a=i.indexOf(")");if(r!==-1&&a+1===i.length){var o=i.substr(0,r),l=i.substr(r+1,a-(r+1)).split(","),h=1;if("rgba"===o){if(4!==l.length)return null;h=t.parse_css_float(l.pop())}if("rgba"===o||"rgb"===o)return 3!==l.length?null:{R:t.parse_css_int(l[0]),G:t.parse_css_int(l[1]),B:t.parse_css_int(l[2]),A:h};if("hsla"===o){if(4!==l.length)return null;h=t.parse_css_float(l.pop())}if("hsla"===o||"hsl"===o){if(3!==l.length)return null;var u=(parseFloat(l[0])%360+360)%360/360,c=t.parse_css_float(l[1]),d=t.parse_css_float(l[2]),p=d<=.5?d*(c+1):d+c-d*c,f=2*d-p;return{R:t.clamp_css_byte(255*t.css_hue_to_rgb(f,p,u+1/3)),G:t.clamp_css_byte(255*t.css_hue_to_rgb(f,p,u)),B:t.clamp_css_byte(255*t.css_hue_to_rgb(f,p,u-1/3)),A:h}}}return null},t.kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},t}(),z=function(){function t(t,e,i){this.isFilling=i,this.lineDash=e,this.g=t,this.beginPath()}return t.prototype.beginPath=function(){this.remaining=this.lineDash[0],this.dashes=[],this.pos=0,this.x0=0,this.y0=0,this.x=0,this.y=0,this.hasPos=!1},t.prototype.moveTo=function(t,e){this.y=e,this.x=t,this.isFilling&&this.dashes.push(0,t,e),this.g.moveTo(t,e),this.x0=t,this.y0=e,this.hasPos=!0},t.prototype.rect=function(t,e,i,n){this.moveTo(t,e),this.lineTo(t+i,n),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e)},t.prototype.lineTo=function(t,e){this.isFilling&&this.g.lineTo(t,e);var i=t-this.x,n=e-this.y,s=this.x,r=this.y;this.x=t,this.y=e;var a=Math.sqrt(i*i+n*n),o=1/a;i*=o,n*=o;for(var l=this.lineDash.length,h=this.pos,u=this.remaining;;){var c=Math.min(a,u);if(s+=i*c,r+=n*c,h%2===0?this.isFilling?this.dashes.push(1,s,r):this.g.lineTo(s,r):this.isFilling?this.dashes.push(0,s,r):this.g.moveTo(s,r),!(a>c)){u-=c;break}h=(h+1)%l,u=this.lineDash[h],a-=c}this.pos=h,this.remaining=u,this.hasPos=!0},t.prototype.arc=function(t,e,i,n,s,r){var a=2*Math.PI,o=Math.min(.6,2/i),l=Math.cos(o),h=Math.sin(o),u=Math.sin(n)*i,c=Math.cos(n)*i,d=Math.sin(s)*i,p=Math.cos(s)*i;if(this.hasPos||(this.moveTo(t+c,e+u),this.hasPos=!0),r){n<s&&(n+=a);for(var f=(n-s)/o,g=f;g>=0;g--){if(g-1<=0){this.lineTo(t+p,e+d);break}this.lineTo(t+c,e+u);var m=c*l+u*h,v=-c*h+u*l;c=m,u=v}}else{n>s&&(n-=2*Math.PI);for(var f=(s-n)/o,g=f;g>=0;g--){if(g-1<=0){this.lineTo(t+p,e+d);break}this.lineTo(t+c,e+u);var m=c*l-u*h,v=c*h+u*l;c=m,u=v}}},t.prototype.quadraticCurveTo=function(t,e,i,n){this.lineTo(t,e),this.lineTo(i,n)},t.prototype.bezierCurveTo=function(t,e,i,n,s,r){throw new Error("Bezier curves in dashed line context haven't been implemented yet")},t.prototype.closePath=function(){this.lineTo(this.x0,this.y0)},t.prototype.strokeDashes=function(){for(var t=this.dashes,e=0;e<t.length;e+=3){var i=t[e],n=t[e+1],s=t[e+2];0===i?this.g.moveTo(n,s):this.g.lineTo(n,s)}},t}();s.GraphicsDashedLineContext=z;var O=function(){function t(){}return t.stroke=function(t,e){0!==e.lineWidth&&e.lineColor&&(t.lineWidth=e.lineWidth||1,t.strokeStyle=e.lineColor,e.lineDash&&"undefined"!=typeof t.setLineDash?(t.setLineDash(e.lineDash),t.stroke(),t.setLineDash([])):t.stroke(),e.lineWidth&&(t.lineWidth=1))},t.strokeWithShadow=function(t,e){0!==e.lineWidth&&e.lineColor&&!e.shadowColor&&(e.shadowColor&&(t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor),t.lineWidth=e.lineWidth||1,t.strokeStyle=e.lineColor,t.stroke(),e.lineWidth&&(t.lineWidth=1),e.shadowColor&&(t.shadowBlur=0,t.shadowColor="transparent"))},t.beginStroke=function(t,e,i){return void 0===i&&(i=!1),t.beginPath(),e.lineColor&&e.lineDash&&e.lineDash.length>1&&"undefined"==typeof t.setLineDash?(i&&!e.fillColor&&(i=!1),new z(t,e.lineDash,i)):t},t.endStroke=function(e,i,n,s){void 0===s&&(s=!1),i instanceof z?(i.isFilling&&(t.fill(e,n),e.beginPath(),i.strokeDashes()),t.strokeWithShadow(e,n)):s?t.paint(e,n):t.stroke(e,n)},t.beginStrokeAndFill=function(e,i){return t.beginStroke(e,i,!0)},t.endStrokeAndFill=function(e,i,n){return t.endStroke(e,i,n,!0)},t.fill=function(t,e){e.fillColor&&(t.fillStyle=e.fillColor,e.shadowColor&&(t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor),t.fill(),e.shadowColor&&(t.shadowBlur=0,t.shadowColor="transparent"))},t.paint=function(t,e){e.shadowColor&&(t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor),e.fillColor&&(t.fillStyle=e.fillColor,t.fill()),0!==e.lineWidth&&e.lineColor&&(t.lineWidth=e.lineWidth||1,t.strokeStyle=e.lineColor,e.lineDash&&"undefined"!=typeof t.setLineDash?(t.setLineDash(e.lineDash),t.stroke(),t.setLineDash([])):t.stroke()),e.shadowColor&&(t.shadowBlur=0,t.shadowColor="transparent")},t.textStyle=function(t,e){t.__textStyle&&this.resetTextStyle(t);var i=e.fillColor;void 0===i&&(i="#000"),t.fillStyle=i,t.__font=t.font=e.font||null,e.shadowColor&&(t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor),e.outlineColor&&(t.strokeStyle=e.outlineColor,t.lineWidth=2*(e.outlineWidth||1),t.lineJoin=e.outlineJoin||"miter",t.miterLimit=2),t.__textStyle=e},t.getTextWidth=function(t,e,i){if(e){var n=e.font;t.__font!==n&&(t.__textStyle=null,t.__font=t.font=n||null)}var s=t.measureText(i).width;return e.outlineColor&&(s+=2*(e.outlineWidth||1)),s},t.drawText=function(t,e,i,n,s){t.__textStyle!==e&&this.textStyle(t,e),null!=i&&i.length&&(e.outlineColor&&t.strokeText(i,n,s),t.fillText(i,n,s))},t.resetTextStyle=function(t){t.__font=null;var e=t.__textStyle;e&&(e.shadowColor&&(t.shadowColor="transparent",t.shadowBlur=0),e.outlineColor&&(t.lineJoin="miter",t.miterLimit=10,t.lineWidth=1),t.__textStyle=null)},t.restore=function(t){this.resetTextStyle(t),t.restore()},t.rectStyle=function(t,e){void 0!==e.lineColor&&(t.strokeStyle=e.lineColor),void 0!==e.fillColor&&(t.fillStyle=e.fillColor),void 0!==e.lineWidth&&(t.lineWidth=e.lineWidth)},t.pushClip=function(t,e,i,n,s){var r=t.context,a=t.scaleX,o=t.scaleY;1===a&&1===o||!window.screen.deviceXDPI?(r.save(),r.beginPath(),r.rect(e,i,n,s),r.clip()):(r.save(),r.setTransform(1,0,0,1,0,0),r.beginPath(),r.rect(e*a|0,i*o|0,n*a|0,s*o|0),r.clip(),r.setTransform(a,0,0,o,0,0))},t.popClip=function(t){this.restore(t.context)},t.arcBetweenTwoPoints=function(t,e,i,n,s,r,a,o){var l=(s+a)/2,h=(r+o)/2,u=o-r,c=s-a,d=u*u+c*c;if(0!==d){var p=Math.sqrt(d);n=Math.min(Math.max(n,p/2),3*p);var f=Math.sqrt(n*n/d-.25),g=l+u*f,m=h+c*f,v=l-u*f,y=h-c*f,S=(g-e)*(g-e)+(m-i)*(m-i),b=(v-e)*(v-e)+(y-i)*(y-i);S>b?(e=v,i=y):(e=g,i=m);var C=Math.atan2(r-i,s-e),x=Math.atan2(o-i,a-e);x<C&&(x+=2*Math.PI);var w=Math.abs(C-x)>Math.PI;t.arc(e,i,n,C,x,w)}},t.strokeMarker=function(e,i,n,s,r){var a=1.41421356237*r;switch(i){case"rect":
  29. case"square":e.moveTo(n-r,s-r),e.lineTo(n+r,s-r),e.lineTo(n+r,s+r),e.lineTo(n-r,s+r),e.lineTo(n-r,s-r);break;case"romb":case"rhombus":a=.9*a,e.moveTo(n-a,s),e.lineTo(n,s-a),e.lineTo(n+a,s),e.lineTo(n,s+a),e.lineTo(n-a,s);break;case"triangle":var o=t.SQRT3D6*(3*r);e.moveTo(n-r,s+o),e.lineTo(n+r,s+o),e.lineTo(n,s-o),e.lineTo(n-r,s+o);break;case"triangle2":e.moveTo(n-a,s-a),e.lineTo(n+a,s-a),e.lineTo(n,s+a),e.lineTo(n-a,s-a);break;case"circle":e.moveTo(n+r,s),e.arc(n,s,r,0,2*Math.PI,!1);break;default:throw new Error("Unknown marker shape "+i+". Valid values are `square`, `rhombus`, `triangle`, `triangle2`, `circle`.")}},t.strokeBalloon=function(t,e,i,n,s){n=Math.max(n,2*s);var r=5,a=4,o=(s+2*a)/2,l=e,h=i;t.moveTo(l,h),l+=3,h+=r+1,t.lineTo(l,h),l+=n-a,t.lineTo(l,h),t.arc(l,h+o,o,-Math.PI/2,Math.PI/2),h+=2*o,l-=n-a,t.lineTo(l,h),t.arc(l,h-o,o,.5*Math.PI,1.3*Math.PI),t.closePath()},t.strokeBalloon2=function(t,e,i,n,s){var r=4,a=(s+2*r)/2;n=Math.max(n,2*s)/2-r;var o=e+n,l=i-a;t.moveTo(o,l),t.arc(o,l+a,a,-Math.PI/2,Math.PI/2,!1),l+=2*a,o-=2*n,t.lineTo(o,l),t.arc(o,l-a,a,.5*Math.PI,1.5*Math.PI,!1),t.closePath()},t.applyColorToImage=function(t,e,i){void 0===i&&(i=!0);var n=N.parse(e),s=n.R,r=n.G,a=n.B,o=document.createElement("canvas"),l=o.width=t.width,h=o.height=t.height,u=o.getContext("2d");u.drawImage(t,0,0);var c=u.getImageData(0,0,l,h),d=c.data;if(i)for(var p=0;p<=d.length;p+=4)255===d[p+3]&&(d[p]=d[p]*s>>8,d[p+1]=d[p+1]*r>>8,d[p+2]=d[p+2]*a>>8);else for(var p=0;p<=d.length;p+=4)d[p]=d[p]*s>>8,d[p+1]=d[p+1]*r>>8,d[p+2]=d[p+2]*a>>8;return u.putImageData(c,0,0),o},t.cropImageToCircle=function(t,e){var i=Math.min(t.width,t.height),n=Math.max(t.width,t.height),s=Math.min(n,2*i),r=document.createElement("canvas");r.width=s,r.height=s;var a=r.getContext("2d"),o=t.width,l=t.height;a.fillStyle="rgba(0,0,0,1)",a.beginPath(),a.arc(s/2,s/2,s/2,0,2*-Math.PI,!1),a.fill();var h=a.globalCompositeOperation;if(a.globalCompositeOperation="source-in","crop"===e){var u=Math.min(o,l)/2;a.drawImage(t,o/2-u,l/2-u,2*u,2*u,0,0,s,s)}else if("letterbox"===e){a.fillStyle="black",a.fillRect(0,0,s,s);var c=s/Math.max(o,l);a.drawImage(t,0,0,o,l,s/2-o/2*c,s/2-l/2*c,o*c,l*c)}else if("fit"===e){a.fillStyle="black",a.fillRect(0,0,s,s);var c=s/Math.sqrt(o*o+l*l);a.drawImage(t,0,0,o,l,s/2-o/2*c,s/2-l/2*c,o*c,l*c)}else a.drawImage(t,0,0,o,l,0,0,s,s);return a.globalCompositeOperation=h,r},t.applyShadow=function(t,e){e.shadowColor&&(t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor)},t.clearShadow=function(t){t.shadowBlur=0,t.shadowColor="transparent"},t.drawImageInSquare=function(t,e,i,n,s,r,a,o,l){var h=l/Math.max(s,r),u=s*h,c=r*h;this.drawImageHighQuality(t,e,i,n,s,r,a-u,o-c,2*u,2*c)},t.drawImageHighQuality=function(t,e,i,n,s,r,a,o,l,h){void 0===a&&(a=i,o=n,l=s,h=r,s=e.width,r=e.height,i=0,n=0);var u=t.__scaleX||1,c=t.__scaleY||1;if(!(h<1/c||l<1/u)){for(var d=s,p=r,f=e,g=1,m="__size:"+i+"/"+n+"/"+s+"/"+r+"/";d>=l*u*2&&p>=h*c*2;){var v=Math.round(d/2),y=Math.round(p/2);g/=2;var S=m+g,b=e[S];if(!b){b=e[S]=document.createElement("canvas"),b.width=v,b.height=y;var C=b.getContext("2d");C.drawImage(f,i,n,d,p,0,0,v,y)}i=0,n=0,f=b,p=y,d=v}t.drawImage(f,i,n,0|d,0|p,a,o,l,h)}},t.getTextHeight=function(e,i){var n=t._heightCache;if(n.hasOwnProperty(i))return n[i];var r=t._heightElem;if(!r){var a=document.createElement("div");a.className="DVSL-font-height",t._heightElem=r=document.createElement("div"),r.appendChild(document.createTextNode("Mg9!")),
  30. a.appendChild(r),document.body.appendChild(a)}r.style.font=i;var o=r.getBoundingClientRect();return o.top>=0&&o.left>=0?(s.Helpers.error("getTextHeight called before CSS loaded"),o.height):n[i]=o.height},t.SQRT3D6=Math.sqrt(3)/6,t._heightElem=null,t._heightCache={},t}();s.Graphics=O;var H=function(){function t(){this.enabled=!0,this.enabledOnExport=!0,this.align="center",this.margin=25,this.style={font:"20px Arial",fillColor:"#000"},this.text=""}return t}();s.SettingsTitle=H;var _=function(t){function e(e){var i=this;t.call(this),this.lineSpacing=0,this.animationOrder=2e3,this.paintOrder=55,this.updateOrder=500,this.chart=e,this.scene=e.scene,this.settings=this.scene.settings.title,this.panel=new M,this.panel.packingOrder=10,this.panel.side="top",this.panel.outsideEdge=!0,this.panel.align="fill",this.panel.visible=!1,this.panel.computeSize=function(t,e,n){return i.computePanelSize(t,e,n)},this.lines=null}return n(e,t),e.prototype.onSceneChange=function(t){var e=t.changes;e.settings&&e.settingsChanges.title&&(e.bounds=!0)},e.prototype.getPanels=function(t){var e=this.settings;return this.panel.visible=!!e.text&&(t?e.enabledOnExport:e.enabled),this.panel.visible?(this.panel.margin=e.margin,t&&!e.enabled?this.panel.location="external":this.panel.location="outside",[this.panel]):[]},e.prototype.computePanelSize=function(t,e,i){if(!this.chart.assetsLoaded)return{width:0,height:0};this.lines=[];var n=this.settings.text,s=this.settings.style;i.save();var r=O.getTextWidth(i,s,n),a=O.getTextHeight(i,s.font);if(this.lineSpacing=1.15*a,r>t){for(var o=0,l=n.split(" "),h=l[0],u=O.getTextWidth(i,s,h),c=1;c<=l.length-1;c++){var d=h+" "+l[c],p=O.getTextWidth(i,s,d);p<=t?(h=d,u=p):(this.lines.push(h),r=Math.max(r,u),h=l[c],u=O.getTextWidth(i,s,h))}this.lines.push(h),r=Math.max(o,u)}else this.lines.push(n);return O.restore(i),a=(this.lines.length-1)*this.lineSpacing+a,{width:r,height:a}},e.prototype.paintScene=function(t){if(this.panel.visible&&this.lines){var e=this.settings,i=t.context,n=this.panel.left,s=this.panel.right,r=this.panel.top,a=e.style;i.textBaseline="top";var o;"left"===e.align?(i.textAlign="start",o=n):"right"===e.align?(i.textAlign="end",o=s):(i.textAlign="center",o=(n+s)/2);for(var l=0;l<this.lines.length;l++)O.drawText(i,a,this.lines[l],o,r),r+=this.lineSpacing;O.resetTextStyle(i)}},e}(A);s.Title=_;var R=function(){function t(t,e){void 0===e&&(e=!1),this.style={textStyle:{}},this._textOverride=void 0,this.visible=!0,this.allowCache=!0,this.shouldBeVisible=!0,this.userPlaced=!1,this.rows=null,this.lineHeight=0,this.lineHeightM=0,this.hwidth=null,this.hheight=null,this.currentBounds=null,this.x=null,this.originX=null,this.y=null,this.prop=null,this._pendingImage=!1,this._textCache=null,this._measureStyles=null,t.textStyle||(t.textStyle={}),null==t.lineSpacing&&(t.lineSpacing=.2),e?this.style=t:this.style=s.Helpers.realClone(t)}return Object.defineProperty(t.prototype,"text",{get:function(){var t=this._textOverride;return void 0===t&&(t=this.style.text,null!=t&&"string"!=typeof t&&(t=""+t)),t},set:function(t){void 0===t&&(t=null),null!=t&&"string"!=typeof t&&(t=""+t),this._textOverride=t},enumerable:!0,configurable:!0}),t.prototype.needTextParsing=function(){var t=this._textCache;return!t||t.sourceText!==this.text||t.sourceFont!==this.style.textStyle.font},t.prototype.needMeasure=function(){var t=this._measureStyles,e=t&&t.customMeasure;if(this._pendingImage)return!e||null;var i=this.style,n=i.textStyle,s=!t||t.align!==i.align||t.text!==this.text||t.aspectRatio!==i.aspectRatio||t.borderRadius!==i.borderRadius||t.font!==n.font||t.image!==i.image||t.imageSlicing!==""+i.imageSlicing||t.margin!==i.margin||t.maxWidth!==i.maxWidth||t.padding!==i.padding;return s&&e?null:s},t.prototype.measureComplete=function(t){var e=this.style,i=e.textStyle;this._measureStyles={customMeasure:t,text:this.text,align:e.align,aspectRatio:e.aspectRatio,borderRadius:e.borderRadius,font:i.font,image:e.image,imageSlicing:""+e.imageSlicing,lineSpacing:e.lineSpacing,margin:e.margin,maxWidth:e.maxWidth,padding:e.padding}},t}();s.Label=R;var B=function(){function t(t,e,i){if(this.cache={},this.frameLabels={},this.numPaints=0,this.numCachedPaints=0,this.allowCache=!0,this.chartArea=0,this.scaleX=0,this.scaleY=0,this.settings=t,this.assetsLoader=e,!i)throw new Error("chartContainer must be specified");this.chartContainer=i}return t.prototype.startFrame=function(t,e,i,n){this.chartArea=t*e,this.scaleX=i,this.scaleY=n},t.prototype.finishFrame=function(){var t=u.countProperties(this.cache);if(!(t<1e3)){var e=u.countProperties(this.frameLabels);if(t>3*e)for(var i in this.cache)this.frameLabels[i]||delete this.cache[i];this.frameLabels={}}},t.prototype.measure=function(t,e){var i=e.needMeasure();if(i===!0){var n=e.style,s=(new U).totalPadding(n),r=0,a=0;if(e.text){var o=this.measureText(t,e),l=o.w,h=o.h;a=Math.max(a,h),r+=l}else e.rows={subLines:[],rowWidths:[]};if(n.image){var u=n.imageSlicing;if(u)r+=u[2],a=Math.max(a,u[3]);else{var c=this.assetsLoader.getAssetImage(n.image,null);c&&c.width?(r+=c.width,a=Math.max(a,c.height)):e._pendingImage=!0}}if(0===r&&(r=10,a=10),r+=2*s,a+=2*s,n.borderRadius>0&&e.text){var d=Math.min(n.borderRadius,a/2);r+=.45*d,n.image||(r+=.45*d)}e.hwidth=r/2,e.hheight=a/2,e.measureComplete(!1)}else if(null===i)throw new Error("Label.needMeasure assert.")},t.prototype.measureText=function(t,e){var i,n,s=e.style,r=s.aspectRatio,a=s.maxWidth,o=new U,l=o.styleTagParser(t,e);if((r>0||a>0)&&l.maxLines>1){r||(r=1e9),a||(a=1e9);var h=function(t){return{x:0,y:0,dx:0,dy:0,width:Math.min(a,t*(r+.2))}};o.fitLabelInRect(t,e,h,!1),i=2*e.hwidth,n=2*e.hheight}else{for(var u=l.words,c=l.breaks,d=0;d<c.length;d++)c[d]=c[d]-1;var p=o.stringsByFont(u,c);e.lineHeight=n=O.getTextHeight(t,s.textStyle.font),e.rows=p,i=p.rowWidths.reduce(function(t,e){return Math.max(t,e)}),n=n*(1+(s.lineSpacing||0))*p.rowWidths.length}return{w:i,h:n}},t.prototype.canCache=function(t,e){var i=this.settings.advanced,n=t.style;if(!this.allowCache||!t.allowCache||!i.labelCache)return!1;if(n.angle&&!i.labelCacheRotated)return!1;var s=2*(t.hwidth*t.hheight*e*e);if(this.chartArea/s<10)return!1;if(n.image){var r=this.assetsLoader.getAssetImage(n.image,null);if(!r)return!1}return!0},t.prototype.styleRequiresDocumentCanvas=function(t){return!!(t&&t.font&&/[0-9]+em/.test(t.font))},t.prototype.realPaint=function(t,e,i,n){var s=n.hwidth,r=n.hheight,a=n.style,o=a.backgroundStyle,l=(new U).totalPadding(a),h=Math.min(a.borderRadius||0,r);if(o){var u=o.lineWidth;u=null==u&&o.lineColor?.5:(u||0)/2,s-=u,r-=u;var c=O.beginStrokeAndFill(t,o);if(h>=r){var d=e+s-r;c.moveTo(d,i-r),c.arc(d,i,r,-Math.PI/2,Math.PI/2,!1),d=e-s+r,c.lineTo(d,i+r),c.arc(d,i,r,Math.PI/2,-Math.PI/2,!1),c.closePath()}else h>0?(c.moveTo(e-s+h,i-r),c.lineTo(e+s-h,i-r),c.arc(e+s-h,i-r+h,h,-Math.PI/2,0,!1),c.lineTo(e+s,i+r-h),c.arc(e+s-h,i+r-h,h,0,+Math.PI/2,!1),c.lineTo(e-s+h,i+r),c.arc(e-s+h,i+r-h,h,+Math.PI/2,Math.PI,!1),c.lineTo(e-s,i-r+h),c.arc(e-s+h,i-r+h,h,Math.PI,Math.PI+Math.PI/2,!1)):(c.moveTo(e-s,i-r),c.lineTo(e+s,i-r),c.lineTo(e+s,i+r),c.lineTo(e-s,i+r),c.closePath());O.endStrokeAndFill(t,c,o),s+=u,r+=u}var p=a.image;s-=l,r-=l;var f=e-s,g=e+s;if(p){var m=this.assetsLoader.getAssetImage(p);if(m){var v=a.imageSlicing;v?(O.drawImageHighQuality(t,m,v[0],v[1],v[2],v[3],e-s,i-r,v[2],v[3]),f+=v[2]):(t.drawImage(m,e-s,i-r),f+=m.width)}}var y=n.rows.subLines,S=n.rows.rowWidths,b=S.length;if(y.length>0){var C=n.lineHeight*(1+(a.lineSpacing||0)),x=a.align,w=void 0,L=void 0;t.textBaseline="bottom";var A=i-(b+1)*C/2+.58*n.lineHeight;"left"===x?(L=f,p||(L+=.45*h),w="start"):"right"===x?(L=g-.45*h,w="end"):(L=(f+g)/2,w="center");var T=a.textStyle,M=-1,k=0;t.textAlign=w;var P=void 0;O.textStyle(t,T);for(var I=T.font,D=0;D<y.length;D++){var F=y[D],N=k;if(k+=F.width,M!==F.row){M=F.row,A+=C,N=0,k=F.width;var E=S[M];P="center"===w?L-E/2:"start"===w?L:L-E}t.textAlign="left",I!==F.font&&(t.font=I=F.font),N+=P,O.drawText(t,T,F.text,N,A)}O.resetTextStyle(t)}},t.prototype.paint=function(t,e,i,n,r){this.measure(t,r);var a=r.style,o=(a.angle||0)/180*Math.PI,l=this.scaleX,h=this.scaleY,u=0===(a.angle||0)?1:1.7,c=l*n*u,d=h*n*u,p=this.canCache(r,n),f=r.hwidth,g=r.hheight,m=3/h;if(r.currentBounds=new gt(e-f*c,i-g*d,e+f*c,i+g*d),p){var v=c,y=d;g*d<m&&(y=m/g,v=c/d*y);var S=r.text+JSON.stringify(r.style)+v.toFixed(2)+","+y.toFixed(2)+","+r.hwidth+","+r.hheight,b=this.cache[S]||null,C=void 0,x=void 0,w=void 0,L=void 0;if(b)C=b.width,x=b.height,w=C/2,L=x/2,this.numCachedPaints+=1;else{var A=a.backgroundStyle,T=A&&A.lineWidth?A.lineWidth:0;C=Math.ceil((2*f+T+1)*v),x=Math.ceil((2*g+T+1)*y),b=document.createElement("canvas"),C+=C%2,x+=x%2,w=C/2,L=x/2,b.width=C,b.height=x;var M=this.styleRequiresDocumentCanvas(a.textStyle),k=void 0;M&&(k=this.chartContainer,k.ownerDocument||(s.Helpers.warn("chartContainer must be appended to the document in order to use `em` when specifying font size."),k=document.body),b.style.display="none",k.appendChild(b));var P=b.getContext("2d");P.transform(v,0,0,y,w,L),this.realPaint(P,0,0,r),M&&k.removeChild(b),this.cache[S]=b,this.numPaints+=1}var I=C/c*n,D=x/d*n;v!==c&&(I=I/v*c,D=D/y*d),I=Math.round(I/2*1e3)/1e3,D=Math.round(D/2*1e3)/1e3;var F=e-I,N=i-D;0!==o?(t.save(),t.translate(e,i),t.rotate(o),F=-I,N=-D):v===c&&(F=Math.round(F*l)/l,N=Math.round(N*h)/h),O.drawImageHighQuality(t,b,0,0,C,x,F,N,2*I,2*D),this.frameLabels[S]=1,0!==o&&O.restore(t)}else{var E=1!==n||0!==o;E&&(t.save(),t.transform(n,0,0,n,e,i),0!==o&&t.rotate(o),e=0,i=0),this.realPaint(t,e,i,r),this.numPaints+=1,E&&O.restore(t)}},t}();s.LabelRenderer=B;var U=function(){function t(){}return t.prototype.totalPadding=function(t){var e=t.padding||0,i=t.backgroundStyle;if(i){var n=i.lineWidth;e+=null==n&&i.lineColor?1:n||0}return e},t.prototype.fitLabelInRect=function(t,e,i,n){void 0===n&&(n=!0);var s=e.style,r=s.margin||0,a=this.totalPadding(s),o=O.getTextHeight(t,s.textStyle.font),l=s.lineSpacing||0,h=o*(l+1),u=-o*l;e.needTextParsing()&&this.styleTagParser(t,e);for(var c,d,p=e._textCache.words,f=e._textCache.breaks,g=e._textCache.maxLines,m=-(1/0),v=null,y=0,S=0,b=0,C=0,x=f.length;x<=g;x++){var w=u+h*x,L=i(w/2+r+a),A=L.width;A-=2*(r+a);var T=this.splitWordsToLines(p,f,x,function(){return A}),M=T.prop,k=T.actualWidthForLines,P=T.positions;if(M>m){v=P,m=M,c=L.dx,d=L.dy,y=L.x,S=L.y,b=A,C=0;for(var I=0;I<k.length;I++){var D=k[I];C=Math.max(D,C)}}if(M>=1)break}if(v){if(!e.userPlaced){var F=e.style.align,N=void 0;N="left"===F?(C-b)/2:"right"===F?(b-C)/2:0,y+=c*N,S+=d*N}n&&(e.x=y,e.y=S),e.rows=this.stringsByFont(p,v),e.hheight=(u+h*v.length)/2+a,e.lineHeight=o,e.lineHeightM=h,e.hwidth=C/2+a,e.visible=!0,e.measureComplete(!0),s.borderRadius>0&&(e.hwidth+=.45*Math.min(s.borderRadius,e.hheight))}else e.rows={subLines:[],rowWidths:[]},e.visible=!1;return m},t.prototype.styleTagParser=function(t,e){return e.needTextParsing()&&(e._textCache=this.styleTagParser2(t,e.text,e.style.textStyle)),e._textCache},t.prototype.styleTagParser2=function(e,i,n){var s=n.font;s?(e.font=s,s=e.font):s="11px Arial";var r=t._spaceWidth;r[s]||(r[s]=O.getTextWidth(e,{font:s}," "));var a=s,o=0,l=0,h=!0,c=i;i=null==i?"":""+i;var d=0,p=0,f=[],g=[],m=-1;f.push({word:"",width:0,font:a,spaceWidth:0});var v={word:"",width:0,font:a,spaceWidth:0};f.push(v);for(var y=i.length,S=0===y?-1:i.charCodeAt(0);d<y;)switch(S){case 32:for(;32===S&&++d<y;)S=i.charCodeAt(d);h||(v.spaceWidth=r[a],h=!0),p=d;break;case 60:if(d+4>y){S=-1;break}var b=d,C=i.charCodeAt(++d),x=47===C?-1:1;x<0&&(C=i.charCodeAt(++d));var w=i.charCodeAt(++d),L=-1;if(98===C||66===C?82===w||114===w?(w=++d===y?-1:i.charCodeAt(d),L=2):L=0:73!==C&&105!==C||(L=1),L>-1&&62===w){S=++d===y?-1:i.charCodeAt(d),p=d;var A=!1,T=v.word||v.spaceWidth>0;if(2===L)m===f.length-1&&(T=!0),g.push(m=f.length-(T?0:1)),h=!0,A=!0;else{1===L?l=Math.max(0,l+x):o=Math.max(0,o+x);var M=(l?"italic ":"")+(o?"bold ":"")+s;M!==a&&(A=!0,a=M,r[a]||(r[a]=O.getTextWidth(e,{font:a}," ")))}A&&(T?(v={word:"",width:0,font:a,spaceWidth:0},f.push(v)):v.font=a)}else d=b,S=-1;break;default:for(var k=!1;32!==S&&60!==S&&++d<y;)k=k||38===S,S=i.charCodeAt(d);var P=i.substring(p,d);k&&(P=u.decodeEntities(P)),v.spaceWidth>0||v.font!==a?(v={word:P,width:0,font:a,spaceWidth:0},f.push(v)):v.word+=P,h=!1,p=d}for(var I=0;I<f.length;I++){var D=f[I];D.word&&(D.width=O.getTextWidth(e,{font:D.font},D.word))}O.resetTextStyle(e);var F=f.length;g[g.length-1]!==F&&g.push(F);var N=F;0===f[0].width&&N--;for(var I=F-1;I>=0;I--){var D=f[I];if(D.width>0)break;N--}return{sourceText:c,sourceFont:n.font,breaks:g,maxLines:N,words:f}},t.prototype.stringsByFont=function(t,e){for(var i=t[0].font,n=e.slice(0),s=[],r=[],a=0,o=0,l="",h=0,u=0,c=0;c<=t.length-1;c++){var d=t[c];u=d.spaceWidth;var p=c===n[0];d.font!==i&&(o&&s.push({text:l,width:o,font:i,row:h}),i=d.font,l="",o=0),o+=d.width,l+=d.word,a+=d.width+d.spaceWidth,p&&(s.push({text:l,width:o,font:i,row:h}),r.push(a-d.spaceWidth),l="",h++,o=a=0,n.shift()),p||d.spaceWidth&&(o+=d.spaceWidth,l+=" ")}return l&&(s.push({text:l,width:o,font:i,row:h}),r.push(a-u)),{subLines:s,rowWidths:r}},t.prototype.fitLabelInLines=function(t,e,i,n,s,r,a){var o=e.style,l=o.margin||0,h=this.totalPadding(o),u=O.getTextHeight(t,o.textStyle.font),c=o.lineSpacing||0,d=u*(c+1),p=-u*c;this.styleTagParser(t,e);var f=e._textCache.words,g=e._textCache.breaks,m=e._textCache.maxLines,v=-(1/0),y=null,S=null,b=null,C=0,x=[],w=[];w.push(a(i,n));for(var L=1;L<=g.length-1;L++){var A=p+d*L,T=void 0;T=L%2===1?x:w;var M=a(i,n-A/2-l);T.unshift([M[0]-l,M[1]-l]),M=a(i,n+A/2+l),T.push([M[0]-l,M[1]-l])}for(var L=g.length;L<=m;L++){var k,A=p+d*L;k=L%2===1?x:w;var M=a(i,n-A/2-l);k.unshift([M[0]-l,M[1]-l]),M=a(i,n+A/2+l),k.push([M[0]-l,M[1]-l]);var P=function(t){return Math.min(k[t][0]+k[t][1],k[t+1][0]+k[t+1][1])},I=this.splitWordsToLines(f,g,L,P),D=I.prop,F=I.actualWidthForLines,N=I.positions;if(D>v&&(C=n-A/2,y=N,v=D,S=F,b=k.slice(0),N.length+1>k.length))throw new Error("Internal error - fitLabelInLines");if(D>=1)break}if(y){var E=0,z=0,H=void 0,_=void 0;if("left"===s){for(var R=1e30,B=0;B<=y.length;B++)R=Math.min(b[B][0]);var U=-R;H=U,_=U;for(var B=0;B<=y.length-1;B++){var V=S[B],G=Math.min(b[B][1],b[B+1][1]);_=Math.max(U+V),z=Math.max(z,V-(G-U))}}else if("right"===s){for(var G=1e30,B=0;B<=y.length;B++)G=Math.min(b[B][1]);var W=G;H=W,_=W;for(var B=0;B<=y.length-1;B++){var V=S[B];H=Math.min(W-V),E=Math.max(E,V-(G+W))}}else if("center"===s){for(var R=1e30,G=1e30,B=0;B<=y.length-1;B++){var V=S[B]/2;R=Math.min(b[B][0]-V,Math.min(b[B+1][0]-V,R)),G=Math.min(b[B][1]-V,Math.min(b[B+1][1]-V,G))}var j=void 0;j=R>0&&G>0?0:R>-G?G:G>-R?-R:(G-R)/2,H=j,_=j;for(var B=0;B<=y.length-1;B++){var V=S[B];R=Math.min(b[B][0],b[B+1][0]),G=Math.min(b[B][1],b[B+1][1]),H=Math.min(H,j-V/2),_=Math.max(_,j+V/2),E=Math.max(E,V/2-R-j),z=Math.max(z,V/2-G+j)}}if("left"===r&&E>0)H+=E,_+=E;else if("right"===r&&z>0)H-=z,_-=z;else if("center"===r){var Y=(E-z)/2;H+=Y,_+=Y}e.rows=this.stringsByFont(f,y),e.hwidth=(_-H)/2+h,e.hheight=(p+d*y.length)/2+h,e.lineHeight=u,e.lineHeightM=d,e.visible=!0,e.measureComplete(!0),o.borderRadius>0&&(e.hwidth+=.45*Math.min(o.borderRadius,e.hheight)),e.userPlaced||(e.x=i+(H+_)/2,e.y=C+e.hheight)}else e.rows={subLines:[],rowWidths:[]},e.visible=!1;return v},t.prototype.splitWordsToLines=function(t,e,i,n){for(var s=100,r=[],a=[],o=0,l=e[o],h=i-e.length,u=t[0],c=0,d=n(0),p=0,f=1;f<=t.length-1;f++){var g=t[f],m=c+(u.spaceWidth+g.width);l===f||u.spaceWidth>0&&m>d&&h>0?(a.push(f-1),r.push(c),s=Math.min(s,d/c),c=g.width,p+=1,d=n(p),l!==f?h-=1:(o+=1,l=e[o])):c=m,u=g}return a.push(t.length),r.push(c),s=Math.min(s,d/c),{prop:s,actualWidthForLines:r,positions:a}},t.prototype.getFormatedText=function(t,e,i,n,s){var r,a=e.style,o=a.textStyle,l=O.getTextHeight(t,a.textStyle.font),h=a.lineSpacing||0,u=l*(h+1),c=a.margin||0,d=this.totalPadding(a),p=!a.angle||0===a.angle,f=90===a.angle||a.angle===-90,g=p||f;if(f)r=n-2*c,n=i-c;else{n-=c;var m=s(l/2+d,i-2*c,n-c);r=m.width}var v=this.getIncludingPart(t,o,e.text,"",r,0),y=e.text,S=null,b=!1,C=O.getTextWidth(t,e.style.textStyle,"鈥�");if(g)for(var x=Math.floor(n/l)-2,w=0;w<=x;){if(y=y.replace(/\s+$/g,""),v=this.getIncludingPart(t,o,y,"",r,0),v===y){this.addLine(t,e,v,w,b);break}if(b=!0,v.length<=1){v=y.slice(0,1),b=e.text!==v,this.addLine(t,e,v,w,b),S=e.rows.rowWidths[0];break}if(w===x)v=this.getIncludingPart(t,o,y,"",r-C,0);else{var L=v.lastIndexOf(" "),A=void 0;if(L===-1){A=y.indexOf(" ");var T=A===-1?y:y.substring(0,A);b=v!==T,b&&(v=this.getIncludingPart(t,o,y,"",r-C,0).replace(/\s+$/g,""),A=y.indexOf(" "),T=A===-1?y:y.substring(0,A)),y=y.substr(v.length),A=y.indexOf(" "),y=A===-1?"":y.substr(A+1)}else v=v.substr(0,L),y=y.substr(L+1),b=!1}if(v.length<=1){if(0!==w)break;v=e.text.slice(0,1)}if(this.addLine(t,e,v,w,b),""===y)break;y=y.trim(),b=!1,w++}else b=v!==y,b&&(v=this.getIncludingPart(t,o,y,"",r-C,0).replace(/\s+$/g,"")),this.addLine(t,e,v,0,b);e.rows||this.addLine(t,e,"",0,!1);var M=(u*e.rows.subLines.length-l*h)/2,k=0;if("left"===a.align||"right"===a.align){var P=Math.max.apply(Math,e.rows.rowWidths),I=(r-P)/2;k="right"===a.align?I:-I}a.angle&&(S=Math.max.apply(Math,e.rows.rowWidths));var D=s(M,S||i,n);e.x=D.x+D.dx*k,e.y=c+D.y,e.hheight=M+d,e.hwidth=Math.max.apply(Math,e.rows.rowWidths)/2+d,e.lineHeight=l,e.lineHeightM=u,e.visible=!0,e.measureComplete(!0),a.borderRadius>0&&(e.hwidth+=.45*Math.min(a.borderRadius,e.hheight))},t.prototype.addLine=function(t,e,i,n,s){s&&(i=i.replace(/\s+$/g,"")+"鈥�");var r=e.style.textStyle,a=O.getTextWidth(t,r,i);null==e.rows&&(e.rows={rowWidths:[],subLines:[]}),e.rows.rowWidths.push(a),e.rows.subLines.push({font:r.font,row:n,text:i,width:a})},t.prototype.getIncludingPart=function(t,e,i,n,s,r){if(i.length<=1){var a=O.getTextWidth(t,e,i);return r+a<=s&&(n+=i),n}var o=i.slice(0,i.length/2),l=O.getTextWidth(t,e,o);if(r+l<=s&&(n+=o),r+l===s)return n;if(r+l<s){var h=i.slice(i.length/2,i.length);return r+=l,this.getIncludingPart(t,e,h,n,s,r)}return this.getIncludingPart(t,e,o,n,s,r)},t._spaceWidth={},t}();s.LabelLayoutBase=U;var V=function(){function t(t,e,i,n){this.labelEnabled=null,this.labelDisabled=null,this.groupId=null,this.hoverCount=0,this.enabled=!0,this.labelText=t,this.textColorEnabled=e,this.textColorDisabled=i,this.groupId=n}return t.prototype.isHovered=function(){return this.hoverCount>0},t.prototype.isEnabled=function(){return this.enabled},t}();s.LegendEntry=V;var G=function(){function t(){this.enabled=!1,this.width=null,this.height=null,this.numberOfRows=null,this.numberOfColumns=null,this.margin=1,this.padding=5,this.maxLineSymbols=15,this.lineSpacing=.2,this.text={font:"12px Arial",fillColor:"#000"},this.marker=new q,this.equalizeRowsColumns=!0,this.panel=new Y("left","fill",1),this.advanced=new j,this.interaction=new W}return t}();s.SettingsLegend=G;var W=function(){function t(){this.click=!0}return t}();s.SettingsLegendInteraction=W;var j=function(){function t(){this.selectedBackground="rgba(208,233,255,0.3)",this.selectedBorder="rgba(208,233,255,0.3)"}return t}();s.SettingsLegendAdvanced=j;var Y=function(t){function e(e,i,n,s,r){t.call(this,e,i,n,s),this.padding=0,void 0!==r&&(this.padding=r)}return n(e,t),e}(s.SettingsChartPanel);s.SettingsLegendPanel=Y;var q=function(){function t(){this.size=20,this.alignment="left",this.lineColor="#fff"}return t}();s.SettingsLegendMarker=q;var Z=function(t){function e(e){var i=this;t.call(this),this.animationOrder=300,this.entries=[],this.hoverPointers={},this.hoverOrder=[],this.entryWidth=0,this.textHeight=0,this.columns=null,this.rows=null,this.contentWidth=0,this.contentHeight=0,this.markerSize=0,this.drawingEntries=0,this.lastInsensitive=!1,this.needsMeasure=!1,this.chart=e,this.settings=e.settings.legend,this.panel=new M,this.panel.packingOrder=50,this.panel.location="outside",this.panel.computeSize=function(t,e,n,s){return i.computePanelSize(t,e,n,s)},u.extendDeep(this.panel,this.settings.panel),this.orientation="left"===this.settings.panel.side||"right"===this.settings.panel.side?"vertical":"horizontal"}return n(e,t),e.prototype.onSceneChange=function(t){var e=t.changes;e.settings&&e.settingsChanges.legend&&(e.bounds=!0,this.settings.enabled||(this.entries=[]),u.extendDeep(this.panel,this.settings.panel))},e.prototype.getPanels=function(){return this.settings.enabled?[this.panel]:[]},e.prototype.computePanelSize=function(t,e,i,n){if(this.needsMeasure=!1,0===this.entries.length||!this.chart.assetsLoaded)return{width:0,height:0};for(var s=O.getTextWidth(i,this.settings.text,"M")*this.settings.maxLineSymbols,r=0,a=this.settings.numberOfRows,o=this.settings.numberOfColumns,l=2*(this.settings.margin+this.settings.padding),h=2*(this.settings.panel.margin+this.settings.panel.padding),u=0;u<this.entries.length;u++){var c=this.entries[u],d={lineSpacing:this.settings.lineSpacing,textStyle:this.settings.text,text:c.labelText,maxWidth:s,align:"left",padding:0,aspectRatio:null};c.labelEnabled=new R(d),c.labelEnabled.style.textStyle.fillColor=c.textColorEnabled,c.labelDisabled=new R(d),c.labelDisabled.style.textStyle.fillColor=c.textColorDisabled,n.measure(i,c.labelEnabled),n.measure(i,c.labelDisabled),r=Math.max(r,2*c.labelEnabled.hheight,2*c.labelDisabled.hheight)}this.textHeight=this.entries[0].labelEnabled.lineHeight,this.markerSize=this.settings.marker.size||this.textHeight,r=Math.max(r,this.markerSize),this.entryHeight=Math.max(r,this.markerSize)+l,this.entryWidth=s+this.markerSize+this.settings.padding+l;var p,f,g=(this.settings.width>0?Math.min(t,Math.max(this.settings.width,this.entryWidth)+h):t)-h,m=(this.settings.height>0?Math.min(e,Math.max(this.settings.height,this.entryHeight)+h):e)-h;if("vertical"===this.orientation){this.rows=Math.floor(m/this.entryHeight);var v=Math.min(Math.ceil(this.entries.length/this.rows),Math.max(1,Math.floor(g/this.entryWidth)));this.columns=o>0?Math.min(o,v):v,this.drawingEntries=Math.min(Math.floor(m/this.entryHeight)*this.columns,this.entries.length),f=this.columns*this.entryWidth,this.drawingEntries>this.rows?(this.settings.equalizeRowsColumns&&(this.rows=Math.ceil(this.drawingEntries/this.columns)),p=this.rows*this.entryHeight):p=this.drawingEntries*this.entryHeight}if("horizontal"===this.orientation){this.columns=Math.floor(g/this.entryWidth);var y=Math.min(Math.ceil(this.entries.length/this.columns),Math.max(1,Math.floor(m/this.entryHeight)));this.rows=a>0?Math.min(a,y):y,this.drawingEntries=Math.min(Math.floor(g/this.entryWidth)*this.rows,this.entries.length),p=this.rows*this.entryHeight,this.drawingEntries>this.columns?(this.settings.equalizeRowsColumns&&(this.columns=Math.ceil(this.drawingEntries/this.rows)),f=this.columns*this.entryWidth):f=this.drawingEntries*this.entryWidth}if(f<=0||p<=0)return{width:0,height:0};this.contentHeight=p,this.contentWidth=f;var S=this.settings.panel.padding;return this.resetHovers(),{width:f+2*S,height:p+2*S}},e.prototype.paintScene=function(t){if(!(this.needsMeasure||!this.settings.enabled||this.entries.length<1||this.drawingEntries<1)){this.lastInsensitive=!1;for(var e=t.context,i=t.labelRenderer,n=this.panel.top,r=this.panel.left,a=this.settings.margin,o=this.settings.padding,l=this.settings.panel.padding,h=0,u=0,c=0;c<this.drawingEntries;c++){var d=l+a,p=r+d+h*this.entryWidth,f=n+d+u*this.entryHeight,g=this.entries[c],m=g.isEnabled()?g.labelEnabled:g.labelDisabled,v=void 0,y=void 0;"right"===this.settings.marker.alignment?(v=p+o+m.hwidth,y=p+this.entryWidth-2*(a+o)-this.markerSize/2):(v=p+this.markerSize+2*o+m.hwidth,y=p+o+this.markerSize/2);var S=m.hheight>this.markerSize/2?0:this.markerSize/2-this.textHeight/2,b=f+o+this.markerSize/2,C=f+S+o+m.hheight;if(this.drawingEntries<this.entries.length&&c+1===this.drawingEntries){this.lastInsensitive=!0,s.Graphics.resetTextStyle(e),e.fillStyle="#000",e.textAlign="left",e.font="bold 12px Arial",e.fillText(". . .",v-m.hwidth,C);break}if(g.isHovered()&&this.rect(e,p,f,this.settings.advanced.selectedBorder,this.settings.advanced.selectedBackground,this.entryWidth-2*a,this.entryHeight-2*a),i.paint(e,v,C,1,m),this.paintMarker(t,y,b,this.markerSize/2,g),"vertical"===this.orientation){if(u+=1,u===this.rows&&(u=0,h+=1),h===this.columns)break}else if(h+=1,h===this.columns&&(h=0,u+=1),u===this.rows)break}}},e.prototype.findItemAt=function(t,e){if(0===this.entries.length)return null;var i=this.panel.top+this.settings.panel.padding,n=this.panel.left+this.settings.panel.padding,s=t<n||t>n+this.contentWidth||e<i||e>i+this.contentHeight;if(s)return null;var r,a,o="vertical"===this.orientation?Math.abs(this.contentHeight/this.entryHeight):Math.abs(this.contentWidth/this.entryWidth);"vertical"===this.orientation?(r=Math.floor((t-n)/this.entryWidth),a=Math.floor((e-i)/this.entryHeight)):(r=Math.floor((e-i)/this.entryHeight),a=Math.floor((t-n)/this.entryWidth));var l=Math.floor(o*r+a);return l>this.drawingEntries-1?null:this.lastInsensitive&&l===this.drawingEntries-1?null:this.entries[l]},e.prototype.rect=function(t,e,i,n,s,r,a){t.beginPath(),t.rect(e,i,r,a),t.fillStyle=s,t.fill(),t.lineWidth=1,t.strokeStyle=n,t.stroke()},e.prototype.resetEntries=function(t){this.entries=t,this.needsMeasure=!0},e.prototype.getLastHoveredEntry=function(){return this.hoverOrder.length<1?null:this.hoverOrder[this.hoverOrder.length-1].entry},e.prototype.resetHovers=function(){for(var t=this.hoverOrder.length-1;t>=0;t--){var e=this.hoverOrder[t],i=this.findItemAt(e.lastX,e.lastY);e.entry!==i&&(i?(this.itemUnhovered(null,e.entry),e.entry=i,this.itemHovered(null,i)):(this.itemUnhovered(null,e.entry),delete this.hoverPointers[e.id],this.hoverOrder.splice(t,1)))}},e.prototype.pointerHoverIn=function(t){var e=this.hoverPointers[t.identifier],i=this.findItemAt(t.x,t.y);return i?(this.settings.interaction.click&&(t.cursor="pointer"),void(e?(e.lastX=t.x,e.lastY=t.y,e.entry!==i&&(this.itemUnhovered(t,e.entry),e.entry=i,this.hoverOrder.splice(this.hoverOrder.indexOf(e),1),this.hoverOrder.push(e),this.itemHovered(t,i))):(e={id:t.identifier,lastX:t.x,lastY:t.y,entry:i},this.hoverPointers[t.identifier]=e,this.hoverOrder.push(e),this.itemHovered(t,i)))):void(e&&(this.itemUnhovered(t,e.entry),delete this.hoverPointers[t.identifier],this.hoverOrder.splice(this.hoverOrder.indexOf(e),1)))},e.prototype.pointerHoverOut=function(t){var e=this.hoverPointers[t.identifier];e&&(this.itemUnhovered(t,e.entry),delete this.hoverPointers[t.identifier],this.hoverOrder.splice(this.hoverOrder.indexOf(e),1))},e.prototype.itemHovered=function(t,e){e.hoverCount++,1===e.hoverCount&&this.chart.events.notifySceneChanges({hover:!0})},e.prototype.itemUnhovered=function(t,e){e.hoverCount--,0===e.hoverCount&&this.chart.events.notifySceneChanges({hover:!0})},e.prototype.itemClicked=function(t,e){if(this.chart.events.requestPaint(),this.chart.notifyChartUpdate("user",!0),t.consumed=!0,t.preventDefault(),null==e.groupId||!e.enabled)return void(e.enabled=!e.enabled);var i=this.entries.filter(function(t){return t.groupId===e.groupId});if(i.length<2)return void(e.enabled=!e.enabled);for(var n=!1,s=!1,r=0;r<i.length;r++)if(i[r]!==e)if(i[r].enabled){if(n=!0,s)break}else if(s=!0,n)break;if(n)if(s)e.enabled=!e.enabled;else for(var r=0;r<i.length;r++)i[r]!==e&&(i[r].enabled=!1);else for(var r=0;r<i.length;r++)i[r].enabled=!0},e.prototype.previewPointerMove=function(t){this.pointerHoverIn(t)},e.prototype.previewPointerCancel=function(t){this.pointerHoverOut(t)},e.prototype.previewPointerOut=function(t){this.pointerHoverOut(t)},e.prototype.previewPointerUp=function(t){t.touch?this.pointerHoverOut(t):this.pointerHoverIn(t)},e.prototype.previewPointerDown=function(t){this.pointerHoverIn(t),this.settings.interaction.click&&this.hoverPointers[t.identifier]&&(t.consumed=!0)},e.prototype.previewInstantClick=function(t){if(this.settings.interaction.click){var e=this.findItemAt(t.x,t.y);e&&this.itemClicked(t,e)}},e}(A);s.Legend=Z,function(t){var e=function(){function t(t,e){this.chart=t,this.domElement=null,e instanceof K?this.options=e:(this.options=new K,st.updateRecursive(this.options,e,it.BaseSettingsToolbarItem,{}))}return t.prototype.onSceneChange=function(t){},t.prototype.doAnimations=function(t){},t.prototype.previewPointerDown=function(t){},t}();t.Item=e;var i=function(t){function e(e,i,n,s){var r=this;void 0===s&&(s=!0),t.call(this,e,i),this.captureClick=s,this.onClickProxy=function(t){return r.onClick(t)},this.createButton(n)}return n(e,t),e.prototype.createButton=function(t){this.domElement=u.createDom("li",null,null,null),this.a=u.createDom("a",null,null,this.domElement),this.p=t?this.a:u.createDom("p",null,null,this.a),
  31. u.listen(this.a,"click",this.onClickProxy),this.updateSettings()},e.prototype.updateSettings=function(){var t=this.options,e=t.title||t.label||"",i=t.image;this.a.title=e;var n="DVSL-bar-btn "+(t.cssClass?t.cssClass:i?"DVSL-bar-btn-image":"DVSL-bar-btn-none");t.enabled||(n+=" DVSL-bar-disabled"),this.a.className=n,this.p.innerHTML=t.showLabel!==!1&&t.label||"",this.p.style.backgroundImage=i?'url("'+encodeURI(i)+'")':null},e.prototype.remove=function(){u.unlisten(this.a,"click",this.onClickProxy)},e.prototype.onClick=function(t){var e=this.options;e.enabled&&e.onClick&&(e.onClick(t,this.chart.api),this.captureClick&&u.stopPropagation(t))},e}(e);t.Button=i;var s=function(t){function e(e,i){t.call(this,e,i)}return n(e,t),e.prototype.createButton=function(){t.prototype.createButton.call(this),u.createDom("span",null,null,this.a),u.addClass(this.a,"DVSL-bar-show-more")},e.prototype.buildDropdownList=function(){return[]},e.prototype.onHideDropdown=function(){},e.prototype.onClick=function(e){this.dropdown?this.hideDropdown():this.showDropdown(),t.prototype.onClick.call(this,e),u.stopPropagation(e)},e.prototype.showDropdown=function(){var t=this.dropdown=u.createDom("div","DVSL-bar-dropdown",null,this.domElement);t.style.display="block";for(var e=u.createDom("ul",null,null,t),i=this.buildDropdownList(),n=0;n<i.length;n++){var s=i[n];e.appendChild(s)}var r=t.getBoundingClientRect();if(r.top<0)t.style.marginBottom=(0|r.top)+"px",t.className+=" DVSL-no-triangle";else{var a=Math.max(window.innerHeight-r.bottom,-r.top);a<0&&(t.style.marginTop=(0|a)+"px",t.className+=" DVSL-no-triangle")}},e.prototype.hideDropdown=function(){this.onHideDropdown(),this.dropdown.parentNode.removeChild(this.dropdown),this.dropdown=null,this.chart.shell.forceChromeRedraw()},e.prototype.previewPointerDown=function(t){var e=u.isParentOf(this.domElement,t.target);if(this.dropdown&&!e){var i=u.elementPos(this.chart.shell.interactiveContainer),n=i.left,s=i.top;i=u.elementPos(this.dropdown);var r=i.left,a=i.top;r-=n,a-=s;var o=r+this.dropdown.offsetWidth,l=a+this.dropdown.offsetHeight;(r>t.x||a>t.y||l<t.y||o<t.x)&&this.hideDropdown()}},e}(i);t.DropdownBase=s;var r=function(e){function i(i,n){var s=this;e.call(this,i,n),this.htmlItems=[],this.clickProxy=function(){s.hideDropdown()};var r=n.dropDownItems;this.items=new Array(r.length);for(var a=0;a<r.length;a++)this.items[a]=new t.Button(i,r[a],!0,!1)}return n(i,e),i.prototype.buildDropdownList=function(){this.htmlItems=new Array(this.items.length);for(var t=0;t<this.items.length;t++){var e=this.items[t];u.listen(e.domElement,"click",this.clickProxy),this.htmlItems[t]=e.domElement}return this.htmlItems},i.prototype.onHideDropdown=function(){if(this.htmlItems){for(var t=0;t<this.htmlItems.length;t++){var e=this.htmlItems[t];e.parentNode.removeChild(e),u.unlisten(e,"click",this.clickProxy)}this.htmlItems=null}},i}(s);t.Dropdown=r;var a=function(t){function e(e,i){t.call(this,e,i),this._lastLabel=""}return n(e,t),e.prototype.buildDropdownList=function(){for(var t=this,e=[],i=0,n=this.getItems();i<n.length;i++){var s=n[i],r=u.createDom("li",null,null,null),a=u.createDom("a",null,s.name,r);s.selected&&(a.className="DVSL-bar-dropdown-active"),s.disabled?a.className="DVSL-bar-dropdown-disabled":!function(e,i){return u.listen(e,"click",function(){return t.userSelected(i)})}(a,s),e.push(r)}return e},e.prototype.userSelected=function(t){this.hideDropdown(),this.setSelectedItem(t),this.onSelectionChange(t)},e.prototype.setSelectedItem=function(t){var e=t.name||"";this.options.showLabel!==!1&&this._lastLabel!==e&&(this.p.innerHTML=this._lastLabel=e)},e}(s);t.Combobox=a;var o=function(t){function e(e,i,n){t.call(this,e,i),this.additionalOptions=n,this.curState=null,this.onSceneChange({})}return n(e,t),e.prototype.onSceneChange=function(t){var e=this.additionalOptions.getChartState();if(e!==this.curState){var i=this.options,n=this.additionalOptions;this.curState=e,i.cssClass=e&&n.cssClassEnabled||n.cssClassDisabled,i.label=e&&n.labelEnabled||n.labelDisabled,i.title=e&&n.titleEnabled||n.titleDisabled,this.updateSettings()}},e.prototype.onClick=function(e){this.options.enabled&&(this.curState?this.additionalOptions.onDisable():this.additionalOptions.onEnable()),this.onSceneChange(null),t.prototype.onClick.call(this,e),u.stopPropagation(e)},e}(i);t.ToggleButton=o,t.ToolbarItemNames={}}(o);var X=function(){function t(t,e,i,n,s){void 0===t&&(t=!1),this.enabled=!1,this.location="inside",this.side="top",this.align="right",this.showLabels=!0,this.cssClass=null,this.items=[],this.extraItems=[],this.back=!0,this.export=!0,this.fullscreen=!1,this.exportOptions=null,this.zoomOut=!1,this.enabled=t,void 0!==e&&(this.items=e),void 0!==i&&(this.side=i),void 0!==n&&(this.align=n),void 0!==s&&(this.showLabels=s)}return t}();s.SettingsToolbar=X;var Q=function(){function t(){this.label=null,this.title=null,this.image=null,this.enabled=!0,this.onClick=null,this.cssClass=null}return t}();s.SettingsToolbarItemBase=Q;var K=function(t){function e(e,i,n,s){t.call(this),this.location=void 0,this.side=void 0,this.align=void 0,this.showLabel=void 0,this.item=null,this.dropDownItems=null,void 0!==e&&(this.item=e),void 0!==i&&(this.align=i),void 0!==n&&(this.side=n),void 0!==s&&(this.location=s)}return n(e,t),e}(Q);s.SettingsToolbarItem=K;var J=function(t){function e(e,i){t.call(this),this.panels={},this.panelList=[],this.items=[],this.animationOrder=2e3,this.options=i,this.chart=e,this.scene=this.chart.scene,this.addItems(),this.chart.events.addElement(this),this.chart.events.notifySceneChanges({bounds:!0})}return n(e,t),e.prototype.rebuildItems=function(){this.removeItems(),this.addItems()},e.prototype.addItems=function(){if(this.options.enabled){for(var t=0;t<this.options.items.length;t++){var e=this.options.items[t];this.addItem(e)}for(var t=0;t<this.options.extraItems.length;t++){var e=this.options.extraItems[t];this.addItem(e)}}},e.prototype.removeItems=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.remove()}for(var i=0;i<this.panelList.length;i++){var n=this.panelList[i];n.clear()}this.items=[]},e.prototype.remove=function(){this.removeItems();for(var t=0;t<this.panelList.length;t++){var e=this.panelList[t];e.remove()}this.chart.events.removeElement(this)},e.prototype.addItem=function(t){var e,i=this.options;u.isString(t)?e=new K(t,i.align,i.side,i.location):(e=u.clone(t),e.align=e.align||this.options.align,e.side=e.side||this.options.side,e.location=e.location||this.options.location);var n,s=e.location+e.side;this.panels.hasOwnProperty(s)?n=this.panels[s]:(n=new $(this,e.location,e.side,this.chart),this.panelList.push(n),this.panels[s]=n),null!=e.showLabel||!n.hideLabels&&i.showLabels||(e.showLabel=!1);var r;if(null!=e.item){var a=e.item;if(this.options[a]===!1)return;if(!o.ToolbarItemNames.hasOwnProperty(a))return void this.chart.error("Toolbar item name '"+a+"' not recognized.");r=o.ToolbarItemNames[a](this.chart,e)}else r=e.dropDownItems?new o.Dropdown(this.chart,e):new o.Button(this.chart,e);n.addItem(r,e.align),this.items.push(r)},e.prototype.getPanels=function(){return this.panelList},e.prototype.onSceneChange=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];i.onSceneChange(t.changes)}},e.prototype.doAnimations=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];i.doAnimations(t)}},e.prototype.previewGlobalPointerDown=function(t){for(var e=0;e<this.items.length;e++)this.items[e].previewPointerDown(t)},e}(A);s.Toolbar=J;var $=function(t){function e(e,i,n,s){t.call(this),this.chart=s,this.side=n,this.location=i,this.toolbar=e,this.packingOrder="inside"===i?1e3:15,this.container=this.toolbar.chart.shell.menuContainer,this.floating=!1,this.align="fill";var r=e.options.cssClass?e.options.cssClass+" ":"";"top"===this.side?(this.vertical=!1,this.leftPanel=u.createDom("ul",r+"DVSL-bar-left DVSL-bar-top DVSL-bar-horizontal",null,this.container),this.rightPanel=u.createDom("ul",r+"DVSL-bar-right DVSL-bar-top DVSL-bar-horizontal",null,this.container)):"bottom"===this.side?(this.vertical=!1,this.leftPanel=u.createDom("ul",r+"DVSL-bar-left DVSL-bar-bottom DVSL-bar-horizontal",null,this.container),this.rightPanel=u.createDom("ul",r+"DVSL-bar-right DVSL-bar-bottom DVSL-bar-horizontal",null,this.container)):"left"===this.side?(this.vertical=!0,this.leftPanel=u.createDom("ul",r+"DVSL-bar-left DVSL-bar-top DVSL-bar-vertical",null,this.container),this.rightPanel=u.createDom("ul",r+"DVSL-bar-left DVSL-bar-bottom DVSL-bar-vertical",null,this.container)):"right"===this.side?(this.vertical=!0,this.leftPanel=u.createDom("ul",r+"DVSL-bar-right DVSL-bar-top DVSL-bar-vertical",null,this.container),this.rightPanel=u.createDom("ul",r+"DVSL-bar-right DVSL-bar-bottom DVSL-bar-vertical",null,this.container)):this.chart.error("Unrecognized side: '"+this.side+"'"),this.leftPanel.style.visibility="hidden",this.rightPanel.style.visibility="hidden"}return n(e,t),e.prototype.addItem=function(t,e){"left"===e||"top"===e?this.leftPanel.appendChild(t.domElement):"right"===e||"bottom"===e?this.rightPanel.appendChild(t.domElement):this.chart.error("Unrecognized align: '"+e+"'")},e.prototype.clear=function(){this.leftPanel.innerHTML="",this.rightPanel.innerHTML=""},e.prototype.computeSize=function(t,e,i){if(!this.vertical){this.hideLabels||(this.contentWidthWithLabels=this.leftPanel.offsetWidth+this.rightPanel.offsetWidth);var n=this.contentWidthWithLabels>0&&this.contentWidthWithLabels>t;n!==this.hideLabels&&(this.hideLabels=n,this.toolbar.rebuildItems())}return this.vertical?{width:Math.max(this.leftPanel.offsetWidth,this.rightPanel.offsetWidth),height:0}:{width:0,height:Math.max(this.leftPanel.offsetHeight,this.rightPanel.offsetHeight)}},e.prototype.placePanel=function(t,e,i,n){var s=this.leftPanel,r=this.rightPanel,a=s.style,o=r.style,l="px",h=this.toolbar.scene,u=h.chartHeight,c=h.chartWidth;if(this.vertical)a.top=e+l,o.bottom=u-n+l,"left"===this.side?(a.left=t+l,o.left=t+l):(a.right=c-i+l,o.right=c-i+l);else{a.left=t+l,o.right=c-i+l;var d="top"===this.side;if(d?(a.top=e+l,o.top=e+l):(a.bottom=u-n+l,o.bottom=u-n+l),this.hideLabels){var p=s.offsetLeft+s.offsetWidth;o.marginLeft=p+"px",r.offsetLeft<p&&(d?o.top=e+s.offsetHeight+l:o.bottom=u-n+s.offsetHeight+l)}}s.offsetWidth>0&&(a.visibility="visible"),r.offsetWidth>0&&(o.visibility="visible")},e.prototype.remove=function(){this.container.removeChild(this.leftPanel),this.container.removeChild(this.rightPanel)},e}(M);s.ToolbarPanel=$;var tt=function(){function t(){this.enabled=!0,this.fixedAspect=!1,this.visibilityDistance=45,this.grabDistance=10}return t}();s.SettingsResizer=tt;var et=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.paintOrder=65,this.updateOrder=300,this.oh=0,this.sy=0,this.barVisible=!1,this.resizing=!1,this.aspect=null,this.chart=e,this.scene=this.chart.scene,this.options=this.scene.settings.interaction.resizing,this.resizerBar=s.Helpers.createDom("div","DVSL-resizer",null,this.chart.shell.interactiveContainer)}return n(e,t),e.prototype.onSceneChange=function(t){this.options.enabled||this.hideUI()},e.prototype.doAnimations=function(t){t.changes.bounds&&this.resizerBar&&(this.resizerBar.style.width=this.scene.chartWidth+"px")},e.prototype.onPointerOut=function(t){this.options.enabled&&this.hideUI()},e.prototype.onPointerMove=function(t){if(this.options.enabled){var e=this.scene.chartHeight-t.y;e<this.options.visibilityDistance?(this.barVisible||this.showUI(),e<this.options.grabDistance&&(t.consumed=!0,t.cursor="ns-resize")):this.barVisible&&this.hideUI()}},e.prototype.onPointerDown=function(t){if(this.options.enabled){this.sy=t.y;var e=this.scene.chartHeight-t.y;this.resizing=e<this.options.grabDistance&&t.y<=this.scene.chartHeight,this.resizing&&(this.options.fixedAspect?this.aspect=Math.max(1,this.chart.scene.chartWidth)/Math.max(1,this.chart.scene.chartHeight):this.aspect=0,this.oh=this.scene.chartHeight,this.showUI(),t.cursor="ns-resize",t.consumed=!0)}},e.prototype.onDoubleClick=function(t){this.resizing&&this.chart.setFullscreen(!this.chart.isFullscreen())},e.prototype.onPointerDrag=function(t){if(this.options.enabled)if(this.chart.isFullscreen())this.chart.setFullscreen(!1),this.hideUI(),t.consumed=!0;else if(this.resizing){var e=this.scene.settings.area;t.consumed=!0,this.wasMaximized=!1,e.height=Math.min(e.maxHeight,Math.max(e.minHeight,this.oh+(t.y-this.sy))),this.aspect&&(e.width=e.height*this.aspect),this.chart.updateSize(!0)}},e.prototype.showUI=function(){this.barVisible||(this.barVisible=!0,this.resizerBar.style.display="block")},e.prototype.hideUI=function(){this.barVisible&&(this.barVisible=!1,this.resizing=!1,this.resizerBar.style.display="none")},e}(A);s.Resizer=et;var it=function(){function t(){}return t.BaseIChartErrorEventArguments={},t.BaseIChartEventArguments={},t.BaseIChartSettingsChangeEventArguments={},t.BaseIDataErrorResponse={error:{t:0}},t.BaseIDataObjectBase={extra:{t:10}},t.BaseISettingsClassMap={},t.BaseSettings={advanced:{t:5,u:0,c:function(){return t.BaseSettingsAdvanced},x:function(){return i.Base.SettingsAdvanced}},area:{t:5,u:0,c:function(){return t.BaseSettingsArea},x:function(){return i.Base.SettingsArea}},assetsUrlBase:{t:0},container:{t:3},credits:{t:5,u:0,c:function(){return t.BaseSettingsCredits},x:function(){return i.Base.SettingsCredits}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.BaseSettingsData},x:function(){return i.Base.SettingsData}}]},events:{t:5,u:0,c:function(){return t.BaseSettingsEvents(t.BaseIChartEventArguments,t.BaseIChartEventArguments)},x:function(){return i.Base.SettingsEvents}},interaction:{t:5,u:0,c:function(){return t.BaseSettingsInteraction},x:function(){return i.Base.SettingsInteraction}},legend:{t:5,u:0,c:function(){return t.BaseSettingsLegend},x:function(){return i.Base.SettingsLegend}},localization:{t:5,u:0,c:function(){return t.BaseSettingsLocalization},x:function(){return i.Base.SettingsLocalization}},parentChart:{t:5},theme:{t:5,c:function(){return t.BaseSettings},x:function(){return i.Base.Settings},y:!0},title:{t:5,u:0,c:function(){return t.BaseSettingsTitle},x:function(){return i.Base.SettingsTitle}},toolbar:{t:5,u:0,c:function(){return t.BaseSettingsToolbar},x:function(){return i.Base.SettingsToolbar}}},t.BaseSettingsAdvanced={assets:{t:6,u:3,b:[{t:7,u:0,b:[{t:0},{t:5,u:0,c:function(){return{url:{t:0},required:{t:4}}}}]}]},crossOriginHeader:{t:7,b:[{t:0}]},dataExportFunction:{t:4},exportPdfSize:{t:12,b:[{t:1},{t:1}]},exportProxyURL:{t:0,d:5},highDPI:{t:7,b:[{t:9},{t:1}]},labelCache:{t:9},labelCacheRotated:{t:9},logging:{t:9},maxCanvasHeight:{t:1,d:0},maxCanvasWidth:{t:1,d:0},pointer:{t:5,u:0,c:function(){return t.BaseSettingsAdvancedPointer},x:function(){return i.Base.SettingsAdvancedPointer}},showFPS:{t:9},showTimestamp:{t:9},showTouchTrail:{t:9},showTouches:{t:9},style:{t:5,u:0,c:function(){return t.BaseSettingsAdvancedStyle},x:function(){return i.Base.SettingsAdvancedStyle}},themeCSSClass:{t:0},useAnimationFrame:{t:9}},t.BaseSettingsAdvancedPointer={clickSensitivity:{t:1},doubleClickSensitivity:{t:1},doubleClickTimeout:{t:1,d:0},longPressSensitivity:{t:1,d:0},longPressTimeout:{t:1,d:0},mouseWheelRequiresFocus:{t:9},noClickOnDoubleClick:{t:9},scrollIntoView:{t:9},speedAveragingPeriod:{t:1,d:0}},t.BaseSettingsAdvancedStyle={loadingArcStyle:{t:5,u:0,c:function(){return{lineColor:{t:0},lineWidth:{t:1},location:{t:0,d:6},r:{t:1}}}},messageBackgroundStyle:{t:5,u:0,c:function(){return t.BaseSettingsAdvancedStyleMessageBackground}},messageTextStyle:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}}},t.BaseSettingsAdvancedStyleMessageBackground={padding:{t:1}},t.BaseSettingsArea={height:{t:1},left:{t:1},maxHeight:{t:1},maxWidth:{t:1},minHeight:{t:1},minWidth:{t:1},style:{t:5,u:0,c:function(){return t.BaseSettingsAreaStyle},x:function(){return i.Base.SettingsAreaStyle}},top:{t:1},width:{t:1}},t.BaseSettingsAreaStyle={fillColor:{t:0,d:3},image:{t:0,d:4},overlayColor:{t:0,d:3}},t.BaseSettingsBackgroundStyle={fillColor:{t:7,b:[{t:0},{t:14}]},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}},t.BaseSettingsChartPanel={align:{t:0,d:6},floating:{t:9},location:{t:0,d:6},margin:{t:1},side:{t:0,d:6}},t.BaseSettingsCredits={enabled:{t:9},enabledOnExport:{t:9},image:{t:0,d:4},imageExport:{t:0,d:4},imageScaling:{t:1},location:{t:0,d:6},url:{t:0,d:5},urlTarget:{t:0}},t.BaseSettingsData={format:{t:7,b:[{t:0}]},id:{t:0},numberOfParallelRequests:{t:1,d:0},postprocessorFunction:{t:4},preloaded:{t:5,c:function(){return t.BaseIDataErrorResponse}},requestTimeout:{t:1,d:0},url:{t:0,d:5},urlParameters:{t:6,u:0,b:[{t:5,u:0,c:function(){return{name:{t:0},value:{t:0}}}}]}},t.BaseSettingsEvents=function(t,e){return{chartUpdateDelay:{t:1,d:0},onChartUpdate:{t:4},onClick:{t:4},onDoubleClick:{t:4},onError:{t:4},onHoverChange:{t:4},onPositionChange:{t:4},onRightClick:{t:4},onSelectionChange:{t:4},onSettingsChange:{t:4},onTripleClick:{t:4}}},t.BaseSettingsInteraction={resizing:{t:5,u:0,c:function(){return t.BaseSettingsResizer},x:function(){return i.Base.SettingsResizer}}},t.BaseSettingsLabelStyle={align:{t:7,b:[{t:0}]},angle:{t:1,d:0},aspectRatio:{t:1},backgroundStyle:{t:5,u:0,c:function(){return t.BaseSettingsBackgroundStyle}},borderRadius:{t:1},extra:{t:10},image:{t:0,d:4},imageSlicing:{t:12,b:[{t:1},{t:1},{t:1},{t:1}]},lineSpacing:{t:1},margin:{t:1},maxWidth:{t:1},padding:{t:1},text:{t:0},textStyle:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}}},t.BaseSettingsLegend={advanced:{t:5,u:0,c:function(){return t.BaseSettingsLegendAdvanced},x:function(){return i.Base.SettingsLegendAdvanced}},enabled:{t:9},equalizeRowsColumns:{t:9},height:{t:1},interaction:{t:5,u:0,c:function(){return t.BaseSettingsLegendInteraction},x:function(){return i.Base.SettingsLegendInteraction}},lineSpacing:{t:1},margin:{t:1},marker:{t:5,u:0,c:function(){return t.BaseSettingsLegendMarker},x:function(){return i.Base.SettingsLegendMarker}},maxLineSymbols:{t:1,d:0},numberOfColumns:{t:1,d:0},numberOfRows:{t:1,d:0},padding:{t:1},panel:{t:5,u:0,c:function(){return t.BaseSettingsLegendPanel},x:function(){return i.Base.SettingsLegendPanel}},text:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}},width:{t:1}},t.BaseSettingsLegendAdvanced={selectedBackground:{t:0,d:3},selectedBorder:{t:0,d:3}},t.BaseSettingsLegendInteraction={click:{t:9}},t.BaseSettingsLegendMarker={alignment:{t:0,d:6},lineColor:{t:0,d:3},size:{t:1}},t.BaseSettingsLegendPanel={padding:{t:1}},t.BaseSettingsLineStyle={lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1}},t.BaseSettingsLocalization={closeButton:{t:0},dataRequestFailed:{t:0},exportNotAvailable:{t:0},loadingLabel:{t:0},toolbar:{t:5,u:0,c:function(){return t.BaseSettingsLocalizationToolbar},x:function(){return i.Base.SettingsLocalizationToolbar}}},t.BaseSettingsLocalizationToolbar={backButton:{t:0},backTitle:{t:0},exportButton:{t:0},exportCSV:{t:0},exportJpeg:{t:0},exportPDF:{t:0},exportPNG:{t:0},exportTitle:{t:0},exportXLS:{t:0},fullscreenButton:{t:0},fullscreenTitle:{t:0},zoomoutButton:{t:0},zoomoutTitle:{t:0}},t.BaseSettingsResizer={enabled:{t:9},fixedAspect:{t:9},grabDistance:{t:1},visibilityDistance:{t:1}},t.BaseSettingsTextStyle={fillColor:{t:0},font:{t:0},outlineColor:{t:0},outlineJoin:{t:0,d:6},outlineWidth:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}},t.BaseSettingsTitle={align:{t:0,d:6},enabled:{t:9},enabledOnExport:{t:9},margin:{t:1},style:{t:5,u:0,c:function(){return{fillColor:{t:0},font:{t:0}}}},text:{t:0}},t.BaseSettingsToolbar={align:{t:0,d:6},back:{t:9},cssClass:{t:0},enabled:{t:9},export:{t:9},exportOptions:{t:6,u:0,b:[{t:7,b:[{t:0}]}]},extraItems:{t:6,u:0,b:[{t:7,u:0,b:[{t:0},{t:5,u:0,c:function(){return t.BaseSettingsToolbarItem},x:function(){return i.Base.SettingsToolbarItem}}]}]},fullscreen:{t:9},items:{t:6,u:0,b:[{t:7,u:0,b:[{t:0},{t:5,u:0,c:function(){return t.BaseSettingsToolbarItem},x:function(){return i.Base.SettingsToolbarItem}}]}]},location:{t:0,d:6},showLabels:{t:9},side:{t:0,d:6},zoomOut:{t:9}},t.BaseSettingsToolbarItem={align:{t:0,d:6},dropDownItems:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.BaseSettingsToolbarItemBase},x:function(){return i.Base.SettingsToolbarItemBase}}]},item:{t:0,d:6},location:{t:0,d:6},showLabel:{t:9},side:{t:0,d:6}},t.BaseSettingsToolbarItemBase={cssClass:{t:0},enabled:{t:9},image:{t:0,d:4},label:{t:0},onClick:{t:4},title:{t:0}},t.FacetChartIChartClickEventArguments={},t.FacetChartIChartEventArguments={},t.FacetChartSettings={chartTypes:{t:5,u:0,c:function(){return{columns:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesColumns},x:function(){return i.FacetChart.SettingsSeriesColumns},y:!0},line:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesLines},x:function(){return i.FacetChart.SettingsSeriesLines},y:!0}}}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.PieChartSettingsData},x:function(){return i.PieChart.SettingsData}}]},events:{t:5,u:0,c:function(){return t.LinearChartSettingsEvents(t.FacetChartIChartEventArguments,t.FacetChartIChartClickEventArguments)},x:function(){return i.LinearChart.SettingsEvents}},facetAxis:{t:5,u:0,c:function(){return t.FacetChartSettingsFacetAxis},x:function(){return i.FacetChart.SettingsFacetAxis}},filters:{t:5,u:0,c:function(){return{allowZeroValues:{t:9},sliceFilter:{t:4}}}},interaction:{t:5,u:0,c:function(){return t.FacetChartSettingsInteraction},x:function(){return i.FacetChart.SettingsInteraction}},items:{t:5,u:0,c:function(){return{style:{t:5,u:0,c:function(){return{expandable:{t:9},label:{t:0}}}},styleFunction:{t:4}}}},legend:{t:5,u:0,c:function(){return t.LinearChartSettingsLegend},x:function(){return i.LinearChart.SettingsLegend}},navigation:{t:5,u:0,c:function(){return{initialDrilldown:{t:6,u:0,b:[{t:0}]},initialOffset:{t:1,d:0}}}},scrollButtons:{t:5,u:0,c:function(){return t.FacetChartSettingsScrollButtons},x:function(){return i.FacetChart.SettingsScrollButtons}},series:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.FacetChartSettingsSeries},x:function(){return i.FacetChart.SettingsSeries},y:!0}]},seriesDefault:{t:5,u:0,c:function(){return t.FacetChartSettingsSeries},x:function(){return i.FacetChart.SettingsSeries},y:!0},theme:{t:5,c:function(){return t.FacetChartSettings},x:function(){return i.FacetChart.Settings},y:!0},toolbar:{t:5,u:0,c:function(){return t.FacetChartSettingsToolbar},x:function(){return i.FacetChart.SettingsToolbar}}},t.FacetChartSettingsFacetAxis={defaultUnitWidth:{t:1},enabled:{t:9},labels:{t:5,u:0,c:function(){return t.FacetChartSettingsFacetAxisLabels}},maxUnitWidth:{t:1},size:{t:1},title:{t:5,u:0,c:function(){return t.FacetChartSettingsFacetAxisTitleStyle}},zoomOutUnitWidth:{t:1}},t.FacetChartSettingsFacetAxisLabels={allowOverflow:{t:9},enabled:{t:9},interLabelSpacing:{t:1},text:{t:0}},t.FacetChartSettingsFacetAxisTitleStyle={enabled:{t:9},text:{t:0},useFacetName:{t:9}},t.FacetChartSettingsFacetStyle={},t.FacetChartSettingsInteraction={animation:{t:5,u:0,c:function(){return{scrollDuration:{t:1,d:0}}}},selection:{t:5,u:0,c:function(){return t.FacetChartSettingsInteractionSelection},x:function(){return i.FacetChart.SettingsInteractionSelection}}},t.FacetChartSettingsInteractionSelection={enabled:{t:9},tolerance:{t:1}},t.FacetChartSettingsScrollButtons={enabled:{t:9},enabledOnExport:{t:9},size:{t:1},style:{t:5,u:0,c:function(){return{fillColor:{t:0},hoverFillColor:{t:0},hoverLineColor:{t:0},lineColor:{t:0}}}}},t.FacetChartSettingsSeries={data:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesData},x:function(){return i.FacetChart.SettingsSeriesData}},type:{t:0,d:6}},t.FacetChartSettingsSeriesColumns={data:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesData},x:function(){return i.FacetChart.SettingsSeriesData}},style:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesColumnsStyle},x:function(){return i.FacetChart.SettingsSeriesColumnsStyle}}},t.FacetChartSettingsSeriesColumnsStyle={previewContents:{t:9},previewLineColor:{t:0}},t.FacetChartSettingsSeriesData={field:{t:0},valueFunction:{t:4}},t.FacetChartSettingsSeriesLines={data:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesData},x:function(){return i.FacetChart.SettingsSeriesData}},style:{t:5,u:0,c:function(){return t.FacetChartSettingsSeriesLinesStyle},x:function(){return i.FacetChart.SettingsSeriesLinesStyle}}},t.FacetChartSettingsSeriesLinesStyle={markerStyleFunction:{t:4}},t.FacetChartSettingsToolbar={enabled:{t:9},items:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.BaseSettingsToolbarItem},x:function(){return i.Base.SettingsToolbarItem}}]},logScale:{t:9},zoomOut:{t:9}},t.GeoChartIAggregationDataObjectNode={aggregatedNodes:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.GeoChartIGeoDataObjectNode}}]},aggregatedWeight:{t:1}},t.GeoChartIDataObject={east:{t:1},links:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.GeoChartIGeoDataObjectLink}}]},nodes:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.GeoChartIGeoDataObjectNode}}]},north:{t:1},south:{t:1},west:{t:1}},t.GeoChartIGeoDataObjectLink={},t.GeoChartIGeoDataObjectNode={aggregate:{t:9},coordinates:{t:7,u:0,b:[{t:12,b:[{t:1},{t:1}]},{t:6,u:0,b:[{t:6,u:0,b:[{t:1}]}]}]},count:{t:1},shapeFeature:{t:10},shapeGeometry:{t:10},type:{t:0}},t.GeoChartSettings={area:{t:5,u:0,c:function(){return t.GeoChartSettingsArea},x:function(){return i.GeoChart.SettingsArea}},background:{t:5,u:0,c:function(){return t.GeoChartSettingsBackground},x:function(){return i.GeoChart.SettingsBackground}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.GeoChartSettingsData},x:function(){return i.GeoChart.SettingsData}}]},filters:{t:5,u:0,c:function(){return{nodeFilter:{t:4}}}},interaction:{t:5,u:0,c:function(){return t.GeoChartSettingsInteraction},x:function(){return i.GeoChart.SettingsInteraction}},layerTypes:{t:5,u:0,c:function(){return{aggregateOnShapes:{t:5,u:0,c:function(){return t.GeoChartSettingsLayerAggregated},x:function(){return i.GeoChart.SettingsLayerAggregated},y:!0},charts:{t:5,u:0,c:function(){return t.GeoChartSettingsLayerCharts},x:function(){return i.GeoChart.SettingsLayerCharts},y:!0},items:{t:5,u:0,c:function(){return t.GeoChartSettingsLayerItems},x:function(){return i.GeoChart.SettingsLayerItems},y:!0},shapes:{t:5,u:0,c:function(){return t.GeoChartSettingsLayerShapes},x:function(){return i.GeoChart.SettingsLayerShapes},y:!0}}}},layers:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.GeoChartSettingsLayerBase},x:function(){return i.GeoChart.SettingsLayerBase},y:!0}]},layersDefault:{t:5,u:0,c:function(){return t.GeoChartSettingsLayerBase},x:function(){return i.GeoChart.SettingsLayerBase},y:!0},navigation:{t:5,u:0,c:function(){return{drilldownLayer:{t:0},initialDrilldown:{t:6,u:0,b:[{t:0}]},initialLat:{t:1},initialLng:{t:1},initialZoom:{t:1},maxBounds:{t:5,u:0,c:function(){return{east:{t:1},north:{t:1},south:{t:1},west:{t:1}}}},maxZoom:{t:1},minZoom:{t:1}}}},style:{t:5,u:0,c:function(){return{fadeTime:{t:1},selection:{t:5,u:0,c:function(){return{fillColor:{t:0},sizeConstant:{t:1},sizeProportional:{t:1}}}}}}},theme:{t:5,c:function(){return t.GeoChartSettings},x:function(){return i.GeoChart.Settings},y:!0},toolbar:{t:5,u:0,c:function(){return t.BaseSettingsToolbar},x:function(){return i.Base.SettingsToolbar}}},t.GeoChartSettingsAggregatedShapeStyle={mode:{t:2,e:function(){return e.GeoChartSettingsAggregatedShapeStyleMode}}},t.GeoChartSettingsAggregation={distance:{t:1,d:0},enabled:{t:9},maxZoom:{t:1,d:0},postProcessAggregatedNodes:{t:4},weightFunction:{t:4}},t.GeoChartSettingsArea={style:{t:5,u:0,c:function(){return t.GeoChartSettingsAreaStyle},x:function(){return i.GeoChart.SettingsAreaStyle}}},t.GeoChartSettingsAreaStyle={},t.GeoChartSettingsBackground={enabled:{t:9},params:{t:5,u:0,c:function(){return t.GeoChartSettingsBackgroundParams}},type:{t:7,b:[{t:0}]},url:{t:0}},t.GeoChartSettingsBackgroundParams={attribution:{t:0},continuousWorld:{t:9},detectRetina:{t:9},errorTileUrl:{t:0},maxNativeZoom:{t:1},maxZoom:{t:1},minZoom:{t:1},noWrap:{t:9},opacity:{t:1},reuseTiles:{t:9},subdomains:{t:7,u:0,b:[{t:0},{t:6,u:0,b:[{t:0}]}]},tileSize:{t:1},tms:{t:9},unloadInvisibleTiles:{t:9},updateWhenIdle:{t:9},zIndex:{t:1},zoomOffset:{t:1},zoomReverse:{t:9}},t.GeoChartSettingsData={aggregationGridSize:{t:1},aggregationMinCount:{t:1},bounds:{t:12,b:[{t:1},{t:1},{t:1},{t:1}]},dataFunction:{t:4},maxRequestRect:{t:12,b:[{t:1},{t:1}]},perBoundsData:{t:9},perDrilldownData:{t:9},perZoomData:{t:9},prefetchRatio:{t:1},preloaded:{t:5,c:function(){return t.GeoChartIDataObject}},useGridBasedAggregation:{t:9},wrapLng:{t:9}},t.GeoChartSettingsInteraction={mode:{t:0,d:6}},t.GeoChartSettingsLayerAggregated={aggregation:{t:0,d:6},aggregationField:{t:0},aggregationFunction:{t:4},shapesLayer:{t:0},styleFunction:{t:4}},t.GeoChartSettingsLayerBase={data:{t:5,u:0,c:function(){return{id:{t:0}}}},enabled:{t:9},id:{t:0},maxZoom:{t:1,d:0},minZoom:{t:1,d:0},name:{t:0},perZoomStyle:{t:9},type:{t:0,d:6}},t.GeoChartSettingsLayerCharts={chartType:{t:0,d:6},data:{t:5,u:0,c:function(){return{id:{t:0}}}},settings:{t:7,b:[{t:5,c:function(){return t.PieChartSettings},x:function(){return i.PieChart.Settings},y:!0},{t:5,c:function(){return t.TimeChartSettings},x:function(){return i.TimeChart.Settings},y:!0},{t:5,c:function(){return t.FacetChartSettings},x:function(){return i.FacetChart.Settings},y:!0}]},settingsFunction:{t:4},shapesLayer:{t:0}},t.GeoChartSettingsLayerItems={aggregation:{t:5,u:0,c:function(){return t.GeoChartSettingsAggregation},x:function(){return i.GeoChart.SettingsAggregation}},auras:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodesLayerAuras},x:function(){return i.ItemsChart.SettingsNodesLayerAuras}},layout:{t:5,u:0,c:function(){return t.GeoChartSettingsNodesLayout},x:function(){return i.GeoChart.SettingsNodesLayout}},style:{t:5,u:0,c:function(){return t.GeoChartSettingsNodesLayerStyle},x:function(){return i.GeoChart.SettingsNodesLayerStyle}}},t.GeoChartSettingsLayerOverlay={shapesLayer:{t:0}},t.GeoChartSettingsLayerShapes={style:{t:5,u:0,c:function(){return t.GeoChartSettingsShapesLayerStyle},x:function(){return i.GeoChart.SettingsShapesLayerStyle}}},t.GeoChartSettingsNodesLayerStyle={aggregatedShape:{t:5,u:0,c:function(){return t.GeoChartSettingsAggregatedShapeStyle}}},t.GeoChartSettingsNodesLayout={anchorStrength:{t:1},mode:{t:0,d:6},nodeSpacing:{t:1,d:0}},t.GeoChartSettingsShapesLayerNodeStyle={expandable:{t:9}},t.GeoChartSettingsShapesLayerStyle={node:{t:5,u:0,c:function(){return t.GeoChartSettingsShapesLayerNodeStyle}},shapeSimplificationPrecision:{t:1}},t.ItemsChartIChartClickEventArguments={},t.ItemsChartIChartEventArguments={},t.ItemsChartIDataObjectBase={},t.ItemsChartIDataObjectLink={className:{t:0},from:{t:0},id:{t:0},style:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkStyle}},to:{t:0}},t.ItemsChartIDataObjectNode={className:{t:0},id:{t:0},loaded:{t:9},style:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}}},t.ItemsChartSettings={advanced:{t:5,u:0,c:function(){return t.ItemsChartSettingsAdvanced},x:function(){return i.ItemsChart.SettingsAdvanced}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsData},x:function(){return i.ItemsChart.SettingsData}}]},events:{t:5,u:0,c:function(){return t.BaseSettingsEvents(t.ItemsChartIChartEventArguments,t.ItemsChartIChartClickEventArguments)},x:function(){return i.Base.SettingsEvents}},info:{t:5,u:0,c:function(){return{enabled:{t:9},linkContentsFunction:{t:4},nodeContentsFunction:{t:4}}}},interaction:{t:5,u:0,c:function(){return t.ItemsChartSettingsInteraction},x:function(){return i.ItemsChart.SettingsInteraction}},linkMenu:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkMenu},x:function(){return i.ItemsChart.SettingsLinkMenu}},nodeMenu:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeMenu},x:function(){return i.ItemsChart.SettingsNodeMenu}},style:{t:5,u:0,c:function(){return{}}}},t.ItemsChartSettingsAdvanced={perNodeLoadingIndicator:{t:9}},t.ItemsChartSettingsAuraStyle={enabled:{t:9},legendGroupId:{t:0},nameLegend:{t:0},showInLegend:{t:9},zIndex:{t:1}},t.ItemsChartSettingsCustomShape={distanceToEdge:{t:4
  32. },hitTest:{t:4},onUpdate:{t:4},paint:{t:4},paintSelection:{t:4}},t.ItemsChartSettingsData={cacheSize:{t:1,d:0},random:{t:0,d:6},randomGridLinkProbability:{t:1},randomLinks:{t:1,d:0},randomNodes:{t:1,d:0},randomTreeDensity:{t:1},requestMaxUnits:{t:1,d:0}},t.ItemsChartSettingsInteraction={nodesMovable:{t:9},panning:{t:5,u:0,c:function(){return{enabled:{t:9}}}},selection:{t:5,u:0,c:function(){return t.ItemsChartSettingsInteractionSelection},x:function(){return i.ItemsChart.SettingsInteractionSelection}},zooming:{t:5,u:0,c:function(){return t.ItemsChartSettingsInteractionZooming},x:function(){return i.ItemsChart.SettingsInteractionZooming}}},t.ItemsChartSettingsInteractionSelection={allowMoveNodesOffscreen:{t:9},enabled:{t:9},linksSelectable:{t:9},lockNodesOnMove:{t:9},nodesSelectable:{t:9},tolerance:{t:1}},t.ItemsChartSettingsInteractionZooming={autoZoomAfterClick:{t:9},doubleClickZoom:{t:1},fingers:{t:9},sensitivity:{t:1},wheel:{t:9},zoomInOnDoubleClick:{t:9}},t.ItemsChartSettingsItemClass={className:{t:0},legendGroupId:{t:0},nameLegend:{t:0},showInLegend:{t:9}},t.ItemsChartSettingsItemsLayerItemStyle={hoverEffect:{t:9},zIndex:{t:1}},t.ItemsChartSettingsItemsLayerLabelStyle={scaleWithSize:{t:9},scaleWithZoom:{t:9}},t.ItemsChartSettingsItemsLayerLinkLabelStyle={rotateWithLink:{t:9}},t.ItemsChartSettingsItemsLayerStyle={allObjectsStyleFunction:{t:4},item:{t:5,u:0,c:function(){return t.ItemsChartSettingsItemsLayerItemStyle}},link:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkStyle}},linkClasses:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkClass},x:function(){return i.ItemsChart.SettingsLinkClass}}]},linkDecorationMinSize:{t:1},linkDecorationScale:{t:1},linkDetailMinSize:{t:1},linkDetailMinZoom:{t:1},linkHovered:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkStyle}},linkLabel:{t:5,u:0,c:function(){return t.ItemsChartSettingsItemsLayerLinkLabelStyle}},linkLabelScaleBase:{t:1},linkRules:{t:8,u:0,b:[{t:4}]},linkSelected:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkStyle}},linkStyleFunction:{t:4},node:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeAnchor:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeAnchorStyle}},nodeBackground:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeClasses:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeClass},x:function(){return i.ItemsChart.SettingsNodeClass}}]},nodeDetailMinSize:{t:1},nodeDetailMinZoom:{t:1},nodeExpanded:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeFocused:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeHovered:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeLabel:{t:5,u:0,c:function(){return t.ItemsChartSettingsItemsLayerLabelStyle}},nodeLabelScaleBase:{t:1},nodeLocked:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeNotLoaded:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeRules:{t:8,u:0,b:[{t:4}]},nodeSelected:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}},nodeStyleFunction:{t:4},removedColor:{t:0,d:3},scaleLinksWithZoom:{t:9},scaleObjectsWithZoom:{t:9},selection:{t:5,u:0,c:function(){return{enabled:{t:9},fillColor:{t:0},lineColor:{t:0},lineWidth:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1},sizeConstant:{t:1},sizeProportional:{t:1}}}}},t.ItemsChartSettingsLinkClass={style:{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkStyle}}},t.ItemsChartSettingsLinkItem={lx:{t:1},ly:{t:1},px:{t:1},py:{t:1},rotateWithLink:{t:9},x:{t:1},y:{t:1}},t.ItemsChartSettingsLinkMenu={contentsFunction:{t:4}},t.ItemsChartSettingsLinkStyle={cursor:{t:0},direction:{t:0},fillColor:{t:0},fromDecoration:{t:0,d:6},invisible:{t:9},items:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsLinkItem}}]},label:{t:0},length:{t:1},lineDash:{t:6,u:0,b:[{t:1}]},radius:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1},strength:{t:1},toDecoration:{t:0,d:6},toPieColor:{t:0},toPieValue:{t:1}},t.ItemsChartSettingsMenu={buttons:{t:6,u:0,b:[{t:7,u:0,b:[{t:0},{t:5,u:0,c:function(){return t.ItemsChartSettingsMenuButton},x:function(){return i.ItemsChart.SettingsMenuButton}}]}]},contentsFunction:{t:4},enabled:{t:9},showData:{t:9}},t.ItemsChartSettingsMenuButton={className:{t:0},onClick:{t:4},onInit:{t:4},onRefresh:{t:4},text:{t:0}},t.ItemsChartSettingsNodeAnchorStyle={lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}},t.ItemsChartSettingsNodeClass={style:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeStyle}}},t.ItemsChartSettingsNodeItem={px:{t:1},py:{t:1},x:{t:1},y:{t:1}},t.ItemsChartSettingsNodeMenu={contentsFunction:{t:4}},t.ItemsChartSettingsNodeStyle={anchorMode:{t:2,e:function(){return i.ItemsChart.NodeAnchorMode}},anchorStyle:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeAnchorStyle}},anchorX:{t:1},anchorY:{t:1},aspectRatio:{t:1},aura:{t:7,u:0,b:[{t:0},{t:6,u:0,b:[{t:0}]}]},coordinates:{t:7,u:0,b:[{t:6,u:0,b:[{t:1}]},{t:6,u:0,b:[{t:6,u:0,b:[{t:1}]}]}]},cursor:{t:0,d:7},customShape:{t:5,u:0,c:function(){return t.ItemsChartSettingsCustomShape}},display:{t:0},fillColor:{t:0},image:{t:0},imageCropping:{t:7,b:[{t:0},{t:9}]},invisible:{t:9},items:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsNodeItem}}]},label:{t:0},labelStyle:{t:5,u:0,c:function(){return t.ItemsChartSettingsItemsLayerLabelStyle}},lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1},opacity:{t:1},radius:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}},t.ItemsChartSettingsNodesLayerAuras={cellSize:{t:1},defaultColors:{t:6,u:0,b:[{t:0}]},defaultStyle:{t:5,u:0,c:function(){return t.ItemsChartSettingsAuraStyle}},drawLimit:{t:1},enabled:{t:9},intensity:{t:1},overlap:{t:9},style:{t:8,u:0,b:[{t:5,u:0,c:function(){return t.ItemsChartSettingsAuraStyle}}]}},t.ItemsChartSettingsNodesLayerStyle={fadeTime:{t:1,d:0},hiddenLinks:{t:5,u:0,c:function(){return{lineColor:{t:0},lineWidth:{t:1},size:{t:1}}}},linkAutoScaling:{t:0,d:6},linkLengthAutoScaling:{t:0,d:6},linkLengthExtent:{t:12,b:[{t:1},{t:1}]},linkRadiusExtent:{t:12,b:[{t:1},{t:1}]},linkStrengthAutoScaling:{t:0,d:6},linkStrengthExtent:{t:12,b:[{t:1},{t:1}]},multilinkSpacing:{t:1},nodeAutoScaling:{t:0,d:6},nodeRadiusExtent:{t:12,b:[{t:1,d:0},{t:1,d:0}]}},t.LinearChartSettings={area:{t:5,u:0,c:function(){return t.LinearChartSettingsArea},x:function(){return i.LinearChart.SettingsArea}},chartTypes:{t:5,u:0,c:function(){return{candlestick:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesCandleStick},x:function(){return i.LinearChart.SettingsSeriesCandleStick},y:!0},columns:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesColumns},x:function(){return i.LinearChart.SettingsSeriesColumns},y:!0},line:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesLines},x:function(){return i.LinearChart.SettingsSeriesLines},y:!0}}}},events:{t:5,u:0,c:function(){return t.LinearChartSettingsEvents(t.BaseIChartEventArguments,t.BaseIChartEventArguments)},x:function(){return i.LinearChart.SettingsEvents}},info:{t:5,u:0,c:function(){return t.LinearChartSettingsInfoPopup},x:function(){return i.LinearChart.SettingsInfoPopup}},interaction:{t:5,u:0,c:function(){return t.LinearChartSettingsInteraction},x:function(){return i.LinearChart.SettingsInteraction}},legend:{t:5,u:0,c:function(){return t.LinearChartSettingsLegend},x:function(){return i.LinearChart.SettingsLegend}},localization:{t:5,u:0,c:function(){return t.LinearChartSettingsLocalization},x:function(){return i.LinearChart.SettingsLocalization}},series:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.LinearChartSettingsSeries},x:function(){return i.LinearChart.SettingsSeries},y:!0}]},seriesDefault:{t:5,u:0,c:function(){return t.LinearChartSettingsSeries},x:function(){return i.LinearChart.SettingsSeries},y:!0},stacks:{t:8,u:0,b:[{t:5,u:0,c:function(){return t.LinearChartSettingsStack},x:function(){return i.LinearChart.SettingsStack}}]},style:{t:5,u:0,c:function(){return{columnColors:{t:6,u:0,b:[{t:0}]},lineColors:{t:6,u:0,b:[{t:0}]}}}},valueAxis:{t:8,u:0,b:[{t:5,u:0,c:function(){return t.LinearChartSettingsValueAxis},x:function(){return i.LinearChart.SettingsValueAxis},y:!0}]},valueAxisDefault:{t:5,u:0,c:function(){return t.LinearChartSettingsValueAxis},x:function(){return i.LinearChart.SettingsValueAxis}}},t.LinearChartSettingsArea={style:{t:5,u:0,c:function(){return t.LinearChartSettingsAreaStyle},x:function(){return i.LinearChart.SettingsAreaStyle}}},t.LinearChartSettingsAreaStyle={noData:{t:5,u:0,c:function(){return{fillColor:{t:0},image:{t:0,d:5}}}},zoomHighlight:{t:5,u:0,c:function(){return t.LinearChartSettingsHighlightStyle}},zoomHighlightInactive:{t:5,u:0,c:function(){return{fillColor:{t:0}}}}},t.LinearChartSettingsCandleStickMotionStyle={bar:{t:5,u:0,c:function(){return{lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}}}},candlestick:{t:5,u:0,c:function(){return{fillColor:{t:0},lineColor:{t:0,d:3},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1},shadowBlur:{t:1},shadowColor:{t:0},shadowOffsetX:{t:1},shadowOffsetY:{t:1}}}}},t.LinearChartSettingsEvents=function(t,e){return{onAnimationDone:{t:4}}},t.LinearChartSettingsHighlightStyle={fadeIn:{t:1,d:0},fadeOut:{t:1,d:0},fillColor:{t:0}},t.LinearChartSettingsInfoPopup={advanced:{t:5,u:0,c:function(){return{contentsFunction:{t:4},scope:{t:0,d:6},showHeader:{t:9},showOnlyHoveredSeries:{t:9}}}},aggregations:{t:6,u:0,b:[{t:0,d:6}]},enabled:{t:9},position:{t:0,d:6},showNoData:{t:9},style:{t:5,u:0,c:function(){return{highlight:{t:5,u:0,c:function(){return t.LinearChartSettingsHighlightStyle}}}}},valueFormatterFunction:{t:4}},t.LinearChartSettingsInteraction={ignoreBottomAxis:{t:9},scrolling:{t:5,u:0,c:function(){return t.LinearChartSettingsInteractionScrolling},x:function(){return i.LinearChart.SettingsInteractionScrolling}},swipeSensitivity:{t:1},zooming:{t:5,u:0,c:function(){return t.LinearChartSettingsInteractionZooming},x:function(){return i.LinearChart.SettingsInteractionZooming}}},t.LinearChartSettingsInteractionScrolling={enabled:{t:9},kineticFriction:{t:1},maxAnimationLength:{t:1,d:0},swipePageFlipping:{t:9}},t.LinearChartSettingsInteractionZooming={enabled:{t:9},fingers:{t:9},fingersMaxZoom:{t:1},sensitivity:{t:1},swipe:{t:9},upDownTreshold:{t:1},wheel:{t:9},wheelSensitivity:{t:1},zoomHighlightThreshold:{t:1}},t.LinearChartSettingsLegend={advanced:{t:5,u:0,c:function(){return t.LinearChartSettingsLegendAdvanced},x:function(){return i.LinearChart.SettingsLegendAdvanced}},marker:{t:5,u:0,c:function(){return t.LinearChartSettingsLegendMarker},x:function(){return i.LinearChart.SettingsLegendMarker}},panel:{t:5,u:0,c:function(){return t.BaseSettingsLegendPanel},x:function(){return i.Base.SettingsLegendPanel}}},t.LinearChartSettingsLegendAdvanced={disabledSeries:{t:5,u:0,c:function(){return{fillColor:{t:0},lineColor:{t:0},textColor:{t:0}}}}},t.LinearChartSettingsLegendMarker={shape:{t:7,d:6,b:[{t:0}]}},t.LinearChartSettingsLocalization={noDataLabel:{t:0},toolbar:{t:5,u:0,c:function(){return t.LinearChartSettingsLocalizationToolbar},x:function(){return i.LinearChart.SettingsLocalizationToolbar}},unnamedSeries:{t:0},valueUnits:{t:8,u:0,b:[{t:1,d:0}]}},t.LinearChartSettingsLocalizationToolbar={linButton:{t:0},linLogTitle:{t:0},logButton:{t:0}},t.LinearChartSettingsSeries={cluster:{t:0},data:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesData},x:function(){return i.LinearChart.SettingsSeriesData}},enabled:{t:9},extra:{t:10},id:{t:0},legendGroupId:{t:0},name:{t:0},nameLegend:{t:0},showInLegend:{t:9},stack:{t:0},style:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesStyle},x:function(){return i.LinearChart.SettingsSeriesStyle}},type:{t:0,d:6},valueAxis:{t:0}},t.LinearChartSettingsSeriesCandleStick={localization:{t:5,u:0,c:function(){return{close:{t:0},high:{t:0},low:{t:0},open:{t:0}}}},style:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesCandleStickStyle},x:function(){return i.LinearChart.SettingsSeriesCandleStickStyle}}},t.LinearChartSettingsSeriesCandleStickStyle={decrease:{t:5,u:0,c:function(){return t.LinearChartSettingsCandleStickMotionStyle}},increase:{t:5,u:0,c:function(){return t.LinearChartSettingsCandleStickMotionStyle}},padding:{t:12,b:[{t:1,d:0},{t:1,d:0}]},pattern:{t:0,d:6}},t.LinearChartSettingsSeriesColumns={style:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesColumnsStyle},x:function(){return i.LinearChart.SettingsSeriesColumnsStyle}},valueLabels:{t:5,u:0,c:function(){return t.LinearChartSettingsValueLabels}}},t.LinearChartSettingsSeriesColumnsStyle={depth:{t:1},depthBrightness:{t:1},gradient:{t:1},lineColor:{t:0,d:3},minHeight:{t:1,d:0},padding:{t:12,b:[{t:1,d:0},{t:1,d:0}]},shadowBlur:{t:1,d:0}},t.LinearChartSettingsSeriesData={aggregatedValueFunction:{t:4},aggregation:{t:0,d:6},noDataPolicy:{t:0,d:6},source:{t:0},valueFunction:{t:4}},t.LinearChartSettingsSeriesLines={style:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesLinesStyle},x:function(){return i.LinearChart.SettingsSeriesLinesStyle}},valueLabels:{t:5,u:0,c:function(){return t.LinearChartSettingsValueLabels}}},t.LinearChartSettingsSeriesLinesStyle={marker:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesStyleMarker}},markerStyleFunction:{t:4},shadowBlur:{t:1,d:0},smoothing:{t:9},steps:{t:9}},t.LinearChartSettingsSeriesStyle={depth:{t:1},fillColor:{t:0,d:3},fillGradient:{t:11},fillPattern:{t:0},legend:{t:5,u:0,c:function(){return{marker:{t:5,u:0,c:function(){return t.LinearChartSettingsSeriesStyleMarker}},textColor:{t:0,d:3}}}},lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1},shadowColor:{t:0,d:3},shadowOffsetX:{t:1,d:0},shadowOffsetY:{t:1,d:0}},t.LinearChartSettingsSeriesStyleMarker={fillColor:{t:0,d:3},lineColor:{t:0,d:3},lineWidth:{t:1},shape:{t:7,d:6,b:[{t:0}]},width:{t:1,d:0}},t.LinearChartSettingsStack={name:{t:0},separateNegativeValues:{t:9},type:{t:0,d:6}},t.LinearChartSettingsValueAxis={axisLine:{t:9},enabled:{t:9},hgrid:{t:9},logScale:{t:9},maxValue:{t:1},minValue:{t:1},position:{t:0,d:6},scaleAdjustmentAnimation:{t:0,d:6},scaleAdjustmentAnimationDelay:{t:1,d:0},scaleAdjustmentTolerance:{t:1},scaleMinStep:{t:1},scaleStep:{t:1},side:{t:7,b:[{t:0}]},size:{t:1,d:0},style:{t:5,u:0,c:function(){return{axisLine:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},baseLine:{t:5,u:0,c:function(){return t.LinearChartSettingsValueAxisBaseLineStyle}},hgrid:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},labelSpacing:{t:1},tick:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},title:{t:5,u:0,c:function(){return t.LinearChartSettingsValueAxisTitleStyle}},valueLabel:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}}}}},thresholds:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.LinearChartSettingsValueAxisThreshold},x:function(){return i.LinearChart.SettingsValueAxisThreshold}}]},title:{t:0},valueFormatterFunction:{t:4},zeroLine:{t:0,d:6}},t.LinearChartSettingsValueAxisBaseLineStyle={depthColor:{t:0,d:3},lineDepth:{t:1,d:0},showLabel:{t:2,e:function(){return e.LinearChartSettingsValueAxisBaseLineLabelMode}}},t.LinearChartSettingsValueAxisThreshold={from:{t:1},position:{t:0,d:6},style:{t:5,u:0,c:function(){return{fillColor:{t:0,d:3},lineColor:{t:0,d:3},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1}}}},to:{t:1}},t.LinearChartSettingsValueAxisTitleStyle={reverseDirection:{t:9}},t.LinearChartSettingsValueLabels={contentsFunction:{t:4},enabled:{t:9},minFontSize:{t:1},position:{t:0,d:6},style:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}},useStackedValue:{t:9}},t.NetChartBarSettingsLocalizationToolbar={fitButton:{t:0},fitTitle:{t:0},freezeButton:{t:0},freezeTitle:{t:0},rearrangeButton:{t:0},rearrangeTitle:{t:0},unfreezeTitle:{t:0}},t.NetChartBarSettingsToolbar={zoomControl:{t:9}},t.NetChartIChartClickEventArguments={},t.NetChartIChartEventArguments={},t.NetChartIDataObject={links:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.NetChartIDataObjectLink}}]},nodes:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.NetChartIDataObjectNode}}]}},t.NetChartIDataObjectLink={},t.NetChartIDataObjectNode={x:{t:1},y:{t:1}},t.NetChartSettings={area:{t:5,u:0,c:function(){return t.NetChartSettingsArea},x:function(){return i.NetChart.SettingsArea}},auras:{t:5,u:0,c:function(){return t.ItemsChartSettingsNodesLayerAuras},x:function(){return i.ItemsChart.SettingsNodesLayerAuras}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.NetChartSettingsData},x:function(){return i.NetChart.SettingsData}}]},events:{t:5,u:0,c:function(){return t.BaseSettingsEvents(t.NetChartIChartEventArguments,t.NetChartIChartClickEventArguments)},x:function(){return i.Base.SettingsEvents}},filters:{t:5,u:0,c:function(){return{linkFilter:{t:4},multilinkProcessor:{t:4},nodeFilter:{t:4},nodeLinksProcessor:{t:4}}}},interaction:{t:5,u:0,c:function(){return t.NetChartSettingsInteraction},x:function(){return i.NetChart.SettingsInteraction}},layout:{t:5,u:0,c:function(){return t.NetChartSettingsLayout},x:function(){return i.NetChart.SettingsLayout}},legend:{t:5,u:0,c:function(){return t.NetChartSettingsLegend},x:function(){return i.NetChart.SettingsLegend}},localization:{t:5,u:0,c:function(){return t.NetChartSettingsLocalization},x:function(){return i.NetChart.SettingsLocalization}},navigation:{t:5,u:0,c:function(){return t.NetChartSettingsNavigation},x:function(){return i.NetChart.SettingsNavigation}},style:{t:5,u:0,c:function(){return t.NetChartSettingsStyle},x:function(){return i.NetChart.SettingsStyle}},theme:{t:5,c:function(){return t.NetChartSettings},x:function(){return i.NetChart.Settings},y:!0},toolbar:{t:5,u:0,c:function(){return t.NetChartBarSettingsToolbar},x:function(){return i.NetChart.Bar.SettingsToolbar}}},t.NetChartSettingsArea={centerX:{t:1},centerY:{t:1},paddingBottom:{t:1},paddingLeft:{t:1},paddingRight:{t:1},paddingTop:{t:1}},t.NetChartSettingsData={dataFunction:{t:4},preloaded:{t:5,c:function(){return t.NetChartIDataObject}}},t.NetChartSettingsInteraction={rotation:{t:5,u:0,c:function(){return{fingers:{t:9}}}},selection:{t:5,u:0,c:function(){return t.NetChartSettingsInteractionSelection},x:function(){return i.NetChart.SettingsInteractionSelection}},zooming:{t:5,u:0,c:function(){return t.NetChartSettingsInteractionZooming},x:function(){return i.NetChart.SettingsInteractionZooming}}},t.NetChartSettingsInteractionSelection={dragSelect:{t:9}},t.NetChartSettingsInteractionZooming={autoZoomExtent:{t:12,b:[{t:1},{t:1}]},autoZoomPositionEllasticity:{t:1},autoZoomSize:{t:1},initialAutoZoom:{t:0,d:6},zoomExtent:{t:12,b:[{t:1},{t:1}]}},t.NetChartSettingsLayout={advanced:{t:5,u:0,c:function(){return{adaptiveFreezeTreshold:{t:1}}}},aspectRatio:{t:9},globalLayoutOnChanges:{t:9},groupSpacing:{t:1,d:0},incrementalLayoutMaxTime:{t:1,d:0},initialLayoutMaxTime:{t:1,d:0},layoutFreezeMinTimeout:{t:1,d:0},layoutFreezeTimeout:{t:1,d:0},mode:{t:0,d:6},nodeSpacing:{t:1,d:0},rotation:{t:1},rowSpacing:{t:1,d:0},twoRingRadialLayout:{t:9}},t.NetChartSettingsLegend={advanced:{t:5,u:0,c:function(){return t.NetChartSettingsLegendAdvanced},x:function(){return i.NetChart.SettingsLegendAdvanced}},panel:{t:5,u:0,c:function(){return t.BaseSettingsLegendPanel},x:function(){return i.Base.SettingsLegendPanel}}},t.NetChartSettingsLegendAdvanced={showItemsWithClasses:{t:7,d:6,b:[{t:0}]},textColorDisabled:{t:0}},t.NetChartSettingsLocalization={menu:{t:5,u:0,c:function(){return{close:{t:0},collapse:{t:0},dynamic:{t:0},expand:{t:0},fixed:{t:0},focus:{t:0},hide:{t:0},unfocus:{t:0}}}},toolbar:{t:5,u:0,c:function(){return t.NetChartBarSettingsLocalizationToolbar},x:function(){return i.NetChart.Bar.SettingsLocalizationToolbar}}},t.NetChartSettingsNavigation={autoUnfocus:{t:9},autoZoomOnFocus:{t:9},expandDelay:{t:1,d:0},expandOnClick:{t:9},focusAutoFadeout:{t:9},focusNodeExpansionRadius:{t:1},focusNodeTailExpansionRadius:{t:1},initialNodes:{t:6,u:0,b:[{t:0}]},minNumberOfFocusNodes:{t:1,d:0},mode:{t:0,d:6},numberOfFocusNodes:{t:1,d:0}},t.NetChartSettingsStyle={dragSelection:{t:5,u:0,c:function(){return t.BaseSettingsBackgroundStyle}}},t.PieChartIChartClickEventArguments={},t.PieChartIChartEventArguments={},t.PieChartIDataObject={id:{t:0},name:{t:0},nameLegend:{t:0},style:{t:5,u:0,c:function(){return t.PieChartSettingsSliceStyle}},subvalues:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.PieChartIDataObject}}]},value:{t:1}},t.PieChartIDataObjectCommon={id:{t:0},name:{t:0},subvalues:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.PieChartIDataObject}}]}},t.PieChartIDataObjectRoot={afterSum:{t:1},beforeSum:{t:1},id:{t:0},limit:{t:1},name:{t:0},offset:{t:1},subvalues:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.PieChartIDataObject}}]},sum:{t:1}},t.PieChartSettings={advanced:{t:5,u:0,c:function(){return t.PieChartSettingsAdvanced},x:function(){return i.PieChart.SettingsAdvanced}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.PieChartSettingsData},x:function(){return i.PieChart.SettingsData}}]},events:{t:5,u:0,c:function(){return t.PieChartSettingsEvents},x:function(){return i.PieChart.SettingsEvents}},filters:{t:5,u:0,c:function(){return{allowZeroValues:{t:9},sliceFilter:{t:4}}}},icons:{t:5,u:0,c:function(){return{autohideWhenTooSmall:{t:9},placement:{t:0,d:6},sizeExtent:{t:12,b:[{t:1},{t:1}]}}}},info:{t:5,u:0,c:function(){return{contentsFunction:{t:4},enabled:{t:9}}}},interaction:{t:5,u:0,c:function(){return t.PieChartSettingsInteraction},x:function(){return i.PieChart.SettingsInteraction}},labels:{t:5,u:0,c:function(){return t.PieChartSettingsLabels},x:function(){return i.PieChart.SettingsLabels}},legend:{t:5,u:0,c:function(){return t.PieChartSettingsLegend},x:function(){return i.PieChart.SettingsLegend}},localization:{t:5,u:0,c:function(){return t.PieChartSettingsLocalization},x:function(){return i.PieChart.SettingsLocalization}},navigation:{t:5,u:0,c:function(){return{initialDrilldown:{t:6,u:0,b:[{t:0}]},initialOffset:{t:1,d:0}}}},pie:{t:5,u:0,c:function(){return{adaptiveRadius:{t:9},backgroundHoveredStyle:{t:5,u:0,c:function(){return t.PieChartSettingsPieStyle}},backgroundStyle:{t:5,u:0,c:function(){return t.PieChartSettingsPieStyle}},centerMargin:{t:1,d:0},depth:{t:1,d:0},endAngle:{t:1},innerRadius:{t:1},innerRadiusWhenDrilldown:{t:1},margin:{t:1},noDataStyle:{t:5,u:0,c:function(){return t.PieChartSettingsPieStyle}},outerMargin:{t:1},radius:{t:1},rotationSpeed:{t:1},showInnerPies:{t:9},showInnerPiesExport:{t:9},startAngle:{t:1},style:{t:5,u:0,c:function(){return t.PieChartSettingsPieStyle}},styleFunction:{t:4},theme:{t:0,d:6},x:{t:1},y:{t:1}}}},slice:{t:5,u:0,c:function(){return{backgroundActiveStyle:{t:5,u:0,c:function(){return{brightness:{t:1}}}},backgroundStyle:{t:5,u:0,c:function(){return{fillColor:{t:0},fillColor2:{t:0,d:3}}}},connectorStyle:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},expandableMarkStyle:{t:5,u:0,c:function(){return{distance:{t:1},lineColor:{t:0},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1}}}},hoverStyle:{t:5,u:0,c:function(){return t.PieChartSettingsSliceStyle}},margin:{t:1},minFraction:{t:1},othersStyle:{t:5,u:0,c:function(){return{fillColor:{t:0},lineDecoration:{t:0,d:6}}}},previousStyle:{t:5,u:0,c:function(){return{fillColor:{t:0},lineDecoration:{t:0,d:6}}}},selectedStyle:{t:5,u:0,c:function(){return t.PieChartSettingsSliceStyle}},style:{t:5,u:0,c:function(){return t.PieChartSettingsSliceStyle}},styleFunction:{t:4}}}},theme:{t:5,c:function(){return t.PieChartSettings},x:function(){return i.PieChart.Settings},y:!0},toolbar:{t:5,u:0,c:function(){return t.BaseSettingsToolbar},x:function(){return i.Base.SettingsToolbar}}},t.PieChartSettingsAdvanced={backAlwaysVisible:{t:9},backImage:{t:0,d:4},backImageBackground:{t:0},iconMinSize:{t:1},initialAnimation:{t:9},labelInsideTreshold:{t:1,d:0},renderQuality:{t:1,d:0}},t.PieChartSettingsData={autoCategories:{t:6,u:0,b:[{t:7,b:[{t:0},{t:4}]}]},dataFunction:{t:4},itemsToLoad:{t:1,d:0},partialLoad:{t:9},preloaded:{t:5,c:function(){return t.PieChartIDataObjectRoot}},sortField:{t:7,u:0,b:[{t:0},{t:6,u:0,b:[{t:0}]},{t:4}]}},t.PieChartSettingsEvents={onPieChange:{t:4},onPieReadyStateChanged:{t:4}},t.PieChartSettingsInteraction={animation:{t:5,u:0,c:function(){return{hoverDuration:{t:1,d:0},scrollDuration:{t:1,d:0}}}},coverCenter:{t:9},mode:{t:0,d:6},others:{t:5,u:0,c:function(){return{centerGoesToPrevious:{t:9},enabled:{t:9},maxOthersFraction:{t:1},maxSlicesVisible:{t:1,d:0},minSliceFraction:{t:1},minSlices:{t:1},navigationFraction:{t:1}}}},scrolling:{t:5,u:0,c:function(){return{enabled:{t:9}}}},selection:{t:5,u:0,c:function(){return{enabled:{t:9},maxSwipeDistance:{t:1},partialSwipe:{t:9},swipe:{t:9},swipeSensitivity:{t:1},tolerance:{t:1}}}}},t.PieChartSettingsLabels={angle:{t:1,d:0},connectorLength:{t:1,d:0},connectors:{t:9},enabled:{t:9},insideLabel:{t:0,d:6},insideLabelVisibilityFraction:{t:1},interLabelSpacing:{t:1},placement:{t:0,d:6}},t.PieChartSettingsLegend={marker:{t:5,u:0,c:function(){return t.PieChartSettingsLegendMarker},x:function(){return i.PieChart.SettingsLegendMarker}},showOthers:{t:9}},t.PieChartSettingsLegendMarker={shape:{t:7,d:6,b:[{t:0}]}},t.PieChartSettingsLocalization={othersLabel:{t:0},previousLabel:{t:0}},t.PieChartSettingsPieStyle={background:{t:9},brightness:{t:1},colorDistribution:{t:0,d:6},fillColor:{t:0,d:3},sliceColors:{t:6,u:0,b:[{t:0,d:3}]}},t.PieChartSettingsSliceStyle={brightness:{t:1},cutoutDistance:{t:1},expandable:{t:9},fillColor:{t:0,d:3},icon:{t:0,d:4},insideLabel:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}},label:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}},lineBrightness:{t:1,d:0},lineColor:{t:0,d:3},lineDash:{t:6,u:0,b:[{t:1}]},lineWidth:{t:1,d:0},url:{t:0,d:5}},t.TimeChartIChartEventArguments={},t.TimeChartIDataObject={data:{t:6,u:0,b:[{t:6,u:0,b:[{t:7,b:[{t:1},{t:0}]}]}]},dataLimitFrom:{t:7,b:[{t:1},{t:0}]},dataLimitTo:{t:7,b:[{t:1},{t:0}]},from:{t:7,b:[{t:1},{t:0}]},timeZone:{t:0},to:{t:7,b:[{t:1},{t:0}]},unit:{t:0},values:{t:6,u:0,b:[{t:7,u:0,b:[{t:6,u:0,b:[{t:7,b:[{t:1},{t:0}]}]},{t:15},{t:16},{t:17},{t:18}]}]}},t.TimeChartSettings={advanced:{t:5,u:0,c:function(){return t.TimeChartSettingsAdvanced},x:function(){return i.TimeChart.SettingsAdvanced}},area:{t:5,u:0,c:function(){return t.TimeChartSettingsArea},x:function(){return i.TimeChart.SettingsArea}},chartTypes:{t:5,u:0,c:function(){return{candlestick:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesCandleStick},x:function(){return i.TimeChart.SettingsSeriesCandleStick},y:!0},columns:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesColumns},x:function(){return i.TimeChart.SettingsSeriesColumns},y:!0},line:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesLines},x:function(){return i.TimeChart.SettingsSeriesLines},y:!0}}}},currentTime:{t:5,u:0,c:function(){return t.TimeChartSettingsCurrentTime},x:function(){return i.TimeChart.SettingsCurrentTime}},data:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.TimeChartSettingsData},x:function(){return i.TimeChart.SettingsData}}]},events:{t:5,u:0,c:function(){return t.TimeChartSettingsEvents},x:function(){return i.TimeChart.SettingsEvents}},interaction:{t:5,u:0,c:function(){return t.TimeChartSettingsInteraction},x:function(){return i.TimeChart.SettingsInteraction}},localization:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalization},x:function(){return i.TimeChart.SettingsLocalization}},milestones:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.TimeChartSettingsMarker},x:function(){return i.TimeChart.SettingsMarker}}]},navigation:{t:5,u:0,c:function(){return{followAnchor:{t:9},initialDisplayAnchor:{t:7,b:[{t:0},{t:1}]},initialDisplayPeriod:{t:0},initialDisplayUnit:{t:0}}}},series:{t:6,u:4,b:[{t:5,u:0,c:function(){return t.TimeChartSettingsSeries},x:function(){return i.TimeChart.SettingsSeries},y:!0}]},seriesDefault:{t:5,u:0,c:function(){return t.TimeChartSettingsSeries},x:function(){return i.TimeChart.SettingsSeries},y:!0},theme:{t:5,c:function(){return t.TimeChartSettings},x:function(){return i.TimeChart.Settings},y:!0},timeAxis:{t:5,u:0,c:function(){return t.TimeChartSettingsTimeAxis},x:function(){return i.TimeChart.SettingsTimeAxis}},toolbar:{t:5,u:0,c:function(){return t.TimeChartSettingsToolbar},x:function(){return i.TimeChart.SettingsToolbar}}},t.TimeChartSettingsAdvanced={dataUpdateInterval:{t:1,d:0},maxUnitsToDisplay:{t:1},timeUpdateInterval:{t:1,d:0}},t.TimeChartSettingsArea={displayPeriods:{t:6,u:0,b:[{t:5,u:0,c:function(){return{unit:{t:0}}}}]},displayUnits:{t:6,u:0,b:[{t:5,u:0,c:function(){return{unit:{t:0},name:{t:0}}}}]},style:{t:5,u:0,c:function(){return t.TimeChartSettingsAreaStyle},x:function(){return i.TimeChart.SettingsAreaStyle}}},t.TimeChartSettingsAreaDisplayPeriod={displayAnchor:{t:7,b:[{t:0},{t:1}]},displayPeriod:{t:0},displayUnit:{t:0},name:{t:0}},t.TimeChartSettingsAreaStyle={markerText:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}},selection:{t:5,u:0,c:function(){return t.TimeChartSettingsAreaStyleSelection},x:function(){return i.TimeChart.SettingsAreaStyleSelection}},selectionLabel:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}}},t.TimeChartSettingsAreaStyleSelection={behindSeries:{t:9},fillColor:{t:0},lineColor:{t:0},lineWidth:{t:1}},t.TimeChartSettingsCurrentTime={align:{t:7,b:[{t:0}]},label:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}},showTime:{t:9},side:{t:7,b:[{t:0}]},style:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}}},t.TimeChartSettingsData={cacheSize:{t:1,d:0},dataFunction:{t:4},minimizeRequests:{t:9},prefetchRatio:{t:1},preloaded:{t:5,c:function(){return t.TimeChartIDataObject}},requestMaxUnits:{t:1,d:0},stringTimestampFormat:{t:7,u:0,b:[{t:0},{t:6,u:0,b:[{t:0}]}]},suppressWarnings:{t:9},timeZoneOffset:{t:7,b:[{t:0},{t:1}]},timestampInSeconds:{t:9},units:{t:6,u:0,b:[{t:0}]},url:{t:0,d:5},urlByUnit:{t:8,u:0,b:[{t:0}]},useSmallerUnitCache:{t:9}},t.TimeChartSettingsEvents={onTimeChange:{t:4},selectionChangeDuringInteraction:{t:9}},t.TimeChartSettingsInteraction={scrolling:{t:5,u:0,c:function(){return t.TimeChartSettingsInteractionScrolling},x:function(){return i.TimeChart.SettingsInteractionScrolling}},selection:{t:5,u:0,c:function(){return t.TimeChartSettingsInteractionSelection},x:function(){return i.TimeChart.SettingsInteractionSelection}},snapMode:{t:0,d:6},zooming:{t:5,u:0,c:function(){return t.TimeChartSettingsInteractionZooming},x:function(){return i.TimeChart.SettingsInteractionZooming}}},t.TimeChartSettingsInteractionScrolling={limitFrom:{t:7,b:[{t:0},{t:1}]},limitMode:{t:0,d:6},limitTo:{t:7,b:[{t:0},{t:1}]},overscrollProportion:{t:1}},t.TimeChartSettingsInteractionSelection={enabled:{t:9},moveByDragging:{t:9},resizeSensitivity:{t:1},resizeTolerance:{t:1},tolerance:{t:1}},t.TimeChartSettingsInteractionZooming={click:{t:9},enabled:{t:9}},t.TimeChartSettingsLocalization={calendar:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationCalendar}},determiningDataBounds:{t:0},holidayWeekdays:{t:6,u:0,b:[{t:1,d:0}]},infoDates:{t:5,u:0,c:function(){return{fullTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},majorTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},minorTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}}}}},loadingLabel:{t:0},markerDates:{t:5,u:0,c:function(){return{timeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}}}}},timeAxisDates:{t:5,u:0,c:function(){return{majorLabelFullTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},majorLabelTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},minorLabelTimeFormats:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}}}}},timeUnitsNames:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},timeUnitsNamesPlural:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationTimeUnits}},toolbar:{t:5,u:0,c:function(){return t.TimeChartSettingsLocalizationToolbar},
  33. x:function(){return i.TimeChart.SettingsLocalizationToolbar}}},t.TimeChartSettingsLocalizationCalendar={months:{t:6,u:0,b:[{t:0}]},monthsShort:{t:6,u:0,b:[{t:0}]},parentLocale:{t:0},week:{t:5,u:0,c:function(){return{dow:{t:1,d:0},doy:{t:1}}}},weekdays:{t:6,u:0,b:[{t:0}]},weekdaysMin:{t:6,u:0,b:[{t:0}]},weekdaysShort:{t:6,u:0,b:[{t:0}]}},t.TimeChartSettingsLocalizationTimeUnits={M:{t:0},d:{t:0},h:{t:0},m:{t:0},ms:{t:0},s:{t:0},w:{t:0},y:{t:0}},t.TimeChartSettingsLocalizationToolbar={customPeriod:{t:0},periodDropdownTitle:{t:0},unavailableUnitTitle:{t:0},unitDropdownTitle:{t:0},zoomoutButton:{t:0},zoomoutTitle:{t:0}},t.TimeChartSettingsMarker={align:{t:7,b:[{t:0}]},enabled:{t:9},label:{t:5,u:0,c:function(){return t.BaseSettingsLabelStyle}},overrideLimits:{t:9},showTime:{t:9},side:{t:7,b:[{t:0}]},style:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},time:{t:1,d:0}},t.TimeChartSettingsSeries={data:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesData},x:function(){return i.TimeChart.SettingsSeriesData}}},t.TimeChartSettingsSeriesCandleStick={data:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesCandleStickData},x:function(){return i.TimeChart.SettingsSeriesCandleStickData}}},t.TimeChartSettingsSeriesCandleStickData={close:{t:1},high:{t:1},low:{t:1},open:{t:1}},t.TimeChartSettingsSeriesColumns={data:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesData},x:function(){return i.TimeChart.SettingsSeriesData}}},t.TimeChartSettingsSeriesData={countIndex:{t:1},index:{t:1,d:0}},t.TimeChartSettingsSeriesLines={data:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesData},x:function(){return i.TimeChart.SettingsSeriesData}},style:{t:5,u:0,c:function(){return t.TimeChartSettingsSeriesLinesStyle},x:function(){return i.TimeChart.SettingsSeriesLinesStyle}}},t.TimeChartSettingsSeriesLinesStyle={markerStyleFunction:{t:4}},t.TimeChartSettingsTimeAxis={enabled:{t:9},maxUnitWidth:{t:1},minUnitWidth:{t:1},miniTimeRuler:{t:9},showHolidays:{t:9},style:{t:5,u:0,c:function(){return{dateHolidays:{t:5,u:0,c:function(){return t.BaseSettingsBackgroundStyle}},dateLighten:{t:5,u:0,c:function(){return{fillColor:{t:0}}}},majorTimeBalloonStyle:{t:5,u:0,c:function(){return t.BaseSettingsBackgroundStyle}},majorTimeLabel:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}},minorTimeBalloonStyle:{t:5,u:0,c:function(){return t.BaseSettingsBackgroundStyle}},minorTimeLabel:{t:5,u:0,c:function(){return t.BaseSettingsTextStyle}},minorTimeRuler:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}},showMajorTimeBalloons:{t:9},showMinorTimeBalloons:{t:9},vgrid:{t:5,u:0,c:function(){return t.BaseSettingsLineStyle}}}}},timeZone:{t:0},timeZoneOffset:{t:7,b:[{t:0},{t:1}]},unitSizePolicy:{t:0,d:6},vgrid:{t:9}},t.TimeChartSettingsToolbar={displayPeriod:{t:9},displayUnit:{t:9},enabled:{t:9},items:{t:6,u:0,b:[{t:7,u:0,b:[{t:0},{t:5,u:0,c:function(){return t.BaseSettingsToolbarItem},x:function(){return i.Base.SettingsToolbarItem}}]}]},logScale:{t:9},periods:{t:6,u:0,b:[{t:5,u:0,c:function(){return t.TimeChartSettingsAreaDisplayPeriod},x:function(){return i.TimeChart.SettingsAreaDisplayPeriod}}]},zoomOut:{t:9},zoomOutFunction:{t:4}},t}();s.SettingsMapping=it,a(it.BaseIChartErrorEventArguments,it.BaseIChartEventArguments),a(it.BaseIChartSettingsChangeEventArguments,it.BaseIChartEventArguments),a(it.BaseIDataErrorResponse,it.BaseIDataObjectBase),a(it.BaseSettingsBackgroundStyle,it.BaseSettingsLineStyle),a(it.BaseSettingsAdvancedStyleMessageBackground,it.BaseSettingsBackgroundStyle),a(it.BaseSettingsLegendPanel,it.BaseSettingsChartPanel),a(it.BaseSettingsToolbarItem,it.BaseSettingsToolbarItemBase),a(it.FacetChartIChartEventArguments,it.BaseIChartEventArguments),a(it.FacetChartIChartClickEventArguments,it.FacetChartIChartEventArguments),a(it.LinearChartSettings,it.BaseSettings),a(it.FacetChartSettings,it.LinearChartSettings),a(it.FacetChartSettingsFacetAxisLabels,it.BaseSettingsLabelStyle),a(it.FacetChartSettingsFacetAxisTitleStyle,it.BaseSettingsLabelStyle),a(it.LinearChartSettingsSeriesColumnsStyle,it.LinearChartSettingsSeriesStyle),a(it.FacetChartSettingsSeriesColumnsStyle,it.LinearChartSettingsSeriesColumnsStyle),a(it.FacetChartSettingsFacetStyle,it.FacetChartSettingsSeriesColumnsStyle),a(it.LinearChartSettingsInteraction,it.BaseSettingsInteraction),a(it.FacetChartSettingsInteraction,it.LinearChartSettingsInteraction),a(it.FacetChartSettingsSeries,it.LinearChartSettingsSeries),a(it.LinearChartSettingsSeriesColumns,it.LinearChartSettingsSeries),a(it.FacetChartSettingsSeriesColumns,it.LinearChartSettingsSeriesColumns),a(it.FacetChartSettingsSeriesData,it.LinearChartSettingsSeriesData),a(it.LinearChartSettingsSeriesLines,it.LinearChartSettingsSeries),a(it.FacetChartSettingsSeriesLines,it.LinearChartSettingsSeriesLines),a(it.LinearChartSettingsSeriesLinesStyle,it.LinearChartSettingsSeriesStyle),a(it.FacetChartSettingsSeriesLinesStyle,it.LinearChartSettingsSeriesLinesStyle),a(it.FacetChartSettingsToolbar,it.BaseSettingsToolbar),a(it.ItemsChartIDataObjectBase,it.BaseIDataErrorResponse),a(it.ItemsChartIDataObjectNode,it.ItemsChartIDataObjectBase),a(it.GeoChartIGeoDataObjectNode,it.ItemsChartIDataObjectNode),a(it.GeoChartIAggregationDataObjectNode,it.GeoChartIGeoDataObjectNode),a(it.GeoChartIDataObject,it.BaseIDataErrorResponse),a(it.ItemsChartIDataObjectLink,it.ItemsChartIDataObjectBase),a(it.GeoChartIGeoDataObjectLink,it.ItemsChartIDataObjectLink),a(it.ItemsChartSettings,it.BaseSettings),a(it.GeoChartSettings,it.ItemsChartSettings),a(it.GeoChartSettingsAggregatedShapeStyle,it.BaseSettingsBackgroundStyle),a(it.GeoChartSettingsArea,it.BaseSettingsArea),a(it.GeoChartSettingsAreaStyle,it.BaseSettingsAreaStyle),a(it.ItemsChartSettingsData,it.BaseSettingsData),a(it.GeoChartSettingsData,it.ItemsChartSettingsData),a(it.ItemsChartSettingsInteraction,it.BaseSettingsInteraction),a(it.GeoChartSettingsInteraction,it.ItemsChartSettingsInteraction),a(it.GeoChartSettingsLayerOverlay,it.GeoChartSettingsLayerBase),a(it.GeoChartSettingsLayerAggregated,it.GeoChartSettingsLayerOverlay),a(it.GeoChartSettingsLayerCharts,it.GeoChartSettingsLayerOverlay),a(it.GeoChartSettingsLayerItems,it.GeoChartSettingsLayerBase),a(it.GeoChartSettingsLayerShapes,it.GeoChartSettingsLayerBase),a(it.ItemsChartSettingsNodesLayerStyle,it.ItemsChartSettingsItemsLayerStyle),a(it.GeoChartSettingsNodesLayerStyle,it.ItemsChartSettingsNodesLayerStyle),a(it.GeoChartSettingsShapesLayerNodeStyle,it.ItemsChartSettingsNodeStyle),a(it.GeoChartSettingsShapesLayerStyle,it.GeoChartSettingsNodesLayerStyle),a(it.ItemsChartIChartEventArguments,it.BaseIChartEventArguments),a(it.ItemsChartIChartClickEventArguments,it.ItemsChartIChartEventArguments),a(it.ItemsChartSettingsAdvanced,it.BaseSettingsAdvanced),a(it.ItemsChartSettingsAuraStyle,it.BaseSettingsBackgroundStyle),a(it.ItemsChartSettingsItemsLayerLabelStyle,it.BaseSettingsLabelStyle),a(it.ItemsChartSettingsItemsLayerItemStyle,it.ItemsChartSettingsItemsLayerLabelStyle),a(it.ItemsChartSettingsItemsLayerLinkLabelStyle,it.ItemsChartSettingsItemsLayerLabelStyle),a(it.ItemsChartSettingsLinkClass,it.ItemsChartSettingsItemClass),a(it.ItemsChartSettingsLinkItem,it.ItemsChartSettingsItemsLayerItemStyle),a(it.ItemsChartSettingsLinkMenu,it.ItemsChartSettingsMenu),a(it.ItemsChartSettingsNodeClass,it.ItemsChartSettingsItemClass),a(it.ItemsChartSettingsNodeItem,it.ItemsChartSettingsItemsLayerItemStyle),a(it.ItemsChartSettingsNodeMenu,it.ItemsChartSettingsMenu),a(it.LinearChartSettingsArea,it.BaseSettingsArea),a(it.LinearChartSettingsAreaStyle,it.BaseSettingsAreaStyle);var nt=it.LinearChartSettingsEvents;it.LinearChartSettingsEvents=function(t,e){var i=nt(t,e);return a(i,it.BaseSettingsEvents(t,e)),i},a(it.LinearChartSettingsLegend,it.BaseSettingsLegend),a(it.LinearChartSettingsLegendAdvanced,it.BaseSettingsLegendAdvanced),a(it.LinearChartSettingsLegendMarker,it.BaseSettingsLegendMarker),a(it.LinearChartSettingsLocalization,it.BaseSettingsLocalization),a(it.LinearChartSettingsLocalizationToolbar,it.BaseSettingsLocalizationToolbar),a(it.LinearChartSettingsSeriesCandleStick,it.LinearChartSettingsSeries),a(it.LinearChartSettingsSeriesCandleStickStyle,it.LinearChartSettingsSeriesStyle),a(it.LinearChartSettingsValueAxisBaseLineStyle,it.BaseSettingsLineStyle),a(it.LinearChartSettingsValueAxisTitleStyle,it.BaseSettingsLabelStyle),a(it.NetChartBarSettingsLocalizationToolbar,it.BaseSettingsLocalizationToolbar),a(it.NetChartBarSettingsToolbar,it.BaseSettingsToolbar),a(it.NetChartIChartEventArguments,it.ItemsChartIChartEventArguments),a(it.NetChartIChartClickEventArguments,it.NetChartIChartEventArguments),a(it.NetChartIDataObject,it.BaseIDataErrorResponse),a(it.NetChartIDataObjectLink,it.ItemsChartIDataObjectLink),a(it.NetChartIDataObjectNode,it.ItemsChartIDataObjectNode),a(it.NetChartSettings,it.ItemsChartSettings),a(it.NetChartSettingsArea,it.BaseSettingsArea),a(it.NetChartSettingsData,it.ItemsChartSettingsData),a(it.NetChartSettingsInteraction,it.ItemsChartSettingsInteraction),a(it.NetChartSettingsInteractionSelection,it.ItemsChartSettingsInteractionSelection),a(it.NetChartSettingsInteractionZooming,it.ItemsChartSettingsInteractionZooming),a(it.NetChartSettingsLegend,it.BaseSettingsLegend),a(it.NetChartSettingsLegendAdvanced,it.BaseSettingsLegendAdvanced),a(it.NetChartSettingsLocalization,it.BaseSettingsLocalization),a(it.NetChartSettingsStyle,it.ItemsChartSettingsNodesLayerStyle),a(it.PieChartIChartEventArguments,it.BaseIChartEventArguments),a(it.PieChartIChartClickEventArguments,it.PieChartIChartEventArguments),a(it.PieChartIDataObjectCommon,it.BaseIDataObjectBase),a(it.PieChartIDataObject,it.PieChartIDataObjectCommon),a(it.PieChartIDataObjectRoot,it.PieChartIDataObjectCommon),a(it.PieChartIDataObjectRoot,it.BaseIDataErrorResponse),a(it.PieChartSettings,it.BaseSettings),a(it.PieChartSettingsAdvanced,it.BaseSettingsAdvanced),a(it.PieChartSettingsData,it.BaseSettingsData),a(it.PieChartSettingsEvents,it.BaseSettingsEvents(it.PieChartIChartEventArguments,it.PieChartIChartClickEventArguments)),a(it.PieChartSettingsInteraction,it.BaseSettingsInteraction),a(it.PieChartSettingsLegend,it.BaseSettingsLegend),a(it.PieChartSettingsLegendMarker,it.BaseSettingsLegendMarker),a(it.PieChartSettingsLocalization,it.BaseSettingsLocalization),a(it.TimeChartIChartEventArguments,it.BaseIChartEventArguments),a(it.TimeChartIDataObject,it.BaseIDataErrorResponse),a(it.TimeChartSettings,it.LinearChartSettings),a(it.TimeChartSettingsAdvanced,it.BaseSettingsAdvanced),a(it.TimeChartSettingsArea,it.LinearChartSettingsArea),a(it.TimeChartSettingsAreaStyle,it.LinearChartSettingsAreaStyle),a(it.TimeChartSettingsCurrentTime,it.TimeChartSettingsMarker),a(it.TimeChartSettingsData,it.BaseSettingsData),a(it.TimeChartSettingsEvents,it.LinearChartSettingsEvents(it.TimeChartIChartEventArguments,it.TimeChartIChartEventArguments)),a(it.TimeChartSettingsInteraction,it.LinearChartSettingsInteraction),a(it.TimeChartSettingsInteractionScrolling,it.LinearChartSettingsInteractionScrolling),a(it.TimeChartSettingsInteractionZooming,it.LinearChartSettingsInteractionZooming),a(it.TimeChartSettingsLocalization,it.LinearChartSettingsLocalization),a(it.TimeChartSettingsLocalizationToolbar,it.LinearChartSettingsLocalizationToolbar),a(it.TimeChartSettingsSeries,it.LinearChartSettingsSeries),a(it.TimeChartSettingsSeriesCandleStick,it.LinearChartSettingsSeriesCandleStick),a(it.TimeChartSettingsSeriesData,it.LinearChartSettingsSeriesData),a(it.TimeChartSettingsSeriesCandleStickData,it.TimeChartSettingsSeriesData),a(it.TimeChartSettingsSeriesColumns,it.LinearChartSettingsSeriesColumns),a(it.TimeChartSettingsSeriesLines,it.LinearChartSettingsSeriesLines),a(it.TimeChartSettingsSeriesLinesStyle,it.LinearChartSettingsSeriesLinesStyle),a(it.TimeChartSettingsToolbar,it.BaseSettingsToolbar);var st=function(){function t(){}return t.mergeDefaultValues=function(e,i,n,s,r,a){var o=i?i.type:null;if(!e||0===e.length){if(!o)return[];e=[{type:o}]}for(var l=[],h=0;h<e.length;h++){var c=e[h],d=a+"["+h+"]";if(u.isObjectOrArray(c)){var p=c.type||o;if(!p)throw new Error("`type` property must be specified in the settings for value: "+d);var f=s(c,p),g=n[p];i&&(delete i.type,t.updateRecursive(f,i,r(f,i),{},d),i.type=o),g&&t.updateRecursive(f,g,r(f,g),{},d),t.updateRecursive(f,c,r(f,c),{},d),l.push(f)}}return l},t.updateRecursive=function(t,e,i,n,s){if(void 0===s&&(s=""),!t)throw new Error("Cannot update settings path '"+s+"' because the target object is not defined.");if(e)for(var r in e)if(e.hasOwnProperty(r)){var a=e[r],o=(s.length?s+".":"")+r,l=this.findPropertyConfiguration(r,i,o);null!==l&&void 0!==a&&this.copyValue(t,r,a,l,n,o)}},t.copyValueMergeByID=function(t,e,i,n,s,r){if(null!=i){if(6!==n.t)throw new Error("Property '"+r+"' is set to use merge-by-ID update mode which is only supported on arrays.");if(this.replacingSettings)return this.copyValueRecursive(t,e,i,n,s,r);var a=t[e];null==a&&(t[e]=a=[]);for(var o={},l=0;l<a.length;l++)o[a[l].id]=a[l];for(var h=0;h<i.length;h++){var c=i[h];if(null!=c){c.id||(c.id=u.getIdentifierStr());var d=o[c.id];s[e]||(s[e]={}),this.copyValue(o,c.id,c,n.b[0],s[e],r+"["+c.id+"]"),d||a.push(o[c.id])}}}},t.retrieveOwnMethod=function(t,e){if(!t)return null;var i=t[e],n=t.__baseType;return n&&n[e]===i?null:i},t.copyValueRecursive=function(t,e,i,n,s,r){if(null!=i){var a=t[e];if(n.c){var o=n.x?n.x():null,l=this.retrieveOwnMethod(o,"getMapping"),h=l?l(a,i):n.c();if(null==a){if(!o||n.y||this._ignoringCtor)a={};else{var u=this.retrieveOwnMethod(o,"createInstance");a=u?u(i):new o}t[e]=a}if(n.y)try{this._ignoringCtor++,this.updateRecursive(a,i,h,s[e]={},r)}finally{this._ignoringCtor--}else this.updateRecursive(a,i,h,s[e]={},r)}else if(6===n.t)t[e]=a=[],this.copyArray(a,i,n.b[0],s[e]=[],r);else{if(8!==n.t)throw new Error("Property '"+r+"' is set to use recursive update but does not define target object mapping.");(null==a||this.replacingSettings)&&(t[e]=a={}),this.copyDictionary(a,i,n.b[0],s[e]={},r)}}},t.copyValue=function(t,e,i,n,s,r){if(void 0===i)return delete t[e],void(s[e]=!0);var a=this.ensurePropertyType(i,n,r);if(a){i=a.value,n=a.configuration||n;var o=t[e];if(1===n.u||void 0===n.u)o!==i&&(s[e]=i,t[e]=i);else if(2===n.u)i=JSON.parse(JSON.stringify(i)),s[e]=i,t[e]=i;else if(4===n.u)this.copyValueMergeByID(t,e,i,n,s,r);else if(3===n.u){if(null!=i){if(6!==n.t)throw new Error("Property '"+r+"' is set to use concat update which is only supported for arrays.");o&&!this.replacingSettings||(t[e]=o=[]),this.copyArray(o,i,n.b[0],s[e]=[],r)}}else{if(0!==n.u)throw new Error("Property '"+r+"' does not have an update mode defined in the settings mapping or it is not implemented.");this.copyValueRecursive(t,e,i,n,s,r)}}},t.copyDictionary=function(t,e,i,n,s){for(var r=Object.keys(e),a=0;a<r.length;a++){var o=r[a],l={};this.copyValue(t,o,e[o],i,l,s+"."+o),u.hasProperties(l)&&(n[o]=l)}},t.copyArray=function(t,e,i,n,s){for(var r=0;r<e.length;r++)this.copyValue(t,t.length,e[r],i,n,s+"["+r+"]")},t.ensurePropertyType=function(t,e,i,n){if(void 0===n&&(n=!1),null==t)return{value:t};var s=null,r=null,a=void 0,o=null;switch(e.t){case 0:t instanceof String&&(t=t.valueOf()),u.isString(t)||(s="String");break;case 1:if(t instanceof Number&&(t=t.valueOf()),0===e.d){a=parseFloat(t);var l=Math.round(a);if(isNaN(a))s="Integer";else if(l!==a){var h=Math.abs(l-a);n||u.warn("Settings value '"+i+"' expected to be an Integer but contains a decimal point: "+a+"."),h<1e-8&&(a=l)}}else a=parseFloat(t),isNaN(a)&&(s="Float");break;case 3:u.isString(t)?(a=document.getElementById(t),a||(r="the property expects either a reference to a DOM element or a string containing the ID of the element. There is no element with the given ID '"+t+"'.")):u.isDomObject(t)||(r="the property expects either a reference to a DOM element or a string containing the ID of the element.");break;case 4:u.isFunction(t)||(s="Function");break;case 6:Array.isArray(t)||(n?s="Array":(u.warn("Settings value '"+i+"' expected to be an array but found "+typeof t+". The value will be wrapped in an array."),a=[t]));break;case 16:"undefined"!=typeof Float32Array&&t instanceof Float32Array||(s="Float32Array");break;case 16:"undefined"!=typeof Float32Array&&t instanceof Float32Array||(s="Float32Array");break;case 17:"undefined"!=typeof Int32Array&&t instanceof Int32Array||(s="Int32Array");break;case 18:"undefined"!=typeof Uint32Array&&t instanceof Uint32Array||(s="UInt32Array");break;case 11:if(Array.isArray(t))for(var c=0;c<t.length;c++){var d=t[c];if(!Array.isArray(d)||2!==d.length||!u.isNumber(d[0])||!u.isString(d[1])){r="the property at index "+c+" has to be an array with two elements - a number and a string.";break}}else r="the property has to be an array where each item is an array with two elements - a number and a string.";break;case 2:var p=e.e(),f=u.isNumber(t);f||u.isString(t)?(a=p[t],void 0===a&&(r="'"+t+"' is not a valid enumeration value. Please review the documentation for valid values.",t=p),f&&(a=t)):(r="the value must be a number or a string (the preferred way is to use the enumeration from 'ZoomCharts.Configuration' namespace).",t=p);break;case 14:t instanceof CanvasGradient||(s="CanvasGradient");break;case 12:if(Array.isArray(t)&&t.length===e.b.length)for(var g=0;g<t.length;g++){var m=this.ensurePropertyType(t[g],e.b[g],i+"["+g+"]",n);if(!m)return null;t[g]=m.value}else r="the property expects an array with exactly "+e.b.length+" elements.";break;case 7:for(var v=!1,y=0;y<e.b.length;y++){var S=this.ensurePropertyType(t,e.b[y],i,!0);if(S){a=S.value,o=S.configuration||e.b[y],v=!0;break}}v||(r="the the given value does not match any constituent of the union type. Please review the documentation on the correct type.");break;case 5:case 8:u.isObjectOrArray(t)||(s="Object");break;case 9:t instanceof Boolean&&(t=t.valueOf()),null!==t&&t!==!0&&t!==!1&&(s="Boolean");break;case 10:break;default:throw new Error("Unsupported data type: "+e.t)}return null!==s&&null===r&&(r="the given value '"+t+"' is not of type '"+s+"'."),null!==r?(n||u.error("Cannot update settings value '"+i+"' because "+r,t),null):(void 0!==a&&(t=a),{value:t,configuration:o})},t.findPropertyConfiguration=function(t,e,i){var n=e[t];return void 0!==n?n:(u.warn("Cannot update settings value '"+i+"' because such property does not exist.",null,!0),null)},t._ignoringCtor=0,t.replacingSettings=!1,t}();s.SettingsHelper=st;var rt=function(){function t(t){this._mapping=null,this._computedDataMap={},this._initializing=!0,this.container=null,this.theme=null,this.assetsUrlBase="",this.area=new ht,this.data=[],this.advanced=new dt,this.events=new at,this.interaction=new ct,this.localization=new ot,this.toolbar=new X,this.title=new H,this.credits=new D,this.legend=new G,this._mapping=t}return t.prototype.applyGlobalCustomizations=function(){this.theme&&st.updateRecursive(this,this.theme,this._mapping,{})},t.prototype.applyCompatibility=function(t,e,i){i=null==i?"":i+".";for(var n=0;n<e.length;n++){var s=e[n],r=s.from,a=u.getProp(t,r,!!s.to&&!s.filter);if(void 0!==a&&(!s.filter||s.filter(a)))if(s.to)s.transform&&(a=s.transform(a)),u.extendDeep(t,u.wrapValue(a,s.to)),u.warn("Setting `"+i+r+"` is being deprecated. Compatibility layer moved the value automatically to `"+i+s.to+"`. Please update the configuration to avoid using the obsolete property.",null,!0);else{var o=s.alternativeAsWarning,l="Setting `"+i+r+"` "+(o?"is being deprecated":"is no longer supported")+". Consider using `"+s.alternative+"` instead.";o?u.warn(l,null,!0):u.error(l)}}},t.prototype.apply=function(t){this.applyCompatibility(t,[{from:"width",to:"area.width"},{from:"height",to:"area.height"},{from:"minHeight",to:"area.minHeight"},{from:"maxHeight",to:"area.maxHeight"},{from:"minWidth",to:"area.minWidth"},{from:"maxWidth",to:"area.maxWidth"}]);var e={},i=!1;if(this._initializing)this.applyGlobalCustomizations(),t||(t={}),t.data||(t.data=[{}]);else if(!t)return e;if(t.data){Array.isArray(t.data)||(t.data=[t.data],i=!0);for(var n=0;n<t.data.length;n++){var s=t.data[n];s.id||(s.name?(u.warn("The property `name` in the data object configuration is deprecated in favor of `id` property. Please update the configuration to avoid using the obsolete property.",null,!0),s.id=s.name,delete s.name):0===n?s.id="default":s.id="default-"+n.toString(10))}}if(st.updateRecursive(this,t.theme,this._mapping,e),st.updateRecursive(this,t,this._mapping,e),i&&(t.data=t.data[0]),e.data||this._initializing){this._computedDataMap={};for(var n=0;n<this.data.length;n++){var r=this.data[n];this._computedDataMap[r.id]=r}}return e},t}();s.Settings=rt;var at=function(){function t(){this.onError=null,this.onSettingsChange=null,this.onClick=null,this.onDoubleClick=null,this.onTripleClick=null,this.onRightClick=null,this.onHoverChange=null,this.onSelectionChange=null,this.onChartUpdate=null,this.onPositionChange=null,this.chartUpdateDelay=0}return t}();s.SettingsEvents=at;var ot=function(){function t(){this.toolbar=new lt,this.loadingLabel="Loading...",this.closeButton="Close",this.dataRequestFailed="Data request failed",this.exportNotAvailable="Your browser does not support exporting the chart."}return t}();s.SettingsLocalization=ot;var lt=function(){function t(){this.backButton="Back",this.backTitle="Move one step back in navigation",this.fullscreenButton="Fullscreen",this.fullscreenTitle="Toggle fullscreen mode",this.zoomoutButton="Zoom-out",this.zoomoutTitle="Zoom out",this.exportButton="Export",this.exportTitle="Export Data",this.exportJpeg="For Office and Web (jpeg)",this.exportPNG="For Photoshop (png)",this.exportPDF="For Printer (pdf)",this.exportCSV="Spreadsheet (csv)",this.exportXLS="Spreadsheet (xls)"}return t}();s.SettingsLocalizationToolbar=lt;var ht=function(){function t(){this.defaultHeight=300,this.width=null,this.height=null,this.top=null,this.left=null,this.minHeight=50,this.maxHeight=2e4,this.minWidth=50,this.maxWidth=2e4,this.style=new ut}return t}();s.SettingsArea=ht;var ut=function(){function t(){this.fillColor="transparent",this.image=null,this.overlayColor=null}return t}();s.SettingsAreaStyle=ut;var ct=function(){function t(){this.resizing=new tt}return t}();s.SettingsInteraction=ct;var dt=function(){function t(){this.labelCache=!0,this.labelCacheRotated=!0,this.highDPI=!0,this.pointer=new pt,this.useAnimationFrame=!0,this.showTouches=!1,this.showTouchTrail=!0,this.showFPS=!1,this.showTimestamp=!1,this.logging=!1,this.style=new ft,this.maxCanvasWidth=4096,this.maxCanvasHeight=4096,this.themeCSSClass="DVSL-round",this.assets=[{url:"assets://zc.css",required:function(){return!u.isStyleSheetDefined("DVSL-suppress-default-styles","color")}}],this.builtinAssets={"logo-supported-by":c.LicenseBannerSupportedBy,"logo-development":c.LicenseBannerDevelopment,"logo-license-expired":c.LicenseExpired},this.exportProxyURL="https://echo.zoomcharts-cloud.com/download",this.exportPdfSize=[210,297],this.crossOriginHeader=null,this.dataExportFunction=null}return t}();s.SettingsAdvanced=dt;var pt=function(){function t(){this.noClickOnDoubleClick=!0,this.clickSensitivity=10,this.doubleClickSensitivity=20,this.doubleClickTimeout=300,this.longPressTimeout=500,this.longPressSensitivity=10,this.speedAveragingPeriod=200,this.scrollIntoView=!1,this.mouseWheelRequiresFocus=!1}return t}();s.SettingsAdvancedPointer=pt;var ft=function(){function t(){this.messageTextStyle={fillColor:"#000",font:"15px Arial"},this.messageBackgroundStyle={padding:5},this.loadingArcStyle={r:10,lineColor:"#444",lineWidth:1,location:"center"}}return t}();s.SettingsAdvancedStyle=ft;var gt=function(){function t(t,e,i,n){t!==1/0&&t>i?(this.x1=t,this.x0=i):(this.x1=i,this.x0=t),e!==1/0&&e>n?(this.y1=e,this.y0=n):(this.y1=n,this.y0=e)}return t.createEmpty=function(){return new t(1/0,1/0,-(1/0),-(1/0))},t.prototype.isEmpty=function(){return this.x0>=this.x1||this.y0>=this.y1},t.prototype.clone=function(){return new t(this.x0,this.y0,this.x1,this.y1)},t.prototype.w=function(){return this.x1-this.x0},t.prototype.h=function(){return this.y1-this.y0},t.prototype.equals=function(t){return this.x0===t.x0&&this.x1===t.x1&&this.y0===t.y0&&this.y1===t.y1},t.prototype.inflate=function(t){var e=(this.x0+this.x1)/2,i=(this.y0+this.y1)/2;return this.x0=(this.x0-e)*t+e,this.x1=(this.x1-e)*t+e,this.y0=(this.y0-i)*t+i,this.y1=(this.y1-i)*t+i,this},t.prototype.clip=function(t){return this.x0=Math.max(this.x0,t.x0),this.x1=Math.min(this.x1,t.x1),this.y0=Math.max(this.y0,t.y0),this.y1=Math.min(this.y1,t.y1),this},t.prototype.isInside=function(t){return this.x0>=t.x0&&this.x1<=t.x1&&this.y0>=t.y0&&this.y1<=t.y1},t.prototype.isOutside=function(t){return this.x0>t.x1||this.x1<t.x0||this.y0>t.y1||this.y1<t.y0},t.prototype.overlapsRect=function(t,e,i,n){return t<this.x1&&i>this.x0&&e<this.y1&&n>this.y0},t.prototype.intersectsSegment=function(t,e,i,n){return null!=s.Geometry.clipSegmentToRect(t,e,i-t,n-e,this.x0,this.y0,this.x1,this.y1)},t.prototype.area=function(){return(this.x1-this.x0)*(this.y1-this.y0)},t.prototype.toString=function(){return this.x0+","+this.y0+", "+this.x1+", "+this.y1},t.prototype.addPoint=function(t,e){return this.x0=Math.min(this.x0,t),this.x1=Math.max(this.x1,t),this.y0=Math.min(this.y0,e),this.y1=Math.max(this.y1,e),this},t.prototype.addBounds=function(t,e,i,n){return this.x0=Math.min(this.x0,t),this.x1=Math.max(this.x1,i),this.y0=Math.min(this.y0,e),this.y1=Math.max(this.y1,n),this},t.prototype.addRect=function(t){return this.x0=Math.min(this.x0,t.x0),this.x1=Math.max(this.x1,t.x1),this.y0=Math.min(this.y0,t.y0),this.y1=Math.max(this.y1,t.y1),this},t.prototype.moveBy=function(t,e){return this.x0+=t,this.x1+=t,this.y0+=e,this.y1+=e,this},t.prototype.containsPoint=function(t,e){return t>=this.x0&&t<this.x1&&e>=this.y0&&e<this.y1},t.prototype.addLine=function(t){for(var e=0;e<=t.length-2;e+=2)this.addPoint(t[e],t[e+1]);return this},t.prototype.translate=function(t,e,i,n){return this.x0=this.x0*t+e,this.x1=this.x1*t+e,this.y0=this.y0*i+n,this.y1=this.y1*i+n,this},t.prototype.overlaps=function(t){return this.x0<t.x1&&this.x1>t.x0&&this.y0<t.y1&&this.y1>t.y0},t}();s.Rect=gt;var mt=function(){function t(t,e){this.msg=t,this.pri=e}return t}(),vt=function(){function t(){this.settings=null,this.assetsLoader=null,this.mainData=null,this.mainDataEnabled=!0,this.chartLeft=0,this.chartTop=0,this.chartWidth=1,this.chartHeight=1,this.x0=0,this.y0=0,this.height=0,this.width=0,this.leftMargin=0,this.rightMargin=0,this.topMargin=0,this.bottomMargin=0,this.loading=!0,this.messages={},this.backStack=[]}return t.prototype.setMessage=function(t,e,i){void 0===i&&(i=0);var n;return e?(n=!this.messages[t]||this.messages[t].msg!==e||this.messages[t].pri!==i,this.messages[t]=new mt(e,i)):(n=this.messages.hasOwnProperty(t),delete this.messages[t]),n},t.prototype.getMessage=function(){var t=null,e=0;for(var i in this.messages){var n=this.messages[i];n.pri>e&&(t=n.msg,e=n.pri)}return t},t.prototype.pushBack=function(t){this.backStack.push(t),this.backStack.length>1e3&&(this.backStack=this.backStack.slice(200))},t}();s.Scene=vt;var yt=2*Math.PI,St=function(){function t(){}return t.distanceToSegmentSq=function(t,e,i,n,s,r){var a=s-t,o=r-e,l=i-t,h=n-e,u=a*l+o*h,c=l*l+h*h,d=-1;0!==c&&(d=u/c);var p,f;d<0?(p=t,f=e):d>1?(p=i,f=n):(p=t+d*l,f=e+d*h);var g=s-p,m=r-f;return g*g+m*m},t.rayIntersectsSegment=function(t,e,i,n,s,r,a,o){var l=1/0,h=a-s,u=o-r,c=i*u-n*h;if(0!==c){var d=(e*h-t*u+s*u-r*h)/c,p=void 0;p=Math.abs(h)>Math.abs(u)?(t+i*d-s)/h:(e+n*d-r)/u,p>=0&&p<=1&&d>=0&&(l=d)}return l},t.lineIntersectsSegment=function(t,e,i,n,s,r,a,o){var l=1/0,h=a-s,u=o-r,c=i*u-n*h;if(0!==c){var d=(e*h-t*u+s*u-r*h)/c,p=void 0;p=Math.abs(h)>Math.abs(u)?(t+i*d-s)/h:(e+n*d-r)/u,p>=0&&p<=1&&(l=d)}return l},t.lineIntersectsLine=function(t,e,i,n,s,r,a,o){var l=1/0,h=i-t,u=n-e,c=a-s,d=o-r,p=h*d-u*c;if(0!==p){var f=(e*c-t*d+s*d-r*c)/p,g=void 0;g=Math.abs(c)>Math.abs(d)?(t+h*f-s)/c:(e+u*f-r)/d,l=f}return l},t.rayIntersectsCircle=function(t,e,i,n,s){var r=i*i+n*n,a=t*i+e*n,o=t*t+e*e-s*s,l=a*a-r*o,h=1/0;if(l>0){l=Math.sqrt(l);var u=(-a-l)/r,c=(-a+l)/r;u>=0&&(h=u),c>=0&&(h=Math.min(h,c))}return h},t.clipSegmentToRect=function(t,e,i,n,s,r,a,o){var l=0,h=1;if(0!==n){var u=1/n,c=(r-e)*u,d=(o-e)*u;if(l=Math.min(c,d),h=Math.max(c,d),l>1||h<0)return null}else if(e<r||e>o)return null;if(0!==i){var p=1/i,f=(s-t)*p,g=(a-t)*p,m=Math.min(f,g),v=Math.max(f,g);if(l=Math.max(l,m),h=Math.min(h,v),l>1||h<0||l>h)return null}else if(t<s||t>a)return null;return[l,h]},t.rayIntersectsCircleOuter=function(t,e,i,n,s){var r=i*i+n*n,a=t*i+e*n,o=t*t+e*e-s*s,l=a*a-r*o;return l=Math.sqrt(l),Math.max((-a+l)/r,(-a-l)/r)},t.lineTouchingCircle=function(t,e,i,n,s){var r=Math.sqrt(t*t+e*e);if(!(r>s))return null;var a=Math.sqrt(r*r-s*s),o=s*a/r,l=s*s/r,h=t/r,u=e/r,c=t*n-e*i;return c<0&&(o=-o),{x:h*l-u*o,y:u*l+h*o}},t.distanceToPolygonSq=function(e,i,n){if(t.isInsidePolygon(e,i,n))return 0;for(var s=1/0,r=0;r<n.length;r++)for(var a=n[r],o=a.length,l=a[o-2],h=a[o-1],u=0;u<=o-2;u+=2){var c=a[u],d=a[u+1];s=Math.min(s,t.distanceToSegmentSq(l,h,c,d,e,i)),l=c,h=d}return s},t.distanceToLinesSq=function(e,i,n){for(var s=1/0,r=0;r<n.length;r++){var a=n[r],o=a.length;if(2===o)s=Math.min(s,(e-a[0])*(e-a[0])+(i-a[1])*(i-a[1]));else if(o>2)for(var l=a[0],h=a[1],u=2;u<=o-2;u+=2){var c=a[u],d=a[u+1];s=Math.min(s,t.distanceToSegmentSq(l,h,c,d,e,i)),l=c,h=d}}return s},t.isInsidePolygon=function(t,e,i){for(var n=!1,s=0;s<i.length;s++)for(var r=i[s],a=r.length,o=r[a-2],l=r[a-1],h=0;h<=a-2;h+=2){var u=r[h],c=r[h+1];c>e!=l>e&&t<(u-o)*(e-l)/(c-l)+o&&(n=!n),o=u,l=c}return n},t.distanceToBalloon=function(e,i,n,s){var r;if(e>=i)r=e;else if(0===s)r=i;else{var a=u.sign(s);r=e/s*a,Math.abs(n*r)>i-e&&(r=t.rayIntersectsCircleOuter(-(i-e),0,Math.abs(n),s,e))}return r},t.distanceToRect=function(t,e,i,n,r,a,o){void 0===o&&(o=!1);var l,h;i instanceof s.Rect?(o=n,l=i.x0,h=i.y0,r=i.x1,a=i.y1):(l=i,h=n);var u,c;return u=t<l?l-t:t>r?t-r:0,c=e<h?h-e:e>a?e-a:0,o?u*u+c*c:Math.sqrt(u*u+c*c)},t.clipSegmentToBounds=function(e,i,n,s,r,a,o,l,h,u){var c=Math.max(r,a),d=n-e,p=s-i,f=t.clipSegmentToRect(e,i,d,p,o-c,l-c,h+c,u+c);if(null===f)return null;var g=Math.max(0,f[0]),m=Math.min(1,f[1]);return[e+d*g,i+p*g,e+d*m,i+p*m]},t.computeBoundsSize=function(t){for(var e=1/0,i=-(1/0),n=1/0,s=-(1/0),r=t.length,a=0;a<r;a+=2){var o=t[a],l=t[a+1];e=Math.min(o,e),i=Math.max(o,i),n=Math.min(l,n),s=Math.max(l,s)}return Math.max(i-e,s-n)},t.simplify=function(e,i){if(!i||!e.length)return e;var n=i*i;return e=t.reducePoints(e,n),e=t.simplifyDP(e,n)},t.simplifyDP=function(e,i){var n,s=e.length;n="undefined"!=typeof Uint8Array?new Uint8Array(s):new Array(s),n[0]=n[s-2]=1,t.simplifyDPStep(e,n,i,0,s-2);for(var r=[],a=0;a<s;a+=2)n[a]&&(r.push(e[a]),r.push(e[a+1]));return r},t.simplifyDPStep=function(e,i,n,s,r){for(var a=0,o=0,l=e[s],h=e[s+1],u=e[r],c=e[r+1],d=s+2;d<=r-2;d+=2){var p=t.distanceToSegmentSq(l,h,u,c,e[d],e[d+1]);p>a&&(o=d,a=p)}a>n&&(i[o]=1,t.simplifyDPStep(e,i,n,s,o),t.simplifyDPStep(e,i,n,o,r))},t.reducePoints=function(t,e){for(var i,n,s=t[0],r=t[1],a=[s,r],o=t.length,l=2;l<o;l+=2)i=t[l],n=t[l+1],(s-i)*(s-i)+(r-n)*(r-n)>e&&(a.push(i),a.push(n),s=i,r=n);return s!==i&&r!==n&&a.push(i,n),a},t.transformPolyline=function(t,e,i,n,s){for(var r=[],a=0;a<t.length;a+=2)r.push(t[a]*e+i,t[a+1]*n+s);return r},t.outlinePolylineByVectors=function(t,e,i){for(var n=[],r=[],a=t.length-2,o=0;o<a;o+=2){var l=e[o]*i,h=e[o+1]*i,u=t[o]+l,c=t[o+1]+h,d=t[o+2]+l,p=t[o+3]+h;n.push(u,c,d,p)}r=n.slice(0,2),a=n.length-4;for(var o=0;o<a;o+=4){var f=s.Geometry.lineIntersectsLine(n[o],n[o+1],n[o+2],n[o+3],n[o+4],n[o+5],n[o+6],n[o+7]);f===1/0?r.push(n[o+2],n[o+3]):r.push(n[o]+(n[o+2]-n[o])*f,n[o+1]+(n[o+3]-n[o+1])*f)}return r.push.apply(r,n.slice(-2)),r},t.calculatePolyArea=function(t){for(var e=0,i=t,n=t.length-2,s=0;s<n;s+=2)e+=i[s]*i[s+3]-i[s+2]*i[s+1];return e/2},t.calculatePolyCentroid=function(t,e){var i,n=0,s=0,r=t.length-2;e*=6;for(var a=0;a<r;a+=2)i=t[a]*t[a+3]-t[a+2]*t[a+1],n+=(t[a]+t[a+2])*i,s+=(t[a+1]+t[a+3])*i;return{x:n/e,y:s/e}},t.normalizeAngle=function(t){return t<0?(t%=yt,t+=yt):t>=yt&&(t%=yt),
  34. t},t.sectorBetweenAngles=function(t,e){for(;e<t;)e+=yt;return e-t},t.subtractAngle=function(t,e){var i=t-e;return i>Math.PI?i-=yt:i<-Math.PI&&(i+=yt),i},t.rotateVector=function(t,e,i,n){return{x:t*n-e*i,y:t*i+e*n}},t}();s.Geometry=St;var bt=function(){function t(t){this.scene=t,this.bounds=null}return t.prototype.setBounds=function(t,e,i,n){this.bounds=new gt(t,e,i,n)},t.prototype.findObjectAt=function(t,e,i){return null},t.prototype.remove=function(){},t}();s.Layer=bt,function(t){t.ToolbarItemNames.fullscreen=function(t,e){var i=t.settings.localization.toolbar;return new s.Bar.ToggleButton(t,e,{labelDisabled:e.label||i.fullscreenButton,titleDisabled:e.title||i.fullscreenTitle,cssClassEnabled:"DVSL-bar-btn-fullscreen-active",cssClassDisabled:e.cssClass||"DVSL-bar-btn-fullscreen",onEnable:function(){return t.setFullscreen(!0)},onDisable:function(){return t.setFullscreen(!1)},getChartState:function(){return t.isFullscreen()}})};var e=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=this.chart.scene.backStack.length>0,n=this.options;n.enabled!==i&&(n.enabled=i,this.updateSettings())},e}(t.Button);t.ToolbarItemNames.back=function(t,i){var n=t.settings.localization.toolbar;i.label=i.label||n.backButton,i.title=i.title||n.backTitle,i.cssClass=i.cssClass||"DVSL-bar-btn-back";var s=i.onClick;return i.onClick=function(e,i){t.back(!0,"user"),s&&s(e,i)},new e(t,i)}}(o);var Ct=function(){function t(t){this.seed=t,this.A=48271,this.M=2147483647,this.Q=this.M/this.A,this.R=this.M%this.A,this.oneOverM=1/this.M}return t.prototype.get=function(){var t=this.seed/this.Q,e=this.seed%this.Q,i=this.A*e-this.R*t;return i>0?this.seed=i:this.seed=i+this.M,this.seed*this.oneOverM},t.prototype.getArrayElement=function(t){return t[t.length*this.get()|0]},t}();s.Random=Ct;var xt=function(t){function e(e){t.call(this),this.animationOrder=500,this.paintOrder=35,this.updateOrder=600,this.container=null,this.backgroundContainer=null,this.background=null,this.canvas=null,this.interactionContainer=null,this.menuContainer=null,this.outerBorder=null,this.scene=null,this.curThemeClass=null,this.chart=e,this.scene=e.scene}return n(e,t),e.setContainerStyle=function(t){t.style.position="absolute",t.style.left="0px",t.style.right="0px",t.style.top="0px",t.style.bottom="0px"},e.prototype.createDom=function(t){this.shell=t,this.container=s.Helpers.createDom("div","DVSL-container DVSL-"+t.chart.api.typeName),this.container.style.position="relative",this.container.style.width="100%",this.backgroundContainer=s.Helpers.createDom("div","DVSL-background-container",null,this.container),e.setContainerStyle(this.backgroundContainer),this.background=s.Helpers.createDom("div","DVSL-background",null,this.backgroundContainer),e.setContainerStyle(this.background),this.backgroundImage=s.Helpers.createDom("div","DVSL-background-image",null,this.background),this.canvas=s.Helpers.createDom("canvas","DVSL-canvas",null,this.container),e.setContainerStyle(this.canvas),this.outerBorder=s.Helpers.createDom("div","DVSL-border",null,this.container),e.setContainerStyle(this.outerBorder),this.interactionContainer=s.Helpers.createDom("div","DVSL-interaction",null,this.container),e.setContainerStyle(this.interactionContainer),this.menuContainer=s.Helpers.createDom("div","DVSL-menu-container DVSL-menu-workaround",null,this.container),e.setContainerStyle(this.menuContainer),s.Helpers.createDom("span","DVSL-empty"," ",this.menuContainer),this.updateSettings(this.scene.settings),this.interactionContainer.tabIndex=0},e.prototype.updateSettings=function(t){if(s.Helpers.hasProp(t,"area.style.image")){var e=t.area.style.image;this.backgroundImage.style.backgroundImage=e?"url("+e+")":""}var i=this.curThemeClass,n=this.scene.settings.advanced.themeCSSClass;n!==i&&(i&&s.Helpers.removeClass(this.container,i),this.curThemeClass=n,s.Helpers.addClass(this.container,n))},e.prototype.doAnimations=function(t){t.changes.bounds&&(this.backgroundImage.style.bottom=this.scene.bottomMargin+"px",this.backgroundImage.style.top=this.scene.topMargin+"px")},e}(A);s.DomLayer=xt;var wt=function(){function t(t,e,i){void 0===i&&(i=[]),this.x=i,this.y1=e,this.y0=t}return t.prototype.isEmpty=function(){return 0===this.x.length},t.prototype.makeCopy=function(){return new t(this.y0,this.y1,this.x.slice(0))},t.prototype.split=function(e){var i=new t(e,this.y1);return this.y1=e,i.x=this.x.slice(0),i},t.prototype.add=function(t,e){for(var i=[],n=this.x.length,s=0;s<n&&this.x[s+1]<t;)i.push(this.x[s],this.x[s+1]),s+=2;for(s<n&&(t=Math.min(this.x[s],t));s<n&&this.x[s]<=e;)e=Math.max(e,this.x[s+1]),s+=2;for(i.push(t,e);s<n;)i.push(this.x[s],this.x[s+1]),s+=2;return this.x=i,this},t.prototype.subtract=function(t,e){for(var i=[],n=this.x.length,s=0;s<n&&this.x[s+1]<=t;)i.push(this.x[s],this.x[s+1]),s+=2;for(s<n&&this.x[s]<t&&i.push(this.x[s],t);s<n&&this.x[s+1]<=e;)s+=2;for(s<n&&this.x[s]<e&&(i.push(e,this.x[s+1]),s+=2);s<n;)i.push(this.x[s],this.x[s+1]),s+=2;return this.x=i,this},t.prototype.subtractSlice=function(t){if(this.isEmpty()||t.isEmpty())return this;for(var e=[],i=this.x,n=t.x,s=i.length,r=n.length,a=0,o=0,l=i[a],h=i[a+1];o<r;){var u=n[o],c=n[o+1];if(l>=c)o+=2;else if(u>=h){if(e.push(l,h),a+=2,a===s)break;l=i[a],h=i[a+1]}else if(u>l&&e.push(l,u),c<h)l=c,o+=2;else{if(a+=2,a===s)break;l=i[a],h=i[a+1]}}for(;a<s&&(e.push(l,h),a+=2,a!==s);)l=i[a],h=i[a+1];return this.x=e,this},t.prototype.intersectsSlice=function(t){if(this.isEmpty()||t.isEmpty())return!1;for(var e=this.x,i=t.x,n=e.length,s=i.length,r=0,a=0;a<s&&r<n;){var o=e[r],l=e[r+1],h=i[a],u=i[a+1];if(o>=u)a+=2;else{if(!(h>=l))return!0;r+=2}}return!1},t.prototype.coversSlice=function(t){if(t.isEmpty())return!0;for(var e=this.x,i=t.x,n=e.length,s=i.length,r=0,a=0;a<s&&r<n;){var o=e[r],l=e[r+1],h=i[a],u=i[a+1];if(h>=l)r+=2;else{if(!(h>=o&&u<=l))return!1;a+=2}}return a===s},t.prototype.clip=function(t,e){for(var i=[],n=0;n<=this.x.length-2;n+=2){var s=this.x[n],r=this.x[n+1];r>t&&s<e&&(i.push(Math.max(s,t)),i.push(Math.min(r,e)))}return this.x=i,this},t.prototype.tryMerge=function(t){if(this.x.length!==t.x.length||this.y1!==t.y0)return!1;for(var e=0;e<=this.x.length-1;e++)if(this.x[e]!==t.x[e])return!1;return this.y1=t.y1,!0},t.prototype.intersects=function(t,e){for(var i=0;i<=this.x.length-2;i+=2){var n=this.x[i],s=this.x[i+1];if(n<e&&s>t)return!0}return!1},t.prototype.covers=function(t,e){for(var i=0;i<=this.x.length-2;i+=2){var n=this.x[i],s=this.x[i+1];if(n<=t&&s>=e)return!0}return!1},t.prototype.findOverlappingRect=function(t,e,i){for(var n=!1,s=0;s<=this.x.length-2;s+=2){var r=this.x[s],a=this.x[s+1];r<e&&e-i<a&&(t=Math.min(t,Math.max(r,e-i)),n=!0),a>t&&t+i>r&&(e=Math.max(e,Math.min(a,t+i)),n=!0)}return{x0:t,x1:e,overlaps:n}},t.prototype.toRects=function(t){for(var e=0;e<=this.x.length-2;e+=2){var i=this.x[e],n=this.x[e+1];t.push(new s.Rect(i,this.y0,n,this.y1))}},t}();s.AreaSlice=wt;var Lt=function(){function t(){this.slices=[new wt(-1e30,1e30)]}return t.prototype.makeCopy=function(){var e=new t;e.slices=[];for(var i=0;i<this.slices.length;i++){var n=this.slices[i];e.slices.push(n.makeCopy())}return e},t.prototype.getBounds=function(){var t=1/0,e=-(1/0),i=1/0,n=-(1/0);if(this.slices.length>1){i=this.slices[1].y0,n=this.slices[this.slices.length-1].y1;for(var r=0;r<this.slices.length;r++){var a=this.slices[r];a.x.length>0&&(t=Math.min(t,a.x[0]),e=Math.max(e,a.x[a.x.length-1]))}}return new s.Rect(t,i,e,n)},t.prototype.addRect=function(t){if(t.isEmpty())return this;for(var e=t.x0,i=t.x1,n=t.y0,s=t.y1,r=[],a=null,o=0;o<this.slices.length;o++){var l=this.slices[o];if(l.y0>=s||l.y1<=n)a&&a.tryMerge(l)||(r.push(l),a=l);else{if(n>l.y0){var h=l.split(n);a&&a.tryMerge(l)||(r.push(l),a=l),l=h}if(s<l.y1){var h=l.split(s);l.add(e,i),a&&a.tryMerge(l)||(r.push(l),a=l),l=h}else l.add(e,i);a&&a.tryMerge(l)||(r.push(l),a=l)}}return this.slices=r,this},t.prototype.subtractRect=function(t){if(t.isEmpty())return this;for(var e=t.x0,i=t.x1,n=t.y0,s=t.y1,r=[],a=null,o=0;o<this.slices.length;o++){var l=this.slices[o];if(l.y0>=s||l.y1<=n)a&&a.tryMerge(l)||(r.push(l),a=l);else{if(n>l.y0){var h=l.split(n);a&&a.tryMerge(l)||(r.push(l),a=l),l=h}if(s<l.y1){var h=l.split(s);l.subtract(e,i),a&&a.tryMerge(l)||(r.push(l),a=l),l=h}else l.subtract(e,i);a&&a.tryMerge(l)||(r.push(l),a=l)}}return this.slices=r,this},t.prototype.clip=function(t){return 1},t.prototype.subtractArea=function(t){if(t.isEmpty())return this;for(var e=[],i=null,n=this.slices,s=t.slices,r=n.length,a=s.length,o=0,l=0,h=n[o];l<a;){var u=s[l];if(h.y1<=u.y0){if(i&&i.tryMerge(h)||(e.push(h),i=h),o+=1,o===r)break;h=n[o]}else if(u.y1<=h.y0||u.isEmpty())l+=1;else{if(h.y0<u.y0){var c=h.split(u.y0);i&&i.tryMerge(h)||(e.push(h),i=h),h=c}if(h.y1>u.y1){var c=h.split(u.y1);h.subtractSlice(u),i&&i.tryMerge(h)||(e.push(h),i=h),h=c,l+=1}else{if(h.subtractSlice(u),i&&i.tryMerge(h)||(e.push(h),i=h),o+=1,o===r)break;h=n[o]}}}for(;o<r&&(i&&i.tryMerge(h)||(e.push(h),i=h),o+=1,o!==r);)h=n[o];return this.slices=e,this},t.prototype.intersectsArea=function(t){if(t.isEmpty()||this.isEmpty())return!1;for(var e=this.slices,i=t.slices,n=e.length,s=i.length,r=0,a=0;a<s&&r<n;){var o=i[a],l=e[r];if(l.intersectsSlice(o))return!0;l.y1<o.y1?r+=1:o.y1<l.y1?a+=1:(r+=1,a+=1)}return!1},t.prototype.coversArea=function(t){if(t.isEmpty())return!0;for(var e=this.slices,i=t.slices,n=e.length,s=i.length,r=0,a=0;a<s&&r<n;){var o=i[a],l=e[r];if(!l.coversSlice(o))return!1;l.y1<o.y1?r+=1:o.y1<l.y1?a+=1:(r+=1,a+=1)}return!0},t.prototype.findOverlappingRect=function(t,e){if(this.isEmpty())return null;for(var i=this.slices[1].x[0],n=Math.min(this.slices[1].x[1],i+t),r=this.slices[1].y0,a=Math.min(this.slices[1].y1,r+e),o=0;o<this.slices.length;o++){var l=this.slices[o];if(l.y0>=r+e)break;var h=l.findOverlappingRect(i,n,t);i=h.x0,n=h.x1;var u=h.overlaps;u&&(a=Math.min(l.y1,r+e))}return new s.Rect(i,r,n,a)},t.prototype.findTopPosition=function(t,e){for(var i=1/0,n=0;n<this.slices.length;n++){var s=this.slices[n];s.covers(t,e)&&(i=Math.min(i,s.y0))}return i===1/0?0:i},t.prototype.intersects=function(t){for(var e=t.x0,i=t.x1,n=t.y0,s=t.y1,r=0;r<this.slices.length;r++){var a=this.slices[r];if(a.y0<s&&a.y1>n&&a.intersects(e,i))return!0}return!1},t.prototype.isEmpty=function(){return 1===this.slices.length&&this.slices[0].isEmpty()},t.prototype.coversRect=function(t){for(var e=t.x0,i=t.x1,n=t.y0,s=t.y1,r=0;r<this.slices.length;r++){var a=this.slices[r];if(n<a.y1&&s>a.y0&&!a.covers(e,i))return!1}return!0},t.prototype.toRects=function(){for(var t=[],e=0;e<this.slices.length;e++){var i=this.slices[e];i.toRects(t)}return t},t}();s.AreaCollection=Lt;var At=navigator.userAgent.match(/AppleWebKit\/(\d+)/),Tt=At?parseInt(At[1],10):1e6,Mt=function(){function e(t,i){var n=this;this.chart=null,this.settings=null,this.scene=null,this.events=null,this.profiler=null,this.container=null,this.canvas=null,this.scaleX=1,this.scaleY=1,this.paintRequested=null,this.labelRenderer=null,this.prevTime=null,this.paintNowInProgreess=!1,this.animationInProgress=!1,this.mouseEvents=null,this.innerAreaCache=null,this.chartWidth=0,this.chartHeight=0,this.sizeChanged=!0,this.fullScreenMode=!1,this.fullscreenBeforeW=0,this.fullscreenBeforeH=0,this.lastCursor=null,this.chart=t,this.settings=t.settings,this.scene=t.scene,this.domLayer=i,this.buildDom(),this.labelRenderer=new B(this.settings,this.chart.assetsLoader,this.container),this.mouseEvents=new x(this.domLayer.interactionContainer,this.settings.advanced.pointer,[this.domLayer.menuContainer]),this.profiler=new k(this);for(var s=0;s<e.MouseEventConfig.length;s++){var r=e.MouseEventConfig[s];!function(t){n.mouseEvents.listen(t.ev,function(e){return n.notifyMouseEvent(e,t)})}(r)}this.events=new I(t,this),this.events.addElement(this.domLayer),this.containerResizeFunc=function(){return n.updateSize(!1)},u.listenResize(this.container,this.containerResizeFunc),u.listen(window,"resize",this.containerResizeFunc)}return e.prototype.forceChromeRedraw=function(){var t=this.menuContainer.style,e=t.transform;t.transform="translateZ(0)",window.setTimeout(function(){t.transform=e},1)},e.prototype.updateSize=function(t){var e,i,n=this.settings.area;this.fullScreenMode?(e=window.innerWidth,i=window.innerHeight):this.fullscreenBeforeW>0?(e=this.fullscreenBeforeW,i=this.fullscreenBeforeH,this.fullscreenBeforeW=0,this.fullscreenBeforeH=0):(e=n.width||Math.min(n.maxWidth,this.container.clientWidth),i=n.height||Math.min(n.maxHeight,this.container.clientHeight),e>0&&i<2&&(i=this.settings.area.height||this.settings.area.defaultHeight),e=Math.max(n.minWidth,e),i=Math.max(n.minHeight,i)),(t||e>=2&&e!==this.chartWidth||i>=2&&i!==this.chartHeight)&&this.setSize(e,i,t),u.updateResize(this.container)},e.prototype.setSize=function(t,e,i){this.chart.log("Update size: "+e+", "+t);var n=this.domLayer.container.style;n.height=e+"px",n.width=t+"px",this.chartHeight=e,this.chartWidth=t,this.sizeChanged=!0,this.events.setNewSize(new gt(0,0,t,e),!0,i)},e.prototype.setFullscreen=function(t){t!==this.fullScreenMode&&(this.fullScreenMode=t,t?(this.fullscreenBeforeW=this.scene.chartWidth,this.fullscreenBeforeH=this.scene.chartHeight,u.addClass(this.domLayer.container,"DVSL-fullscreen")):u.removeClass(this.domLayer.container,"DVSL-fullscreen"),this.updateSize(!0))},e.prototype.buildDom=function(){if(!this.settings.container)throw new Error("Chart container is not defined in the settings.");if(!u.isDomObject(this.settings.container))throw new Error("Chart container is not a DOM object.");this.container=this.settings.container,null!=this.container._DVSL_ChartInstance&&this.container._DVSL_ChartInstance.remove(),this.container.innerHTML="<!--ZoomCharts "+t.PackageInfo.Version+"-->",this.container._DVSL_ChartInstance=this.chart,this.domLayer.createDom(this),this.container.appendChild(this.domLayer.container),this.backgroundContainer=this.domLayer.backgroundContainer,this.interactiveContainer=this.domLayer.interactionContainer,this.menuContainer=this.domLayer.menuContainer,this.canvas=this.domLayer.canvas},e.prototype.remove=function(){this.mouseEvents.remove(),this.domLayer.remove(),u.unlistenResize(this.container),delete this.container._DVSL_ChartInstance,u.unlisten(window,"resize",this.containerResizeFunc),this.container.innerHTML=""},e.prototype.updateSettings=function(t){t.area&&this.updateSize(!0),this.domLayer.updateSettings(t)},e.prototype.notifyMouseEvent=function(t,e){this.chart.removed||(t.consumed=!1,this.events.onMouseEvent(t,e),t.cursor||(t.cursor="default"),this.lastCursor!==t.cursor&&(this.interactiveContainer.style.cursor=t.cursor,this.menuContainer.style.cursor=t.cursor,this.lastCursor=t.cursor))},e.prototype.requestPaint=function(){var t=this;null===this.paintRequested&&(this.settings.advanced.useAnimationFrame?this.paintRequested=s.Helpers.requestAnimationFrame(function(e,i){return t.paintScene(i?e:null)}):this.paintRequested=window.setTimeout(function(){return t.paintScene(null)},5))},e.prototype.paintNow=function(t){return void 0===t&&(t=!1),this.paintNowInProgreess?void this.chart.error("paintNow called from within paintNow call"):(this.paintNowInProgreess=!0,(null!==this.paintRequested||t)&&(this.settings.advanced.useAnimationFrame?s.Helpers.cancelAnimationFrame(this.paintRequested):window.clearTimeout(this.paintRequested),this.paintScene(null)),void(this.paintNowInProgreess=!1))},e.prototype.paintScene=function(t){if(!this.chart.removed){this.paintRequested=null;var e=null!==t?t:u.performanceNow(),i=new w;i.timeStamp=e,i.isExport=!1,this.prevTime&&this.animationInProgress?(i.dtime=i.timeStamp-this.prevTime,i.dtime>1e3&&(i.dtime=1e3),i.dtime<1&&(i.dtime=1)):i.dtime=30,this.prevTime=e,this.chartWidth>0&&this.chartHeight>0&&(this.sizeChanged&&(this.resizeCanvas(),this.sizeChanged=!1),this.innerAreaCache=null,this.events.animateFrame(i),i.animating?(this.animationInProgress=!0,this.events.requestPaint()):this.animationInProgress=!1,this.profiler.paintDone())}},e.prototype.resizeCanvas=function(){var t=this.chart.settings.advanced,e=1,i=1;if(t.highDPI===!0){var n=u.canvasScaling();e=n.x,i=n.y}else t.highDPI>0&&(e=i=t.highDPI);var s,r,a=this.chartWidth,o=this.chartHeight,l=Math.max(100,t.maxCanvasWidth),h=Math.max(100,t.maxCanvasHeight),c=0,d=0;do c++,s=Math.ceil(a*e/c);while(s>l);do d++,r=Math.ceil(o*i/d);while(r>h);e/=c,i/=d,a=s/e,o=r/i,this.scaleX=e,this.scaleY=i,this.canvas.width=s,this.canvas.height=r,this.canvas.style.width=a+"px",this.canvas.style.height=o+"px"},e.prototype.prepareContext=function(t){var e=this.scene,i=this.canvas,n=i.getContext("2d");n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height),534===Tt&&(i.style.display="none",i.offsetHeight,i.style.display="inherit"),this.areaStylesBefore(n,this.canvas);var s=this.scaleX,r=this.scaleY;n.setTransform(s,0,0,r,0,0),n.__scaleX=s,n.__scaleY=r,t.context=n,t.scaleX=s,t.scaleY=r,t.labelRenderer=this.labelRenderer,this.labelRenderer.startFrame(e.chartWidth,e.chartHeight,s,r)},e.prototype.areaStylesBefore=function(t,e){var i=this.settings.area.style.fillColor;i&&(t.fillStyle=i,t.fillRect(0,0,e.width,e.height))},e.prototype.areaStylesAfter=function(t,e){var i=this.settings.area.style.overlayColor;i&&(t.fillStyle=i,t.setTransform(1,0,0,1,0,0),t.fillRect(0,0,e.width,e.height))},e.prototype.finalizeContext=function(t){this.areaStylesAfter(t.context,this.canvas),this.labelRenderer.finishFrame()},e.prototype.exportToImageGetDimensions=function(){var t=new w;t.isExport=!0,t.context=this.canvas.getContext("2d"),t.labelRenderer=this.labelRenderer;var e=this.events.updateLayout(t);return t.isExport=!1,this.events.updateLayout(t),{width:e.w(),height:e.h()}},e.prototype.exportToContext=function(t,e,i){var n=new B(this.settings,this.chart.assetsLoader,this.container);n.allowCache=!1,n.startFrame(1,1,i,i);var s=new w;s.isExport=!0,s.timeStamp=this.prevTime,s.dtime=0,s.context=t,s.scaleX=i,s.scaleY=i,s.labelRenderer=n;var r=this.events.updateLayout(s);this.areaStylesBefore(t,e),t.save(),t.setTransform(i,0,0,i,-r.x0*i,-r.y0*i),this.events.doPaint(s),this.areaStylesAfter(t,e),s.isExport=!1,this.events.updateLayout(s),O.restore(t)},e.prototype.getChartInnerArea=function(){if(this.innerAreaCache)return this.innerAreaCache;var t=new s.AreaCollection;t.addRect(new s.Rect(this.scene.x0,this.scene.y0,this.scene.x0+this.scene.width,this.scene.y0+this.scene.height));for(var e=this.menuContainer.getBoundingClientRect(),i=e.left,n=e.top,r=this.menuContainer.children,a=0;a<r.length;a+=1){var o=r[a];if(o.offsetHeight>0||o.offsetWidth>0){var l=o.getBoundingClientRect();t.subtractRect(new gt(l.left-i,l.top-n,l.right-i,l.bottom-n))}}return this.innerAreaCache=t,t},e.MouseEventConfig=[{ev:x.EVENT_GLOBAL_DOWN,name:"GlobalPointerDown"},{ev:x.EVENT_DOWN,name:"PointerDown",captures:!0},{ev:x.EVENT_UP,name:"PointerUp",needsCapture:!0,releasesCapture:!0},{ev:x.EVENT_DRAG,name:"PointerDrag",needsCapture:!0,captures:!0},{ev:x.EVENT_MOVE,name:"PointerMove",captures:!0},{ev:x.EVENT_LEAVE,name:"PointerOut"},{ev:x.EVENT_CANCEL,name:"PointerCancel",needsCapture:!0,releasesCapture:!0},{ev:x.EVENT_CLICK,name:"Click"},{ev:x.EVENT_INSTACLICK,name:"InstantClick"},{ev:x.EVENT_LONGPRESS,name:"LongPress"},{ev:x.EVENT_RCLICK,name:"RightClick"},{ev:x.EVENT_DBLCLICK,name:"DoubleClick"},{ev:x.EVENT_TPLCLICK,name:"TripleClick"},{ev:x.EVENT_WHEEL,name:"Wheel"}],e}();s.ChartOuterShell=Mt;var kt=function(){function t(t,e){this.fullScreenMode=!1,this.chart=t,this.settings=t.settings,this.scene=t.scene,this.parentShell=e,this.buildDom(),this.events=new I(t,this),this.parentShell.events.addSubchart(this.chart),this.updateSize()}return t.prototype.getChartInnerArea=function(){return this.parentShell.getChartInnerArea()},t.prototype.requestPaint=function(){this.parentShell.requestPaint()},t.prototype.paintNow=function(t){this.parentShell.paintNow(t)},t.prototype.buildDom=function(){this.container=this.parentShell.container,this.interactiveContainer=this.parentShell.interactiveContainer,this.backgroundContainer=this.parentShell.backgroundContainer,this.menuContainer=this.parentShell.menuContainer},t.prototype.remove=function(){this.parentShell.events.removeSubchart(this.chart)},t.prototype.updateSettings=function(t){t.area&&this.updateSize()},t.prototype.updateSize=function(t){void 0===t&&(t=!1);var e=this.settings.area;this.events.setNewSize(new gt(e.left,e.top,e.left+e.width,e.top+e.height),!1,t)},t.prototype.prepareContext=function(t){var e=this.settings.area.style;if(e.fillColor){var i=t.context,n=this.scene;i.fillStyle=e.fillColor,i.fillRect(n.chartLeft,n.chartTop,n.chartWidth,n.chartHeight)}},t.prototype.finalizeContext=function(t){var e=this.settings.area.style;if(e.overlayColor){var i=t.context,n=this.scene;i.fillStyle=e.overlayColor,i.fillRect(n.chartLeft,n.chartTop,n.chartWidth,n.chartHeight)}},t.prototype.forceChromeRedraw=function(){this.parentShell.forceChromeRedraw()},t.prototype.setFullscreen=function(t){},t}();s.ChartInnerShell=kt;var Pt=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.paintOrder=70,this.updateOrder=200,this.scene=null,this.loadingTime=null,this.chart=e,this.scene=e.scene}return n(e,t),e.prototype.doAnimations=function(t){this.scene.loading&&(t.animating=!0)},e.prototype.paintScene=function(t){var e=this.scene,i=e.getMessage(),n=e.settings.advanced.style,s=n.loadingArcStyle,r=e.loading&&"hidden"!==s.location;if(r||(this.loadingTime=null),i||r){null===this.loadingTime&&(this.loadingTime=t.timeStamp);var a,o,l=t.context,h="corner"===s.location,u=s.r,c=s.lineWidth;if(h){a=e.x0+e.width-1.2*(u+c),o=e.y0+1.2*(u+c);var d=this.chart.shell.getChartInnerArea();o+=d.findTopPosition(a,a)}else a=e.x0+e.width/2,o=e.y0+e.height/2+u;if(i){var p=n.messageTextStyle;l.textBaseline="top",l.textAlign="left";var f=O.getTextHeight(l,p.font),g=O.getTextWidth(l,p,i),m=void 0,v=void 0,y=void 0,S=n.messageBackgroundStyle,b=S.padding||0;r&&(h?(a-=b,m=a-1.2*u-g,v=f>2*u?4:o-f/2,y=g+2.2*u):(o-=f/2,m=a-g/2,v=o+1.3*f,y=g));var C=O.beginStrokeAndFill(l,S);C.rect(m-b,o-u-b,y+2*b,v-o+u+2*b+f),O.endStrokeAndFill(l,C,S),O.drawText(l,p,i,m,v),O.resetTextStyle(l)}if(r){l.save(),l.lineCap="round",l.lineWidth=c;var x=(t.timeStamp-this.loadingTime)/700*Math.PI,w=l.createLinearGradient(a+u*Math.cos(x+Math.PI),o+u*Math.sin(x+Math.PI),a+u*Math.cos(x),o+u*Math.sin(x));w.addColorStop(0,s.lineColor),w.addColorStop(1,"transparent"),l.strokeStyle=w,l.beginPath(),l.arc(a,o,u,x,x+Math.PI),l.stroke(),O.restore(l)}}},e}(A);s.MessagesOverlay=Pt;var It="undefined"!=typeof document?document.currentScript:null,Dt=null,Ft=function(){if(Dt)return Dt;if("undefined"==typeof document)return"";var e=t.PackageInfo.LibraryName;"<?"===e.substr(0,2)&&(e="everything");var i=e.indexOf("-");i>-1&&(e=e.substr(0,i));for(var n=new RegExp("^(.*?/"+e+"(-dev|.min|).js)"),r=document.getElementsByTagName("script"),a=0;a<r.length;a++){var o=r[a].src;if(o){var l=o.match(n);if(l)return Dt=l[1]+"/../assets/"}}return It&&It.src?(s.Helpers.warn("Cannot locate the ZoomCharts script path based on file name '"+e+".js'. The script path was detected using `document.currentScript` which is not supported on all browsers. Please specify 'assetsUrlBase' in settings when creating the chart for full browser compatibility."),Dt=It.src.match(/^([^?#]*)/)[1]+"/../assets/"):Dt=""},Nt=function(){function t(){}return t.hasPendingRequests=function(){return u.hasProperties(this._imageLoading)||u.hasProperties(this.pendingHTMLAssets)},t.getAssetImage=function(t,e,i){var n=this;if(this._imageCache.hasOwnProperty(t))return this._imageCache[t];if(this._imageLoading.hasOwnProperty(t))return null;if(!t)return null;var s=function(e){if(delete n._imageLoading[t],n._imageCache[t]=e,i)return i(e)},r=function(){var t=c.ErrorImage,i=n._imageCache[t];if(i)s(i);else if(n._imagesPendingForErrors.push(s),!n._imageLoading.hasOwnProperty(t)){var r=function(e){delete n._imageLoading[t],n._imageCache[t]=e;for(var i=0;i<n._imagesPendingForErrors.length;i++){var s=n._imagesPendingForErrors[i];s(e)}n._imagesPendingForErrors=null};u.buildImage(t,e,r,function(){u.error("Could not load '"+t+"'")}),n._imageCache.hasOwnProperty(t)||(n._imageLoading[t]=!0)}};return this._imageLoading[t]=!0,u.buildImage(t,e,s,r),this._imageCache.hasOwnProperty(t)?this._imageCache[t]:null},t.loadHtmlAssets=function(t,e){for(var i=this,n=!1,s=0;s<t.length;s++){var r=t[s];this.loadedHTMLAssets[r.url]||(this.pendingHTMLAssets[r.url]?n=!0:this.loadHTMLAsset(r,function(t){return i.htmlAssetLoaded(t)})&&(this.pendingHTMLAssets[r.url]=!0,n=!0))}return!!n&&(this.callbacks.push(e),!0)},t.htmlAssetLoaded=function(t){if(delete this.pendingHTMLAssets[t],this.loadedHTMLAssets[t]=!0,!u.hasProperties(this.pendingHTMLAssets)){for(var e=0;e<this.callbacks.length;e+=1)this.callbacks[e](this.errors);this.callbacks=[],this.errors=[]}},t.loadHTMLAsset=function(t,e){var i,n=this,r=t.url,a=r.toUpperCase(),o=a.indexOf(".CSS"),l=a.indexOf(".JS"),h=!1,c=null,d=!1,p=function(){c&&window.clearInterval(c),d||(d=!0,!h&&t.required&&t.required()&&n.errors.push("The `required` delegate did not return `false` after loading "+r),e(r))},f=function(){c&&window.clearInterval(c),d||(d=!0,n.errors.push("Failed to load asset: "+r),e(r))};if(o>l){var g=document.createElement("link");if(g.rel="stylesheet",g.href=r,g.type="text/css",!t.required){s.Helpers.warn("Asset url "+r+" does not define the `required` delegate which prevents the detection of asset load in older browsers.");var m=5;t.required=function(){return m-- >0},h=!0}var v=100;c=window.setInterval(function(){v--<0?f():t.required()||p()},100),i=g}else{if(!(l>-1))return this.errors.push("Assets: Do not know how to load "+r+'. The URL should contain either ".css" or ".js" - it can be either in the path, the file name or the query string.'),!1;var y=document.createElement("script");y.src=r,y.type="text/javascript",y.async=!1,i=y}return u.listen(i,"load",p),u.listen(i,"error",f),document.getElementsByTagName("head")[0].appendChild(i),!0},t._imageCache={},t._imageLoading={},t._imagesPendingForErrors=[],t.loadedHTMLAssets={},t.pendingHTMLAssets={},t.callbacks=[],t.errors=[],t}(),Et=function(){function e(t){this.chart=t,this.settings=t.settings;var e=this.settings.assetsUrlBase||Ft();e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.assetsUrlBase=e}return e.prototype.getAssetUrl=function(e){return 0===e.indexOf("builtin://")?this.settings.advanced.builtinAssets[e.slice(10)]:0===e.indexOf("assets://")?(this.assetsUrlBase||this.chart.error("Cannot locate the ZoomCharts script path based on file name '"+t.PackageInfo.LibraryName+".js'. Please specify 'assetsUrlBase' in settings when creating the chart."),this.assetsUrlBase+e.slice(9)):e},e.prototype.hasPendingRequests=function(){return Nt.hasPendingRequests()},e.prototype.getAssetImage=function(t,e){var i=this;return Nt.getAssetImage(this.getAssetUrl(t),this.settings.advanced.crossOriginHeader,function(t){i.chart.events.requestPaint(),e&&e(t)})},e.prototype.ensureAssetsList=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n];u.isString(s)?i.push({url:s,required:null}):s.required&&!s.required()||i.push(s)}var r=this.loadAssetsList(i,function(){e(!0)});r||e(!1)},e.prototype.loadAssetsList=function(t,e){for(var i=this,n=0;n<t.length;n++){var s=t[n];s.url=this.getAssetUrl(s.url)}var r=function(t){for(var n=0;n<t.length;n+=1)i.chart.error(t[n]);i.chart.log("Assets loaded"),e()},a=Nt.loadHtmlAssets(t,r);return a&&this.chart.log("Loading assets"),a},e}();s.AssetsLoader=Et;var zt=function(){function t(e,i,n,s,r){if(void 0===s&&(s="<>"),void 0===r&&(r=null),this.t=0,this.startSpeed=0,this.duration=n,this.from=e,this.to=i,null==this.from&&(this.from=this.to),this.startTime=r,this.x=this.from,this.t=this.startTime,this.formula=t.easingFormulas[s],!this.formula)throw new Error("Easing formula not defined: "+s)}return t.prototype.jump=function(t){this.to=t,this.from=t,this.x=t,this.t=this.startTime=null},t.prototype.reset=function(t,e,i){void 0===i&&(i=null),this.from=t,this.to=e,this.startTime=i,this.x=this.from,this.t=this.startTime},t.prototype.retarget=function(t,e){return this.finished(this.t)?this.startSpeed=0:(this.startSpeed=this._getSpeed(),e||(e=this.t)),e?(this.from=this.get(e),this.startTime=e):(this.startTime=null,this.from=this.x),this.to=t,this},t.prototype.switchCoordinates=function(t,e){this.from=this.from*e+t,this.x=this.x*e+t,this.to=this.to*e+t,this.startSpeed=this.startSpeed*e},t.prototype.updateAndGet=function(t,e){var i=this.x!==t;return t!==this.to&&this.retarget(t,e),{value:this.get(e),changes:i}},t.prototype.updateAndGetFixed=function(t,e){var i=this.x!==t;return t!==this.to&&(this.startSpeed=0,this.startTime=e,this.from=this.x,this.to=t),{value:this.get(e),changes:i}},t.prototype.getClean=function(t){return this.duration<=0?this.to:this.startTime?this._calculate(t):this.from},t.prototype._calculate=function(t){var e=Math.min(1,Math.max(t-this.startTime,0)/this.duration);if(e>=1)return this.to;var i=this.formula(e),n=i*(this.to-this.from);if(this.startSpeed&&e<1){var s=this.startSpeed*e*this.duration;n=n*i+s*(1-i)}return n=this.from+n},t.prototype.get=function(t){if(this.duration<=0)return this.t=t,this.x=this.to,this.to;this.startTime||(this.startTime=t);var e=this._calculate(t);return this.t=t,this.x=e,e},t.prototype.finished=function(t){return this.startTime||(this.startTime=t),t>=this.startTime+this.duration},t.prototype._getSpeed=function(){var t=this.t,e=this.duration/1e3,i=this.getClean(t-e/2),n=this.getClean(t+e/2);return this.t=t,(n-i)/e},t.easingFormulas={"=":function(t){return t},"<>":function(t){return t<.5?2*t*t:-.5*((2*t-1)*(2*t-3)-1)},scroll:function(t){return 1-(1-t)*(1-t)}},t}();s.Animator=zt;var Ot=function(){function t(t,e,i,n,s){void 0===n&&(n="<>"),void 0===s&&(s=null),this._animator=new zt(0,1,i,n,s),this.reset(t,e,s)}return t.prototype.reset=function(t,e,i){return u.isString(t)||null==t?this._fromColor=N.parse(t):this._fromColor=t,u.isString(e)||null==e?this._toColor=N.parse(e):this._toColor=e,this._animator.reset(0,1,i),this},t.prototype.getColor=function(t){var e=Math.min(1,this._animator.get(t));return this._lastValue=N.blend(this._fromColor,this._toColor,e)},t.prototype.get=function(t){return N.format(this.getColor(t))},t.prototype.updateAndGet=function(t,e){(u.isString(t)||null==t)&&(t=N.parse(t));var i=!N.areEqual(this._lastValue,t);return N.areEqual(this._toColor,t)||this.reset(this._lastValue,t,e),{value:this.get(e),changes:i}},t.prototype.finished=function(t){return this._animator.finished(t)},t}();s.ColorAnimator=Ot;var Ht=function(t){function e(e){t.call(this),this.animationOrder=0,this.paintOrder=1e4,this.touches={},this.fps=0,this.prevFrame=null,this.frameCount=0,this.chart=e,this.settings=e.settings.advanced,this.captureTouches=this.settings.showTouches}return n(e,t),e.prototype.onSceneChange=function(t){this.captureTouches=this.settings.showTouches},e.prototype.paintScene=function(t){var e="";if(this.settings.showTimestamp&&(e+=Math.round(t.timeStamp)),this.settings.showFPS){if(this.frameCount+=1,this.prevFrame){var i=Math.max(t.timeStamp-this.prevFrame,1)/1e3,n=1/i,s=Math.min(1,3*i);this.fps=this.fps*(1-s)+n*s}this.prevFrame=t.timeStamp,e+="FPS:"+Math.round(this.fps)}var r=t.context;if(this.captureTouches){var a=this.settings.showTouchTrail,o=0;for(var l in this.touches){var h=this.touches[l];if(this.touches.hasOwnProperty(l)){r.beginPath(),r.moveTo(h.dx,h.dy);for(var u=0;u<h.trace.length;u++){var c=h.trace[u];r.lineTo(c.x,c.y)}a&&h.cancelled?(r.strokeStyle="red",r.fillStyle="red",r.lineWidth=1):a&&h.up?(r.strokeStyle="gray",r.fillStyle="gray",r.lineWidth=3):(r.strokeStyle="rgba(180,180,180,0.4)",r.fillStyle="rgba(180,180,180,0.3)",r.lineWidth=3),r.moveTo(h.x+30,h.y),r.stroke(),r.lineWidth=1.5,r.beginPath(),r.arc(h.x,h.y,h.animator.get(t.timeStamp),0,2*Math.PI),r.stroke(),r.fill(),h.up||(o+=1),h.animator.finished(t.timeStamp)||(t.animating=!0)}}r.beginPath(),r.fillStyle="black";for(var l in this.touches)if(this.touches.hasOwnProperty(l))for(var h=this.touches[l],u=0;u<h.trace.length;u++){
  35. var c=h.trace[u];r.rect(c.x-1,c.y-1,2,2)}r.fill(),a&&(e+="\ntouches:"+o)}if(e.length>0){var d=this.chart.shell.getChartInnerArea(),p=Math.max(30,d.findTopPosition(50,200));O.resetTextStyle(r),r.fillStyle="#000",r.textAlign="start",r.textBaseline="middle",r.font="bold 11px Arial",r.fillText(e,50,p)}},e.prototype.previewPointerDown=function(t){if(this.captureTouches){for(var e in this.touches){var i=this.touches[e];this.touches.hasOwnProperty(e)&&i.up&&delete this.touches[e]}this.touches[t.identifier]={dx:t.x,dy:t.y,x:t.x,y:t.y,up:!1,cancelled:!1,trace:[],animator:new s.Animator(10,40,200)},t.changes.requestPaint=!0}},e.prototype.previewPointerDrag=function(t){if(this.captureTouches){var e=this.touches[t.identifier];e.x=t.x,e.y=t.y,this.settings.showTouchTrail&&e.trace.push({x:e.x,y:e.y}),t.changes.requestPaint=!0}},e.prototype.previewPointerUp=function(t){if(this.captureTouches){var e=this.touches[t.identifier];e.up=!0,e.animator.retarget(0),this.previewPointerDrag(t),t.changes.requestPaint=!0}},e.prototype.previewPointerCancel=function(t){if(this.captureTouches){var e=this.touches[t.identifier];e.up=!0,e.cancelled=!0,e.animator.retarget(0),this.previewPointerDrag(t),t.changes.requestPaint=!0}},e}(A);s.TouchMarkers=Ht;var _t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Rt=function(){function t(){}return t.createImage=function(e,i,n,r){var a=t.getSizes(e,n),o=document.createElement("canvas");o.width=a.width,o.height=a.height;var l=o.getContext("2d");r||(l.fillStyle="#fff",l.fillRect(0,0,a.width,a.height)),e.exportToContext(l,o,a.scale);try{return o.toDataURL(i)}catch(t){throw s.Helpers.error(t),new Error("Browser security prevents exporting this chart. The canvas might be tainted. See `advanced.crossOriginHeader` setting in the documentation.")}},t.createPdf=function(e,i){var n,s=e.exportToImageGetDimensions(),r=[10,10,10,10],a=e.settings.advanced.exportPdfSize,o=0,l=0,h=0,u=0,c=72,d=1,p=0,f=0;s.width>=s.height?(a=[a[1],a[0]],n="l"):n="p",o=a[0]/25.4*c,l=a[1]/25.4*c,d=Math.min(l/s.height,o/s.width),"l"===n?(p=s.width*d/o*a[0]-r[1]-r[3],h=(a[0]-p-r[1]-r[3])/2,f=s.height/s.width*p,u=(a[1]-r[0]-r[2]-f)/2):(f=s.height*d/l*a[1]-r[0]-r[2],u=(a[1]-f-r[0]-r[2])/2,p=s.width/s.height*f,h=(a[0]-r[1]-r[3]-p)/2);var g=t.createImage(e,"image/jpeg",{scaling:3*d},!1),m=new jsPDF(n,"mm",a);return m.addImage(g,"JPEG",r[3]+h,r[0]+u,p,f),m.output("datauristring")},t.createCsv=function(e){for(var i=/[^a-zA-Z0-9\.]/,n="data:text/csv;charset=utf-8,",s=encodeURIComponent("\r\n"),r=0;r<e.length;r++){for(var a=e[r],o=0;o<a.length;o++){o>0&&(n+=t._csvSeparator);var l=a[o];if(null!=l){var h=void 0;h=l instanceof Date?l.toISOString():""+l,n+=i.test(h)?'"'+encodeURIComponent(h.replace('"','""'))+'"':h}}n+=s}return n},t.retrieveData=function(t,e){var i=t.exportVisibleData,n=t.settings.advanced.dataExportFunction;if(!i&&!n)throw new Error("This chart type does not support data export. Provide `advanced.dataExportFunction` delegate to enable it.");var s=i?t.exportVisibleData():null;n?n(s,e):e(s)},t.createExcel=function(t){function e(t){return(t.getTime()+22091616e5)/864e5}for(var i=Object.create(null),n={s:{c:1/0,r:1/0},e:{c:0,r:0}},s=0;s<t.length;s++){n.s.r>s&&(n.s.r=s),n.e.r<s&&(n.e.r=s);for(var r=t[s],a=0;a<r.length;a++){n.s.c>a&&(n.s.c=a),n.e.c<a&&(n.e.c=a);var o=r[a];if(null!=o){var l={t:"s",v:o};"number"==typeof o?(l.t="n",Math.round(o)===o&&(l.z="0")):"boolean"==typeof o?l.t="b":o instanceof Date&&(l.t="n",l.z=XLSX.SSF._table[14],l.v=e(l.v)),i[XLSX.utils.encode_cell({c:a,r:s})]=l}}}n.s.c<1/0&&(i["!ref"]=XLSX.utils.encode_range(n));var h={SheetNames:["export"],Sheets:{export:i}},c=XLSX.write(h,{bookType:"xlsx",bookSST:!0,type:"binary"});return"data:"+_t+";base64,"+u.base64Encode(c)},t.export=function(e,i,n,r,a){void 0===i&&(i="png"),void 0===n&&(n={}),void 0===r&&(r=null);var o=e.shell;if(!(o instanceof Mt))throw new Error("Export functionality is only available on the top level chart, not within nested charts.");var l=t._mimeMap[i];if("xls"===i)s.Helpers.warn("XLS format is not supported. XLSX will be used instead.");else if(null==i)i="png",l=t._mimeMap.png;else if(void 0===l)throw new Error("Export image type `"+i+"` is not supported. Supported types: "+Object.keys(t._mimeMap).join(", "));if(l.transparent?null==r&&(r=!0):r&&(s.Helpers.warn("Only PNG images can be exported as transparent."),r=!1),l.csv)return void t.retrieveData(e,function(e){a(t.createCsv(e),l.mime,l.extension)});if(l.excel)return void e.assetsLoader.ensureAssetsList([{url:"assets://xlsx.core.min.js",required:function(){return"undefined"==typeof XLSX}}],function(){t.retrieveData(e,function(e){a(t.createExcel(e),l.mime,l.extension)})});if(l.image){var h=t.createImage(o,l.mime,t.getDimensions(e,n),r);return a(h,l.mime,l.extension),h}if(l.pdf)return void e.assetsLoader.ensureAssetsList([{url:"assets://jspdf.js",required:function(){return"undefined"==typeof jsPDF}}],function(){a(t.createPdf(o,n),l.mime,l.extension)});throw new Error("not implemented")},t.download=function(t,e,i,n){var s=this;void 0===i&&(i={}),this.export(t,e,i,n,function(e,i,n){s.launchDownload(t,i,n,e)})},t.getSizes=function(t,e){var i=t.exportToImageGetDimensions(),n=i.width,s=i.height,r=u.tryParseFloat(e.width),a=u.tryParseFloat(e.height),o=1;if("mm"===e.unit){var l=u.tryParseFloat(e.dpi,300)/25.4;r>0&&(r*=l),a>0&&(a*=l)}r>0&&a>0?o=Math.min(r/n,a/s):r>0?(o=r/n,a=s*o):a>0?(o=a/s,r=n*o):(r=n,a=s);var h=u.tryParseFloat(e.scaling,1);return 1!==h&&(o*=h,r*=h,a*=h),{width:r,height:a,scale:o,chartWidth:n,chartHeight:s}},t.getDimensions=function(t,e){var i=t.shell;if(!(i instanceof Mt))throw new Error("Export functionality is only available on the top level chart, not within nested charts.");return this.getSizes(i,e||{})},t.dataUriToBlob=function(t,e){var i=e.indexOf(","),n=i>13&&";base64"===e.substr(i-7,7);e=e.substr(i+1),e=n?window.atob(e):decodeURIComponent(e);for(var s=new ArrayBuffer(e.length),r=new Uint8Array(s),a=0;a<e.length;a++)r[a]=e.charCodeAt(a);return new Blob([s],{type:t})},t.launchDownload=function(e,i,n,s){var r=document.body,a="export."+n,o=u.createDom("a",null,null,null);if(navigator.msSaveOrOpenBlob&&window.atob){if(navigator.msSaveOrOpenBlob(t.dataUriToBlob(i,s),a))return}else if(S.detect().isChrome&&s.length>2097152);else if(void 0!==o.download)return o.download=a,o.type=i,o.href=s,r.appendChild(o),o.click(),void r.removeChild(o);var l=e.settings.advanced.exportProxyURL;if(!l)return void alert(e.settings.localization.exportNotAvailable);var h=document.createElement("form");h.action=e.settings.advanced.exportProxyURL,h.target="_top",h.method="POST",h.style.display="none";var c=document.createElement("input");c.name="name",c.value=a,h.appendChild(c);var d=document.createElement("textarea");d.name="data",d.value=s,h.appendChild(d),r.appendChild(h),h.submit(),r.removeChild(h)},t._csvSeparator=";",t._mimeMap={png:{mime:"image/png",extension:"png",image:!0,transparent:!0},jpg:{mime:"image/jpeg",extension:"jpg",image:!0},jpeg:{mime:"image/jpeg",extension:"jpg",image:!0},csv:{mime:"text/csv",extension:"csv",csv:!0},txt:{mime:"text/csv",extension:"csv",csv:!0},xlsx:{mime:_t,extension:"xlsx",excel:!0},xls:{mime:_t,extension:"xlsx",excel:!0},pdf:{mime:"application/pdf",extension:"pdf",pdf:!0}},t}();s.Export=Rt,function(t){var e=function(t){function e(e,i){var n=e.settings.localization.toolbar;if(!i.dropDownItems){var s=e.settings.toolbar.exportOptions,r=[];(!s||s.indexOf("jpg")>-1)&&r.push({label:n.exportJpeg,onClick:function(){return Rt.download(e,"jpg",{scaling:2})}}),(!s||s.indexOf("png")>-1)&&r.push({label:n.exportPNG,onClick:function(){return Rt.download(e,"png",{scaling:3})}}),(!s||s.indexOf("pdf")>-1)&&r.push({label:n.exportPDF,onClick:function(){return Rt.download(e,"pdf")}}),(e.exportVisibleData||e.settings.advanced.dataExportFunction)&&((!s||s.indexOf("csv")>-1)&&r.push({label:n.exportCSV,onClick:function(){return Rt.download(e,"csv")}}),(!s||s.indexOf("xlsx")>-1)&&r.push({label:n.exportXLS,onClick:function(){return Rt.download(e,"xlsx")}})),i.dropDownItems=r}i.title=i.title||n.exportTitle,i.label=i.label||n.exportButton,i.cssClass=i.cssClass||"DVSL-bar-btn-export",t.call(this,e,i)}return n(e,t),e}(t.Dropdown);t.ExportDropdown=e,s.Bar.ToolbarItemNames.export=function(t,e){return new s.Bar.ExportDropdown(t,e)}}(o);var Bt=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.paintOrder=65,this.updateOrder=0,this.chart=e}return n(e,t),e.prototype.onKeyDown=function(t){this.chart.isFullscreen()&&27===t.keyCode?(this.chart.setFullscreen(!1),t.consumed=!0):8===t.keyCode&&this.chart.back(!0,"user")&&(t.consumed=!0)},e}(A);s.KeyShortcuts=Bt;var Ut="C314F39F62CBF2AEFA1D5BA41E38EFFD080E88849EE210BA17971BF63A55C44E159C9F9ED004F8D50856EC8ECE673690F60C29AAC124B7C46D549D20EB22CC2A387B2FB643700546312114F831133F242CFFD023A1788167025FF398F5F09D1003C47C9B3208860A547577F540D07FF66403097FE27E7BB6B8D76036AD31B62B04EAD1BB8B2C314F6DA7489346978286491D0DF7504E9EE85A4459805F4FFCEE664122FC27B80DAD6751A7A6C0D38E9C2ECD7C0AD1F2B774D6FF81C5A2CE14D608F08E13BEE45663450519774ADF87D34CE6150FC819558EBD336511D51405A42E7A38EBB786ED5050345CBC532ED7C0EECB05C5D6D4D00534249ED4585DFABD",Vt=function(){function t(){}return t.verifySignature=function(t,e){var i=new Gt;return i.setPublic(Ut,"10001"),i.verify(t,e)},t.hash=function(t){return Gt.hash(t)},t}();s.RsaCrypto=Vt,Object.freeze(Vt);var Gt=function(){function t(t,e){null!=t&&(null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function e(){return new t(null)}function i(t,e,i,n,s,r){for(;--r>=0;){var a=e*this[t++]+i[n]+s;s=Math.floor(a/67108864),i[n++]=67108863&a}return s}function n(t,e,i,n,s,r){for(var a=32767&e,o=e>>15;--r>=0;){var l=32767&this[t],h=this[t++]>>15,u=o*l+h*a;l=a*l+((32767&u)<<15)+i[n]+(1073741823&s),s=(l>>>30)+(u>>>15)+o*h+(s>>>30),i[n++]=1073741823&l}return s}function s(t,e,i,n,s,r){for(var a=16383&e,o=e>>14;--r>=0;){var l=16383&this[t],h=this[t++]>>14,u=o*l+h*a;l=a*l+((16383&u)<<14)+i[n]+s,s=(l>>28)+(u>>14)+o*h,i[n++]=268435455&l}return s}function r(t){return et.charAt(t)}function a(t,e){var i=it[t.charCodeAt(e)];return null==i?-1:i}function o(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function l(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function h(t){var i=e();return i.fromInt(t),i}function u(e,i){var n;if(16==i)n=4;else if(8==i)n=3;else if(256==i)n=8;else if(2==i)n=1;else if(32==i)n=5;else{if(4!=i)return void this.fromRadix(e,i);n=2}this.t=0,this.s=0;for(var s=e.length,r=!1,o=0;--s>=0;){var l=8==n?255&e[s]:a(e,s);l<0?"-"==e.charAt(s)&&(r=!0):(r=!1,0==o?this[this.t++]=l:o+n>this.DB?(this[this.t-1]|=(l&(1<<this.DB-o)-1)<<o,this[this.t++]=l>>this.DB-o):this[this.t-1]|=l<<o,o+=n,o>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),r&&t.ZERO.subTo(this,this)}function c(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function d(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,n=(1<<e)-1,s=!1,a="",o=this.t,l=this.DB-o*this.DB%e;if(o-- >0)for(l<this.DB&&(i=this[o]>>l)>0&&(s=!0,a=r(i));o>=0;)l<e?(i=(this[o]&(1<<l)-1)<<e-l,i|=this[--o]>>(l+=this.DB-e)):(i=this[o]>>(l-=e)&n,l<=0&&(l+=this.DB,--o)),i>0&&(s=!0),s&&(a+=r(i));return s?a:"0"}function p(){var i=e();return t.ZERO.subTo(this,i),i}function f(){return this.s<0?this.negate():this}function g(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(e=i-t.t,0!=e)return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0}function m(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function v(){return this.t<=0?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)}function y(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function S(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function b(t,e){var i,n=t%this.DB,s=this.DB-n,r=(1<<s)-1,a=Math.floor(t/this.DB),o=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)e[i+a+1]=this[i]>>s|o,o=(this[i]&r)<<n;for(i=a-1;i>=0;--i)e[i]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function C(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)return void(e.t=0);var n=t%this.DB,s=this.DB-n,r=(1<<n)-1;e[0]=this[i]>>n;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&r)<<s,e[a-i]=this[a]>>n;n>0&&(e[this.t-i-1]|=(this.s&r)<<s),e.t=this.t-i,e.clamp()}function x(t,e){for(var i=0,n=0,s=Math.min(t.t,this.t);i<s;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()}function w(e,i){var n=this.abs(),s=e.abs(),r=n.t;for(i.t=r+s.t;--r>=0;)i[r]=0;for(r=0;r<s.t;++r)i[r+n.t]=n.am(0,s[r],i,r,0,n.t);i.s=0,i.clamp(),this.s!=e.s&&t.ZERO.subTo(i,i)}function L(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function A(i,n,s){var r=i.abs();if(!(r.t<=0)){var a=this.abs();if(a.t<r.t)return null!=n&&n.fromInt(0),void(null!=s&&this.copyTo(s));null==s&&(s=e());var o=e(),l=this.s,h=i.s,u=this.DB-m(r[r.t-1]);u>0?(r.lShiftTo(u,o),a.lShiftTo(u,s)):(r.copyTo(o),a.copyTo(s));var c=o.t,d=o[c-1];if(0!=d){var p=d*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),f=this.FV/p,g=(1<<this.F1)/p,v=1<<this.F2,y=s.t,S=y-c,b=null==n?e():n;for(o.dlShiftTo(S,b),s.compareTo(b)>=0&&(s[s.t++]=1,s.subTo(b,s)),t.ONE.dlShiftTo(c,b),b.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--S>=0;){var C=s[--y]==d?this.DM:Math.floor(s[y]*f+(s[y-1]+v)*g);if((s[y]+=o.am(0,C,s,S,0,c))<C)for(o.dlShiftTo(S,b),s.subTo(b,s);s[y]<--C;)s.subTo(b,s)}null!=n&&(s.drShiftTo(c,n),l!=h&&t.ZERO.subTo(n,n)),s.t=c,s.clamp(),u>0&&s.rShiftTo(u,s),l<0&&t.ZERO.subTo(s,s)}}}function T(i){var n=e();return this.abs().divRemTo(i,null,n),this.s<0&&n.compareTo(t.ZERO)>0&&i.subTo(n,n),n}function M(t){this.m=t}function k(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function P(t){return t}function I(t){t.divRemTo(this.m,null,t)}function D(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function F(t,e){t.squareTo(e),this.reduce(e)}function N(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function E(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function z(i){var n=e();return i.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),i.s<0&&n.compareTo(t.ZERO)>0&&this.m.subTo(n,n),n}function O(t){var i=e();return t.copyTo(i),this.reduce(i),i}function H(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function _(t,e){t.squareTo(e),this.reduce(e)}function R(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function B(){return 0==(this.t>0?1&this[0]:this.s)}function U(i,n){if(i>4294967295||i<1)return t.ONE;var s=e(),r=e(),a=n.convert(this),o=m(i)-1;for(a.copyTo(s);--o>=0;)if(n.sqrTo(s,r),(i&1<<o)>0)n.mulTo(r,a,s);else{var l=s;s=r,r=l}return n.revert(s)}function V(t,e){var i;return i=t<256||e.isEven()?new M(e):new E(e),this.exp(t,i)}function G(e,i){return new t(e,i)}function W(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function j(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=G(t,16),this.e=parseInt(e,16)):alert("Invalid RSA public key")}function Y(t){return t.modPowInt(this.e,this.n)}function q(t){for(var e in st.crypto.Util.DIGESTINFOHEAD){var i=st.crypto.Util.DIGESTINFOHEAD[e],n=i.length;if(t.substring(0,n)==i)return[e,t.substring(n)]}return[]}function Z(t,e){e=e.replace(rt,""),e=e.replace(/[ \n]+/g,"");var i=G(e,16);if(i.bitLength()>this.n.bitLength())return!1;var n=this.doPublic(i),s=n.toString(16).replace(/^1f+00/,""),r=q(s);if(0===r.length)return!1;var a=r[1],o=nt.hash(t);return a===o}var X,Q=0xdeadbeefcafe,K=15715070==(16777215&Q);"undefined"==typeof window?null:window.crypto||window.msCrypto;K&&"undefined"!=typeof navigator&&"Microsoft Internet Explorer"===navigator.appName?(t.prototype.am=n,X=30):K&&"undefined"!=typeof navigator&&"Netscape"!==navigator.appName?(t.prototype.am=i,X=26):(t.prototype.am=s,X=28),t.prototype.DB=X,t.prototype.DM=(1<<X)-1,t.prototype.DV=1<<X;var J=52;t.prototype.FV=Math.pow(2,J),t.prototype.F1=J-X,t.prototype.F2=2*X-J;var $,tt,et="0123456789abcdefghijklmnopqrstuvwxyz",it=new Array;for($="0".charCodeAt(0),tt=0;tt<=9;++tt)it[$++]=tt;for($="a".charCodeAt(0),tt=10;tt<36;++tt)it[$++]=tt;for($="A".charCodeAt(0),tt=10;tt<36;++tt)it[$++]=tt;M.prototype.convert=k,M.prototype.revert=P,M.prototype.reduce=I,M.prototype.mulTo=D,M.prototype.sqrTo=F,E.prototype.convert=z,E.prototype.revert=O,E.prototype.reduce=H,E.prototype.mulTo=R,E.prototype.sqrTo=_,t.prototype.copyTo=o,t.prototype.fromInt=l,t.prototype.fromString=u,t.prototype.clamp=c,t.prototype.dlShiftTo=y,t.prototype.drShiftTo=S,t.prototype.lShiftTo=b,t.prototype.rShiftTo=C,t.prototype.subTo=x,t.prototype.multiplyTo=w,t.prototype.squareTo=L,t.prototype.divRemTo=A,t.prototype.invDigit=N,t.prototype.isEven=B,t.prototype.exp=U,t.prototype.toString=d,t.prototype.negate=p,t.prototype.abs=f,t.prototype.compareTo=g,t.prototype.bitLength=v,t.prototype.mod=T,t.prototype.modPowInt=V,t.ZERO=h(0),t.ONE=h(1),W.prototype.doPublic=Y,W.prototype.setPublic=j;var nt={};nt.utf8Encode=function(t){return window.unescape(encodeURIComponent(t))},nt.hash=function(t){t=nt.utf8Encode(t);var e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],i=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];t+=String.fromCharCode(128);for(var n=t.length/4+2,s=Math.ceil(n/16),r=new Array(s),a=0;a<s;a++){r[a]=new Array(16);for(var o=0;o<16;o++)r[a][o]=t.charCodeAt(64*a+4*o)<<24|t.charCodeAt(64*a+4*o+1)<<16|t.charCodeAt(64*a+4*o+2)<<8|t.charCodeAt(64*a+4*o+3)}r[s-1][14]=8*(t.length-1)/Math.pow(2,32),r[s-1][14]=Math.floor(r[s-1][14]),r[s-1][15]=8*(t.length-1)&4294967295;for(var l,h,u,c,d,p,f,g,m=new Array(64),a=0;a<s;a++){for(var v=0;v<16;v++)m[v]=r[a][v];for(var v=16;v<64;v++)m[v]=nt.s1(m[v-2])+m[v-7]+nt.s0(m[v-15])+m[v-16]&4294967295;l=i[0],h=i[1],u=i[2],c=i[3],d=i[4],p=i[5],f=i[6],g=i[7];for(var v=0;v<64;v++){var y=g+nt.S1(d)+nt.Ch(d,p,f)+e[v]+m[v],S=nt.S0(l)+nt.Maj(l,h,u);g=f,f=p,p=d,d=c+y&4294967295,c=u,u=h,h=l,l=y+S&4294967295}i[0]=i[0]+l&4294967295,i[1]=i[1]+h&4294967295,i[2]=i[2]+u&4294967295,i[3]=i[3]+c&4294967295,i[4]=i[4]+d&4294967295,i[5]=i[5]+p&4294967295,i[6]=i[6]+f&4294967295,i[7]=i[7]+g&4294967295}return nt.toHexStr(i[0])+nt.toHexStr(i[1])+nt.toHexStr(i[2])+nt.toHexStr(i[3])+nt.toHexStr(i[4])+nt.toHexStr(i[5])+nt.toHexStr(i[6])+nt.toHexStr(i[7])},nt.ROTR=function(t,e){return e>>>t|e<<32-t},nt.S0=function(t){return nt.ROTR(2,t)^nt.ROTR(13,t)^nt.ROTR(22,t)},nt.S1=function(t){return nt.ROTR(6,t)^nt.ROTR(11,t)^nt.ROTR(25,t)},nt.s0=function(t){return nt.ROTR(7,t)^nt.ROTR(18,t)^t>>>3},nt.s1=function(t){return nt.ROTR(17,t)^nt.ROTR(19,t)^t>>>10},nt.Ch=function(t,e,i){return t&e^~t&i},nt.Maj=function(t,e,i){return t&e^t&i^e&i},nt.toHexStr=function(t){for(var e,i="",n=7;n>=0;n--)e=t>>>4*n&15,i+=e.toString(16);return i};var st={crypto:{Util:{DIGESTINFOHEAD:{sha256:"3031300d060960864801650304020105000420"}}}},rt=new RegExp("[^0-9a-f]","gi");return W.prototype.verify=Z,W.hash=nt.hash,W}(),Wt=function(){function t(t,e,i){var n=this;this.api=null,this.scene=null,this.settings=null,this.shell=null,this.events=null,this.removed=!0,this.assetsLoaded=!1,this.toolbar=null,this.data={},this.navigator=null,this.curState=null,this.goingBack=!1,this.chartUpdateOrigin=null,this.chartUpdateTimeout=null,this.scene=e,this.settings=t,this.api=i,i._impl=this,this.scene.settings=t,this.scene.assetsLoader=this.assetsLoader=new Et(this),this.data={},this.settings.parentChart?(this.shell=new kt(this,this.settings.parentChart._impl.shell),this.events=this.shell.events):(this.shell=new Mt(this,this.createDomLayer()),this.events=this.shell.events,this.events.addElement(new Ht(this)),this.events.addElement(new et(this)),this.events.addElement(new F(this,this.settings.credits))),//window.setTimeout(function(){return Zt.execute(n,!!n.settings.parentChart)},500),
  36. this.removed=!1,this.EVENT_NAMES={};var s;for(s in t.events)if(0===s.indexOf("on")){var r=s.charAt(2).toLowerCase()+s.slice(3);this.EVENT_NAMES[s]=r,this.EVENT_NAMES[r]=r}this.eventListeners={},this.assetsLoaded=!1,this.assetsLoader.ensureAssetsList(this.settings.advanced.assets,function(){return n.notifyAssetsLoaded()}),this.clearData(),this.events.addElement(new Bt(this)),this.title=this.events.addElement(new _(this)),this.events.addElement(new Pt(this))}return t.prototype.createDomLayer=function(){return new s.DomLayer(this)},t.prototype.updateFilters=function(t){this.events.notifySceneChanges({filters:!0})},t.prototype.updateStyle=function(t){this.events.notifySceneChanges({style:!0})},t.prototype.defaultDoubleClick=function(t,e){},t.prototype.defaultTripleClick=function(t,e){},t.prototype.defaultClick=function(t,e){},t.prototype.defaultRightClick=function(t,e){},t.prototype.finalInitialize=function(){var t={settings:!0,settingsChanges:this.scene.settings,data:{}};this.processChangedSettings(t),this.events.notifySceneChanges(t),this.updateSize(),this.updateEvents(null,this.settings.events)},t.prototype.getRootChart=function(){var t=this.settings.parentChart;return t?t._impl.getRootChart():this},t.prototype.processChangedSettings=function(t){},t.prototype.updateSettings=function(t,e){var i=this;if(void 0===e&&(e=null),!this.removed){var n=u.clone(this.settings.events),s=this.settings.apply(t),r={settings:!0,settingsChanges:s};this.processChangedSettings(r),s.events&&this.updateEvents(n,this.settings.events),s.advanced&&s.advanced.assets&&(this.assetsLoaded=!1,this.assetsLoader.ensureAssetsList(this.settings.advanced.assets,function(){return i.notifyAssetsLoaded()})),s.data&&this.dataSettingsChanged(s.data),this.shell.updateSettings(s),this.onSettingsChanged(s),s.toolbar&&this.assetsLoaded&&this.createToolbar(),this.events.notifySceneChanges(r);var a=s.area;if(a&&(a.width||a.height||a.maxWidth||a.minWidth||a.minHeight||a.maxHeight)&&this.updateSize(!0),e){var o=this.createEventArguments(null,e);o.changes=s,this.notifySettingsChanged(o)}}},t.prototype.getData=function(t){if(this.data[t])return this.data[t];var e=this.settings._computedDataMap[t];if(e){var i=this.createDataObj(e);return i.applyPreloadedData(),this.data[t]=i,i}throw new Error("No data configured for source ID "+t)},t.prototype.addData=function(t,e){this.removed||this.getData(e).addData(t)},t.prototype.reloadData=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=!1),!this.removed){this.log("Reload data"),t?this.data[t]&&(this.data[t].remove(),delete this.data[t]):this.clearData(),this.scene.mainDataEnabled&&(this.scene.mainData=this.getData(this.settings.data[0].id));var i={};for(var n in this.settings._computedDataMap)i[n]=!0;this.events.notifySceneChanges({data:i,dataDeep:e}),this.navigator&&this.navigator.onNewDataObject()}},t.prototype.replaceData=function(t,e){if(void 0===e&&(e="default"),null==e&&(e="default"),!this.removed){this.events.clearSceneChanges({dataArrived:null}),this.data[e]&&this.data[e].remove();var i=this.data[e]=this.createDataObj(this.settings._computedDataMap[e]);i.addData(t),this.scene.mainDataEnabled&&(this.scene.mainData=this.getData(this.settings.data[0].id));var n={};n[e]=!0,this.events.notifySceneChanges({data:n}),this.navigator&&this.navigator.onNewDataObject()}},t.prototype.clearData=function(t){void 0===t&&(t=!1);for(var e in this.data){var i=this.data[e];i.remove()}this.events.clearSceneChanges({dataArrived:null}),this.data={},this.scene.mainData=null,!t&&this.scene.mainDataEnabled&&(this.scene.mainData=this.getData(this.settings.data[0].id))},t.prototype.dataSettingsChanged=function(t){for(var e in this.data)!t[e]&&this.settings._computedDataMap[e]||(this.data[e].remove(),delete this.data[e]);this.events.clearSceneChanges({dataArrived:null}),this.events.notifySceneChanges({data:t,dataDeep:!0}),this.scene.mainDataEnabled&&(this.scene.mainData=this.getData(this.settings.data[0].id)),this.navigator&&this.navigator.onNewDataObject()},t.prototype.hasPendingRequests=function(){if(!this.assetsLoaded)return!0;if(this.assetsLoader.hasPendingRequests())return!0;for(var t in this.data)if(this.data[t].hasPendingRequests())return!0;return!1},t.prototype.remove=function(){return this.removed?void s.Helpers.warn("Removing already removed chart"):(this.cancelChartUpdateNotify(),this.removed=!0,this.toolbar&&this.toolbar.remove(),this.shell.remove(),this.clearData(!0),this.shell=null,this.scene=null,void(this.events=null))},t.prototype.setFullscreen=function(t){this.shell.setFullscreen(t)},t.prototype.isFullscreen=function(){return this.shell.fullScreenMode},t.prototype.updateSize=function(t){void 0===t&&(t=!1),this.removed||this.shell.updateSize(t)},t.prototype.on=function(t,e){var i=this.EVENT_NAMES[t];return i?(this.eventListeners[i]||(this.eventListeners[i]=[]),void this.eventListeners[i].push(e)):void this.error("Unrecognized event name: "+t)},t.prototype.off=function(t,e){var i=this.EVENT_NAMES[t];return i?this.eventListeners[i]?u.removeFromArray(this.eventListeners[i],e):void 0:void this.error("Unrecognized event name: "+t)},t.prototype.updateEvents=function(t,e){var i=t,n=e;for(var s in this.EVENT_NAMES){var r=this.EVENT_NAMES[s];t&&i[s]&&this.off(r,i[s]),n[s]&&this.on(r,n[s])}},t.prototype.notifyHoverChanged=function(t,e){this.dispatchEvent("hoverChange",t,e,null)},t.prototype.notifyDoubleClick=function(t,e){var i=this;this.dispatchEvent("doubleClick",t,e,function(t,e){return i.defaultDoubleClick(t,e)})},t.prototype.notifyTripleClick=function(t,e){var i=this;this.dispatchEvent("tripleClick",t,e,function(t,e){return i.defaultTripleClick(t,e)})},t.prototype.notifyRightClick=function(t,e){var i=this;this.dispatchEvent("rightClick",t,e,function(t,e){return i.defaultRightClick(t,e)})},t.prototype.notifyClick=function(t,e){var i=this;this.dispatchEvent("click",t,e,function(t,e){return i.defaultClick(t,e)})},t.prototype.notifySelectionChanged=function(t){return this.dispatchEventParams("selectionChange",t,null)},t.prototype.notifySettingsChanged=function(t){return this.dispatchEventParams("settingsChange",t,null)},t.prototype.notifyPositionChange=function(t){return this.dispatchEventParams("positionChange",t,null)},t.prototype.notifyChartUpdate=function(t,e){var i=this;void 0===e&&(e=!1);var n=u.performanceNow();e&&(this.chartUpdateForce=!0),t&&(this.chartUpdateWasBack=this.goingBack,this.chartUpdateOrigin=t,this.chartUpdateTime=n),this.chartUpdateState=this.saveNavigation(),null===this.chartUpdateTimeout&&(this.chartUpdateTimeout=setTimeout(function(){return i.chartUpdateNotify()},this.chartUpdateTime+this.scene.settings.events.chartUpdateDelay-n))},t.prototype.cancelChartUpdateNotify=function(){this.chartUpdateOrigin=null,this.chartUpdateTimeout&&(clearTimeout(this.chartUpdateTimeout),this.chartUpdateTimeout=null)},t.prototype.chartUpdateNotify=function(){this.chartUpdateTimeout=null;var t=this.chartUpdateOrigin;if(t){var e=this.chartUpdateState;!e||this.curState&&JSON.stringify(e)===JSON.stringify(this.curState)?this.chartUpdateForce&&(this.chartUpdateForce=!1,this.chartUpdateOrigin=null,this.chartUpdateState=null,this.doChartUpdateNotify(t)):(this.chartUpdateForce=!1,!this.chartUpdateWasBack&&this.curState&&(this.scene.pushBack(this.curState),this.events.notifySceneChanges({requestPaint:!0})),this.curState=e,this.chartUpdateOrigin=null,this.chartUpdateState=null,this.doChartUpdateNotify(t))}},t.prototype.doChartUpdateNotify=function(t){var e=this.createEventArguments(null,t);this.dispatchEventParams("chartUpdate",e,null)},t.prototype.back=function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e="api"),0===this.scene.backStack.length)return!1;var i=this.scene.backStack.pop();return this.goingBack=!0,this.restoreNavigation(i,t,e),this.goingBack=!1,!0},t.prototype.goHome=function(t,e){if(void 0===t&&(t=!0),void 0===e&&(e="api"),0===this.scene.backStack.length)return!1;var i=this.scene.backStack[0];return this.restoreNavigation(i,t,e),!0},t.prototype.clearHistory=function(){return this.scene.backStack=[],!0},t.prototype.dispatchEventParams=function(t,e,i){var n=new b(0,0,u.performanceNow(),"api");return i||this.eventListeners[t]&&this.eventListeners[t].length?(this.dispatchEvent(t,n,e,i),n):n},t.prototype.dispatchEvent=function(t,e,i,n){if(n||this.eventListeners[t]&&this.eventListeners[t].length>0){for(var s=Object.keys(i),r=0;r<s.length;r++)e[s[r]]=i[s[r]];if(this.eventListeners[t])for(var a=0;a<this.eventListeners[t].length;a++){var o=this.eventListeners[t][a];this.log("Call user event handler, "+t,e,i),o.call(this.api,e,i)}!e.defaultPrevented&&n&&(this.log("Call default event handler, "+t),n.call(this.api,e,i))}},t.prototype.error=function(t,e){var i=this;void 0===e&&(e=null);var n=this.createEventArguments(null,"api");n.message=t,n.arg=e,this.dispatchEventParams("error",n,function(t,e){return i.defaultError(t,e)})},t.prototype.log=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this.settings.advanced.logging&&u.log(t,e)},t.prototype.deprecated=function(t,e){var i="Deprecated: "+t+".";e&&(i+=" Use "+e+" instead"),s.Helpers.warn(i)},t.prototype.defaultError=function(t,e){e.arg?u.error(e.message,e.arg):u.error(e.message)},t.prototype.createToolbar=function(){this.toolbar&&this.toolbar.remove(),this.assetsLoaded&&(this.toolbar=new J(this,this.settings.toolbar))},t.prototype.notifyAssetsLoaded=function(){this.removed||(this.assetsLoaded=!0,this.createToolbar(),this.updateSize(!0),this.events.notifySceneChanges({assets:!0,style:!0}))},t}();s.Impl=Wt;var jt;!function(t){t[t.FacetChart=1]="FacetChart",t[t.GeoChart=2]="GeoChart",t[t.NetChart=4]="NetChart",t[t.PieChart=8]="PieChart",t[t.TimeChart=16]="TimeChart"}(jt||(jt={}));var Yt=!1,qt={},Zt=function(){function e(){}return e.checkChartType=function(t,e){var i=e.lastIndexOf("-",e.indexOf(":"));if(i===-1||i===e.indexOf("-"))return!0;var n,s=0;for(i++;(n=e.charCodeAt(i))>47&&n<58;)s=10*s+n-48,i++;var r=jt[t];return r>0&&(s&r)===r},e.execute=function(e,i){var n=this,r=window.ZoomChartsLicense,a=window.ZoomChartsLicenseKey,o=e.api.typeName,l=r+u.SeparatorChar+o,h=qt[l];if(h)return void(h.result?this.handleServerResponse([e],h.result):h.charts.push(e));qt[l]=h={charts:[e],result:null};var c="ZoomCharts "+t.PackageInfo.Version;r&&a?Vt.verifySignature(r,a)?Yt||(u.log(c+" license verified: "+r),Yt=!0):u.error(c+(" license key for license '"+r+"' is invalid. Please configure the correct key in order to use the charts.")):(u.error(c+" license key was not found on the page. Please make sure ZoomChartsLicense and ZoomChartsLicenseKey variables are correctly set before initializing the chart."),
  37. r=a="---:");var d=". Please upgrade your license on https://zoomcharts.com",p=r.charAt(2);if(!this.checkChartType(o,r)&&(u.error("ZoomCharts license used on this page does not allow use of "+o+d),p="-",i))return void this.displayBanner(e,"builtin://logo-development");var f=/(\d\d\d\d-\d\d-\d\d)$/,g="builtin://logo-supported-by",m=g;switch(p){case"F":case"O":var v=r.match(f),y=t.PackageInfo.Built;return void(v&&v[1]<y?(h.result={status:2,bannerImage:g,consoleMessages:[{level:"error",text:"ZoomCharts license is not valid for this library version which was released on "+y+d}]},this.handleServerResponse(h.charts,h.result)):(h.result={status:1},h.charts=[]));case"B":var S=r.match(f),b="https://zoomcharts.com/en/renew-licence/";return void(S&&S[1]<(new Date).toISOString()?(h.result={status:2,bannerImage:"builtin://logo-license-expired",consoleMessages:[{level:"error",text:"ZoomCharts license has expired on "+S[1]+". Please renew the license at "+b}],bannerTarget:b},this.handleServerResponse(h.charts,h.result)):(h.result={status:1},h.charts=[]));case"-":case"S":g="builtin://logo-development";break;case"X":break;default:case"P":g=null}var C=JSON.stringify({protocol:1,version:t.PackageInfo.Version,revision:t.PackageInfo.Revision,libraryName:t.PackageInfo.LibraryName,assetsDomain:this.parseUriDomain(e.assetsLoader.getAssetUrl("assets://")),pageDomain:location.hostname,chartType:o,license:r.substring(0,r.indexOf(":")),licenseKeyHash:Vt.hash(a)},null," ");s.Helpers.doPostRequest(e.assetsLoader.getAssetUrl("https://api.zoomcharts-cloud.com/lc/v1/"),3e4,C,function(t){try{var i=JSON.parse(t);if(1!==i.protocol)throw"Server response contains invalid protocol.";var s=qt[l];s.result=i,n.handleServerResponse(s.charts,s.result)}catch(t){n.handleServerError(e,"Unable to parse licensing server response: "+t),g&&n.displayBanner(e,g),delete qt[l]}},function(t){t=t||"",delete qt[l],n.handleServerError(e,"Unable to contact licensing server: "+t),(2153644038===t.result||t instanceof DOMException&&t.code===DOMException.SECURITY_ERR||"SecurityError"===t.name)&&(g=m),g&&n.displayBanner(e,g)})},e.displayBanner=function(t,e,i){if(!t.removed){var n=new D;i&&(n.url=i),n.imageScaling=.5,n.image=e,n.enabled=!0,n.enabledOnExport=!0,n.location="inside",t.events.addElement(new F(t,n)),t.events.notifySceneChanges({settings:!0,settingsChanges:{credits:{enabled:n.enabled}}})}},e.handleServerError=function(t,e){t.error(e)},e.handleServerResponse=function(t,e){if(null!==e){if(e.consoleMessages)for(var i=0;i<e.consoleMessages.length;i++){var n=e.consoleMessages[i];switch(n.level){case"error":u.error(n.text);break;case"warn":u.warn(n.text);break;default:case"info":u.log(n.text)}}for(var i=0;i<t.length;i++){var s=t[i];if(!s.removed)if(1===e.status);else if(2===e.status)this.displayBanner(s,e.bannerImage,e.bannerTarget);else{if(3!==e.status){u.warn("Licensing server returned unknown status code "+e.status);break}this.blockChart(s,'<a href="'+e.bannerTarget+'"><img src="'+e.bannerImage+'" title="Problem with the license"/></a>')}}t.length=0}},e.parseUriDomain=function(t){var e=document.createElement("a");return e.href=t,e.hostname||(e.href=e.href),e.hostname},e.blockChart=function(t,e){var i=t.settings.container;t.remove(),i.innerHTML="<strong>Unable to use ZoomCharts library because of a licensing issue:</strong><br/>"+e},e}();!function(t){t[t.inside=0]="inside",t[t.outside=1]="outside"}(s.InfoPopupPosition||(s.InfoPopupPosition={}));var Xt=s.InfoPopupPosition,Qt=function(){function t(t){this.chart=t,this.container=t.shell.interactiveContainer,this.events=t.events,this.popup=null,this.visible=!1,this.x0=null,this.x1=null,this.y=null,this.contentsChanged=!1}return t.prototype.hide=function(){return!(!this.visible||!this.popup)&&(this.visible=!1,this.popup.style.display="none",!0)},t.prototype.ensurePopup=function(){this.popup||(this.popup=u.createDom("div","DVSL-info-center",null,this.container),u.createDom("em",null,null,this.popup),this.popup.style.position="absolute",this.popup.style.display="none")},t.prototype.show=function(t,e,i,n,s){void 0===s&&(s=Xt.inside),this.ensurePopup();var r=this.popup;n?(n.indexOf("<")===-1&&n.indexOf(">")===-1&&(n="<b>"+n+"</b>"),this.visible=!0,r.style.display="block",n!==r.innerHTML&&(r.innerHTML=n,this.postProcessHtml(r),this.contentsChanged=!0),this.updateXY(t,e,i,s)):r.style.display="none"},t.prototype.postProcessHtml=function(t){if(t instanceof HTMLElement){var e=t.getAttribute("data-color");e&&(t.style.color=e,null!=t.getAttribute("data-selected")&&(t.style.borderColor=e))}for(var i=t.firstElementChild;i;)this.postProcessHtml(i),i=i.nextElementSibling},t.prototype.updateContents=function(t){null===t?this.hide():this.show(this.x0,this.x1,this.y,t,this.position)},t.prototype.updateXY=function(t,e,i,n){if(void 0===n&&(n=Xt.inside),this.visible&&(this.contentsChanged||this.x0!==t||this.x1!==e||this.y!==i||this.position!==n)){this.ensurePopup(),this.contentsChanged&&(this.contentsChanged=!1,this.popup.style.right=null,this.width=this.popup.offsetWidth,this.height=this.popup.offsetHeight),this.x0=t,this.x1=e,this.y=i,this.position=n;var s,r=12,a=10,o=this.width,l=this.height,h=null,u=this.popup.style,c=this.chart.scene;if(t>c.x0+c.width||e<c.x0)return void(u.top="-10000px");var d=this.chart.getRootChart().scene;switch(n){default:case Xt.inside:d.x0<=t-o-a?(h=t-o-a,s="DVSL-info-left"):d.x0+d.width>=e+o+a?(h=e+a,s="DVSL-info-right"):(h=(Math.max(t,d.x0)+Math.min(e,d.x0+d.width)-o)/2,s="DVSL-info-center"),i=Math.min(Math.max(d.y0+r,i-l/2),d.y0+d.height-l),i=Math.max(this.chart.shell.getChartInnerArea().findTopPosition(h,h+o),i);break;case Xt.outside:s="DVSL-info-center",h=Math.min(d.x0+d.width-o,Math.max(0,(t+e-o)/2));var p=this.chart.shell.container.offsetTop;i=p>l?d.y0-l:d.y0+d.height}var f=null;o>=d.chartWidth?(f=0,h=0):h+o>d.chartWidth-20&&(h+o>d.chartWidth?(f=0,h=null):(f=d.chartWidth-h-o,h=null)),u.right=null!==f?f+"px":null,u.left=null!==h?h+"px":null,u.top=i+"px",this.popupClass!==s&&(this.popupClass=s,this.popup.className=s)}},t}();s.InfoPopup=Qt;var Kt=function(){function t(t,e,i){void 0===i&&(i=!1),this._direction=1,this._endTime=0,this._midTime=0,this._startTime=0,this._preventOvershoot=!1,this._setTargetPending=!1,this._settableTargetValue=0,this._settableAcceleration=0,this._acceleration=t,this._initialValue=this._targetValue=e,this._preventOvershoot=i}return t.prototype.setTarget=function(t,e,i,n){if(null==e)return this._settableTargetValue=t,this._settableAcceleration=i,void(this._setTargetPending=!0);this._settableAcceleration=null,this._setTargetPending=!1,null!=i&&this.setAcceleration(i,e);var s=this._getDeltaT(e),r=this._getDistanceToV0(s),a=this._composeValue(e,r),o=Math.abs(t-a),l=t>a?1:-1;if(e<this._startTime&&(this._direction*=-1),this._targetValue=t,e<this._endTime)if(r>o||this._direction!==l)if(this._preventOvershoot)if(this._direction===l){var h=this._getCurrentVelocity(s);this._acceleration=h*h/(2*o),this._startTime=e-h/this._acceleration,this._initialValue=a-o*this._direction}else this._startTime=e,this._initialValue=a;else this._startTime=e+s,this._initialValue=a+r*this._direction;else(e>=this._midTime||e<=this._startTime)&&(this._startTime=e-s,this._initialValue=a-r*this._direction);else this._startTime=e,this._initialValue=a;this._direction=this._targetValue>this._initialValue?1:-1;var u=Math.abs(this._targetValue-this._initialValue),c=Math.sqrt(u/this._acceleration);this._midTime=this._startTime+c,this._endTime=this._startTime+2*c,null!=n&&this._endTime-this._startTime>n&&(this._endTime=this._startTime+n,this._midTime=(this._startTime+this._endTime)/2,c=this._endTime-this._midTime,this._acceleration=u/(c*c))},t.prototype.getValue=function(t){return this._setTargetPending&&this.setTarget(this._settableTargetValue,t,this._settableAcceleration),this.finished(t)?this._targetValue:this._composeValue(t,this._getDistanceToV0(this._getDeltaT(t)))},t.prototype.getTargetValue=function(){return this._targetValue},t.prototype.finished=function(t){return!this._setTargetPending&&t>=this._endTime},t.prototype.jump=function(t,e,i){if(this._initialValue=this._targetValue=t,this._startTime=this._midTime=this._endTime=0,null!=e&&null!=i&&0!==e){var n=e>0?1:-1,s=Math.abs(e/this._acceleration);this._direction=n,this._midTime=i,this._endTime=i+s,this._targetValue=t+this._getDistanceToV0(s)*n}return this._targetValue},t.prototype.setAcceleration=function(t,e){if(t!==this._acceleration){var i=e<this._endTime;if(i){var n=this._getDeltaT(e),s=this._getCurrentVelocity(n),r=this._composeValue(e,this._getDistanceToV0(n));e<this._startTime&&(s=-s),this._acceleration=t,this.jump(r,s*this._direction,e)}else this._acceleration=t}},t.prototype._composeValue=function(t,e){return t<this._startTime?this._initialValue+e*this._direction:t<this._midTime?this._initialValue+e*this._direction:t<this._endTime?this._targetValue-e*this._direction:this._targetValue},t.prototype._getDistanceToV0=function(t){return this._acceleration*t*t/2},t.prototype._getDeltaT=function(t){return t<this._startTime?this._startTime-t:t<this._midTime?t-this._startTime:t<this._endTime?this._endTime-t:0},t.prototype._getCurrentVelocity=function(t){return t*this._acceleration},t}();s.Inertia=Kt;var Jt=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(s.ChartElement);s.Navigator=Jt;var $t=function(){function t(){}return t.prototype.customize=function(t){var e=this.constructor.themes;if(!e.hasOwnProperty(t))throw new Error("The chart does not contain a predefined theme named `"+t+"`.");return this.updateSettings(e[t])},t.prototype.saveState=function(){return this._impl.save()},t.prototype.restoreState=function(t,e){void 0===e&&(e=!1),null==e&&(e=!1),this._impl.restore(t,e)},t.prototype.fullscreen=function(t){return t===!0?this._impl.setFullscreen(!0):t===!1&&this._impl.setFullscreen(!1),this._impl.isFullscreen()},t.prototype.updateSettings=function(t){return t&&this._impl.updateSettings(t,"api"),this},t.prototype.replaceSettings=function(t){if(t){var e=i.Base.SettingsHelper;try{e.replacingSettings=!0,this._impl.updateSettings(t,"api")}finally{e.replacingSettings=!1}}return this},t.prototype.updateFilters=function(){this._impl.updateFilters(null)},t.prototype.updateStyle=function(){this._impl.updateStyle(null)},t.prototype.on=function(t,e){this._impl.on(t,e)},t.prototype.off=function(t,e){return this._impl.off(t,e)},t.prototype.updateSize=function(){return this._impl.updateSize(!0),this},t.prototype.reloadData=function(t){return void 0===t&&(t=null),this._impl.reloadData(t)},t.prototype.remove=function(){return this._impl.remove()},t.prototype.saveAsImage=function(t,e,i){return this._impl.deprecated("saveAsImage","exportAsString"),this.exportImageAsString(t,e,i)},t.prototype.exportGetDimensions=function(t){return this._impl.deprecated("exportGetDimensions","exportImageGetDimensions"),this.exportImageGetDimensions(t)},t.prototype.exportImageAsString=function(t,e,i){return this._impl.deprecated("exportImageAsString","exportAsString"),Rt.export(this._impl,t,e,i,function(){})},t.prototype.exportImageGetDimensions=function(t){return Rt.getDimensions(this._impl,t)},t.prototype.exportAsString=function(t,e,i,n){if(void 0===n&&(n=!1),!e)throw new Error("`callback` argument is mandatory.");Rt.export(this._impl,t,i,n,e)},t.prototype.export=function(t,e,i){void 0===i&&(i=!1),Rt.download(this._impl,t,e,i)},t.prototype.addSubchartContainer=function(t){this._impl.shell.interactiveContainer.appendChild(t)},t.prototype.suspendPaint=function(){this._impl.events.suspendPaint()},t.prototype.resumePaint=function(){this._impl.events.resumePaint()},t.prototype.paintNow=function(t){return void 0===t&&(t=!1),this._impl.events.paintNow(t),this},t.prototype.back=function(){return this._impl.back(),this},t.prototype.home=function(){return this._impl.goHome()},t.prototype.clearHistory=function(){return this._impl.clearHistory(),this},t.prototype.profiler=function(){return this._impl.shell.profiler},t.prototype.measureFps=function(t,e){this._impl.deprecated("measureFps"),this.profiler().measureFps(t,e)},t.themes={},t}();s.Api=$t;var te=function(){function t(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=t.length),null==n&&(n=t.length),null==i&&(i=0),this.n0=i;var s=[];s.length=n-i;var r=0;s[n-i-1]=(e[n-1]-e[n-2])/(t[n-1]-t[n-2]);var a,o=(e[i+1]-e[i])/(t[i+1]-t[i]);for(a=i+1;a<n-1;a++){var l=(e[a+1]-e[a])/(t[a+1]-t[a]),h=void 0;if(0===o)h=r=0;else{h=(o+l)/2;var u=(r*r+h*h)/(o*o);if(u>9){var c=3/Math.sqrt(u);r=c*r,h=c*h}}s[a-i-1]=r,r=h,o=l}s[a-i-1]=r,this.x=t,this.y=e,this.m=s}return t.prototype.interpolate=function(t,e){var i=this.x[t+1]-this.x[t],n=(e-this.x[t])/i,s=n*n,r=s*n,a=2*r-3*s+1,o=r-2*s+n,l=-2*r+3*s,h=r-s,u=a*this.y[t]+o*i*this.m[t-this.n0]+l*this.y[t+1]+h*i*this.m[t-this.n0+1];return u},t.prototype.interpolateArray=function(t,e,i,n,s){for(var r=this.x[t],a=this.y[t],o=this.m[t-this.n0],l=this.y[t+1],h=this.m[t-this.n0+1],u=this.x[t+1]-r,c=1/u,d=i;d<n;d++){var p=(e[d]-r)*c,f=p*p,g=f*p,m=2*g-3*f+1,v=g-2*f+p,y=-2*g+3*f,S=g-f,b=m*a+v*u*o+y*l+S*u*h;s.push(b)}},t.prototype.clear=function(){this.m.length=0},t}();s.MonotoneCurve=te,function(t){var e=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=this.chart.zoomOutPossible(),n=this.options;n.enabled!==i&&(n.enabled=i,this.updateSettings())},e}(t.Button);t.ToolbarItemNames.zoomOut=function(t,i){var n=t.settings.localization.toolbar;i.label=i.label||n.zoomoutButton,i.title=i.title||n.zoomoutTitle,i.cssClass=i.cssClass||"DVSL-bar-btn-zoomout";var s=i.onClick;return i.onClick=function(e,i){t.zoomOut(!0,"user"),s&&s(e,i)},new e(t,i)}}(o)}(d),function(t){t.LicenseBannerSupportedBy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA/CAMAAACSEXcNAAACc1BMVEVMaXEAmcwAmcwyMjIzMzMAmcwzMzMzMzMzMzMzMzMAmcwzMzMzMzMzMjIAmcwzMzMzMzMAmcwzMzMzMzMAmcxEREQZGRkzMzM3NzczMzMAmcwzMzMzMzMzMzP///8AmcwAms4AmcwAm9AAAAAzMzMAms0zMjIzMjIzMzMAmc0DmMsAmcwAmcwAms0zMzMAmcwzMzMyMjIjIyP///8AmcwAmcwCmcsAms0zMzMzMzM0NDQzMjIAmcwzMzMAmcwzMzMyMjEAmcwAmcwAmcwAmcwAmcwzMzMzMzMAmc0zMzMzMjL////MMzMAAAAFBQUDAwNVVVUAmcwzMzMzMzMAmcwzMjIAmcwzMzMAms0zMzMzMzMEBAREREQAAAAAmcwzMzMAmcwAmc0Ams3///8zMzMzMzMAms7MMzP////KysoAmcwzMzMzMzMAms0zMzMAms0zMzPMMzMAm88AAAAxMTEzMjIxMTH///////9aWlr///9iYmIAmcwAmcwzMzMAms0zMzMzMzMREREzMzP///81NTUfHx8FBQUAAAA5OTn///8MDAwAAAAAmcwhISEAAAD///8DAwMyLi23t7cAAAD///9dXV0zMzMzMzMzMzMzMzPOMjL///9VVVVtbW0QEBCIiIhRUVEdHR0AmcwzMzMzMzPVLiyOjo5QUFBubm6VlZWIiIh9fX0AAACfn5+zs7PTLy3WLizXLSrQMTD///8cHBxiYmIiIiLj4+Pc3Nxubm4AAACIiIgzMzPMMzMAmczMMzM2LivXLSrULiytra1AQEAhISFaWlpgYGAyMC8JCQkCAgIzMzMAmcwAAADMMzMAms0q0h8SAAAAyXRSTlMA51rQTWX71QT0MRwKFwIN4fkp+NGe5+S+QrxUATBZIVDMVCIQl9wG6M0D4hYOY/3svBEMxvYIQ/FoqGDWW/EjhBqPJ6+GVyHcbUBTCIjy8GnufDUSm6mANMGVVcYzSrnKesEv/gI44R5vHUSOX4m3UHiA73PKqjgqQBiycqJLa0ew5D0SJul4u9MG9Kor2URN3uFEZiSuOtgeoCdHvaXSiaahLrG2epC6jXlumZlieNRJre5B6JzHZFN2zDezCzBruLY5cZyQlizU6ioiAAAJa0lEQVR42u2Y6V8TSRqA3xDOxQiYrIiQgIZLIOEyBMJ9X7oRkBsQEVgukQUEV0VRQXHAE+/bGdXRHXXnnt2Zvc8PSe38SVtvdSfdnUhsh98PZJfnQzpVXU3XU/XWWxVgnQ+Pc2OEzOlhGSxcAYTshtVkN3nU36+0poFcriyAC1s2cyI/h9XEeqwvPf135BzIZfOWD1PkawsAfPTdIgsN9rHwao6QV/j93BUy1goArWNkbDe9kGtjc4TSTidyjHxPL3idc4hYvsfml8glAD2OzMryiMy1U5OP2Iiyjy3kcf9naEWsL/vbSDsVuEErzsEecvrRa93ZNt0MvLK+wXhkt14QXoS87P+UtB89+zHAOFmEFabvzUVCFvQgEjl7IP36fSsAuXE0fXL+Y3h4nlYcs1KRv/fNsNDSk89++Pdr0srdauNFjtHm1OLGaYBvz6fDSjNz77vnm61pIhHs1++JnqtouwjkMato30N+za+RbMLYA/OPpWsEmy/SSSQvYIVJ09O46sPFLhXBTmMFlvCKFQ4RLLzRUfqcTRDH9/Tz/2wl12GFmSWXcLGf/QfAvFikhcxwPdvcBle/xYr5GUHkB1IAjKupLiIX2wBenJ64DytNepu1Va9fIK8BPrW26+dQhFzTXyK0K4RW7Ca/gUes4gFwIhc36+lT5JK+fQHgG3rrmnOxt7LmcH3+F/RzpZl8YCXkYv8MwOJ5Yv3mLC72CULOTwKQtofE+uAo9D23EuuxI7zIy3mih8ljtOpfAEfo9eF9x2I/zZrTIfkaP1eaI9U63b10jK+vdNVHLh+gkTKp032FPXt8j9ZgZqvWVR+gFx3VhaPVOtr6QDXeYtd7k5cB0R24zNXB6Ruw6vAhv5ytOm03WfyfELlifZ4OHwIYKXyswE/hcnUfrLPOOv/f9DTW19drYe3jH2yz2UZgdUnaXlSys6thf2/CMkT8qIg3/CTyh4eHa+NguUQWKew8Gp+E1RCZpo+mBMEy8amxi9j5ySqIhNFHgzfA8ijiDUwm7lrTsTZFSu1I18mmgYGmk13MqHctimy3UxKjgCeqAotJKy1StWyRJFzmOwbAycA2WhEDlIzC4gvFhc61b4gsvhBpABeCbueXq+IEkWmAHlV5fqBrp6ID8/OxnQs90YHlPfR6BkX8QUQE/hXnA6NbpZTsBQcbkyIjCzNgP+22Aj0Ek0S7PeRPTaOHKvKS7cl5OTG9tM4rplNhovWKQz4il9na5vgAX3VK7JNxrT8nYsy2+KWofQOCJ8IjHF26nX1HGR+gVmfGWnJFgoHeBU/84gPivVNTU5X0UXVzKmWC5S7tkDIFH5gwqgA5ZJeSXMjPg9eUpsZkqqkowQk5CBK8cMGLH5pqyBMVc8zAETccYHPSncuJ+ApVqfnAUMXbBPxO8BZZ+zK5mpRsm5iANACoVTvL8WeAUuIiklfINEoV4sqcBJCQoLF7JCSKC5ZUm5gsFJESXM6JoK9gnOUiF+AuUiuuyAVKQ4gTE8tHKOKVaJcwCi7s59NxYo4mp0YYhJydWzsVLD9HYsCc4gas2WLZ56cWi6hDb8Vyo93szzpNWx22tAzVp8YzkyoAuM0PeWbs4VPTSqUyFp9TIs1BoGXTGrvPMnE4xWYrY2Mf6WCARVlDgrBthCgqFCH4xW3b6GBNzQOGjZCQFJWDpYqiDrbs9/qY+FyQy16Wm8aWbLmx2ciJxA55lwf5x6lyscB1Iq1xEFuh0jj2/zDVCwygRhZjHa5/t6xVjwEXzu6ovCdGQIJPMgaRASCGG+0Gr2JDhiFy+5TJ7rZrNGELL+fix1nYL5muRAPEYUeVKnCywSX9pmFpH7iQhXpVnIhvoFv6FbJfpZDYQEyvCXvfBDDKPEqEY0hxgxlc6MUmPsDD1EvAQSEu/Cb2Zt+b7vvICXCQjeMa7Zpusc0wL7Lp7RtiEEbgTXgreyv4vplxYpKPg5gMtz1SKuKDBzAhFWCoRUEBxojHDTEfw6gOXBiilU89i2wIpoWWCHCHz14xtM8sIR2Uc/jykaTjbcL+s4MWt8Nf6MuGPIpEx4snKGj25rT39BltIw6AZxHYxxJFmTCb0jS0zYCDSykFzxgUHkU0TITFsUeRoFBaDOecsk+F+nLJF6dJ2eNZxNvGCLWUqUACi6eaYoAEHE1NhoxTpGeRH6PgKmZ4mSK5sTYBGSIwbONJuSOOzcJERxa6kCwjsMwhskS6u7vD5YlgNCG+AQG+8kSg0rlfqseF1bnVTikCykk8WBnAIx01drkzUiZLpIzbG2sHZ2+Xb6prkSUCKuMfMh1HBkmkdLF4muITqTvmYmAMFCXbZYlgtBjliLANJ3RQSMqyRNAl3BLA5mQWGFF2iiISkK381ubOflPJcS+v4w1sOqY6373YD9NXNMoR0XbTLlcJO6JcEWQTOwYNAxJZIzqFSDsIu/7I2LVrF906BIo2dr1bBI8RT+SIjOC5xV++iJRUjEq22e0UHws7pWv9z7/k+QLnjUcTBbDz3SIYIpkquSJxwjJGkQjZIrlYzx0vKIeABw+Ool39V//h+SumAURR4pUBskRUuBZb5IaWkEQn3r6zn8GDtCAimUA/ej3ITq5J4lPT1FtEnuEdTYf5AmY0eSLQYqMUbHD0uqxqCRF/Je7l+cBhxARc6S6C55nuEUAioG5oFjjKb9HmdwBAwYa5cwePArUy3EXugob/nS5bhP9p5FdQFhYWPm4JtlUuIQJGbJdZb5yuOlHJDh/xae4iPUpsVOAdltuSBlU2dWpj2WBY2RB7RxgTcafDTeQL6KVJN+r9RGBaLf2FuJSI/1OblGxwE8G0zKOOpiJi7sASIl2uIl/ehUO4UXoS2eEuAoPBNoGlZwSiWRKVbNXuIhH1NoSd/G+K2z8N4kXcOSkV+fJztpRK4X1FQFUQ6zh93GqZ9XBoHHnq2KZD67UgEREwKrkW0eB/4lQK3/7WuD8gF34mpQkTsMksFvnt36A3j05IEggU06Z7wcFeWiqW3nTM3oa67NqCxsqRTXE4qJu0Wm20EPbiYuCJysaCWuMZR9lfS4kDCT11WQW1ueURbIwGs7B9XRwsQROeCPP45fCMajzbBWbuX0JrjON2SnIpG/+7n98FyBhFtxhYc5TakcTSJgyPhE9GK/j/rqw9jifzu3hn1w7Fj+xrTAKsRcwau4TEg7BGyTipEWmw9bJmVcylW3MUioquoigDrLPO+/JfZ6Pep8PFvkUAAAAASUVORK5CYII=",t.LicenseBannerDevelopment="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA/CAMAAACSEXcNAAACu1BMVEVMaXEzMzMCmMszMzMzMzMzMzMzMzNbW1tERET///8AAAAAmcwzMzMZGRkzMzMAAAAAmcwAmc0AmcwzMzMAmcwzMzP///8zMzMAmcwzMzMzMzMzMzMAAAAzMjIAmcw3NzczMzMvLy8Amcz///8Am88Amc0BmcwzMjIAmcwzMzP///////8AmcwzMzMAmcwzMzMzMzMzMzMAAAAyMjL///8zMzMAmcwAms4NDQ0zMzMAAABiYmKOjo4AmcwAmcwAms0zMzMAmc0fHx8zMzIAAAAzMzMAmcwzMzMzMjJSUlIzMzMzMjIAms7MMzMQEBAAAAD///////8CAgIAAAA4ODj///9dXV0AmcwAmcwAmcwBAQEAmc0AmcwzMzMAms4zMzMyMjL///+zs7MAAAAvLS0AmcwAmcwzMzMzMzMzMjIAmc0AmcwAms0zMzMzMzMAms0zMzMAAAAfHx8AmcwAms0zMzMAms0zMzMAms0zMzMzMzMzMzMzMzMzMzMzMzMzMzPMMzP///8zMzMICAgzMzMAms0Ams3MMzMKCgozMjJ+fn4yMjL///+UlJT///8DAwP///8FBQUzMzMAmcwzMzMAmcwzMjEzMzNHR0cZGRkAAAAlJSX////KysppaWkAmcwAmcwAmcwzMzNAQEAhISGrq6t+fn5RUVEzMzMzMzMAmcwzMzPS0tLOMjKhoaFLS0tubm5vb2+NjY1CQkImJibVLizXLSp0dHRERETd3d0dHR2RkZEgICBxcXF9fX3GxsYQEBBWVlaHh4czMzMAmczPMTHTLy3WLSvFxcXKysokJCQcHBxPT09oaGikpKQSEhLQMTDPMjGpqam4uLhLS0sYGBiLi4sODg6dnZ2UlJTh4eE1NTVWVlbj4+OFhYUsKScCAgIkISAvLy8DAwMzMzMAmcwAAADMMzMAms3Q4KV9AAAA3nRSTlMATQL01gTiQZ5ZIs0c5/szZVvR0DFCEij5ClQMiAa8vgGDFS9VDwfdIegeDOdh8CT4/u+8BhX9gvQREbKQxvaU8eXpXbvt65AZu2tAUQnjVVNNq2bSJK4dJoze4KswNKuZGHjN3xmlDnG4e9bKsCFCwUSPR016bDzB+aaAWokuAuE1V/JHObd4ecqbN0FaO/BH8UsrZJqdZ8jVmdsqb6FgsNvTnMZKZ5E0fnS1QSeFoo2mVcS3erAwslWhddhHgGjSqYgeLl7UPTM4behncmfB6vJsVVFqHIuBPF6Wf2TjcLnEAAAL9ElEQVR42u2X91uUxxbHBynKCqywYSEIhhVpS5W6u6wgXZSA9N67SFFEkBKvil4VIxYswRI1GqPRxFTTNTG5yU29vXHvb7tz82fcM2X3fd9d2KzyPFHu4/eXnXJm5nxm5j1nFv262j3a2Nj4Alr8cnYxGAx+6PFq9ZqqS+uG27fsX7IAECcAcUCPpJjx8fHBgAVjhKXlGLm8VoQ8DpAJGJq9cqEcKwBD0LovHwOINwx1WShIFSdITWW/0QOLEoRzDO+sr6io3zlMifYvRpA1RlBNPuLaUUOqq39tkE0E5NkFhatIcHx5hdBQsRwaTpFSSFvlyco2cxgLDjt5MiwYWajjQUxvYoAAMgH5JLE3xs3SKa1bTMyGAOvco3Xr3Q2/QwTEWdwTCLMIA5JXSXVJcGTJ6rCwthC0BdyO5BycJN1o9H2mfsuBmugkY1J0d9p+aPM8tTUyFdojD6wQsfjc6A939IjNDu0ZrHNmINNRI07ZsR6OLg1+gSaXHkSdVoQ77opdH9owJgLc4KDqcQp3DHeIj49XwNDY/nhQA71gdbmK7NhdMGA6kdoeMEqV1MbPwbPdKyc1NfrypXRo9UQSeZIPXjyovVZcvWyKBQHjjgaz1o4xEA+hKT6G2SWGGwQ5nWCNbhu71rOW7CiDWI5a6L2xy1wPH0KgSxYg0W0UoypS3NhtkQSXeBltyjefXZZ4iQMbCYhUob1s5zkvJz5D2wQ4R2uQQXHDGALV+pqVSuMRAfFMlzqWjCy0hYfjmm6v7hxhE7rXrdoaSUth5ML0sA3rbxjpcoo1GM6YQWJdnELZbvc7U6fB6lDDbG5jfDgl2QRtD2L5cYQe6plQKBShUN51RQHq70B1HnQbukYaDmUbDHvp3oeZVEFvWfsSIW34Rtak+5LCDkuQAWo6UBGyBL6k/G4a1tIG6GcfvIJsSBqUMulimVr6yfZO908zkNBch96VzgEbMq9AhTmhHZ3Q8ks2SK7MIcBzcwSikajXIE5YR63ThNCP9iQ6NDhYZO8kcongQz3FdrvWszI4JDhsTXuq0Spr1BvFH04FOZQtkuOqCUYBxGvFBmHQSovwqyUkXchCGwneJgbi4TZn+GXzdAqBDYm1P5V4Xw9xjHLUCs+QyvY+ZKH9xGSFuZoGtUvmWhuZqZ6u7DFknUf4t8yPLFtrGW6JzTgH8Zk7IXaQGzg5T7a4zH3rIweTtFPSGWKVI6UgK8gDTAgF3fQ2qsgdsZkQY8g1eg1ZKBcaX7cN8qwLVGYDkbV49DoFPtOA9DKyrTQpiCdJmQIISZhrUBcslmsTRBsuPqCVPkMTDhNDL4ySDbANAnOD+vey07QOQ8tDYHNZlLKt4EibIGQv8hFxeqNNkJXC/6yOqB4XDxZ8yTEpdtsGcYAKqY+MJSKR+H2KruS76QVANpVs/CWQn/NRK4nwdoJkhhoE2QGCxk2W2afFd7Mt3RSFTibZcbH6fO0CWbt2rZ99IKPcKw9HRw/7QFCnOV/u6hRWXmXkoR/thEJksG2OgWijvSey1y6QvSw3Dk74POj1mZy1CwQlTr+ebXoySG7KMNwnlkNq5z6GSp40qpKMdoGQ2zJtBwhLOC7eiCvKPhDQBr8RR/pQ4GY7jKCcMFpexVObtbak1t5cs+Ymex22r7MJQqPWIVhi1B6QurXg8iZz6xm7QUA+9Bk0zvJdjugVslXiIHreLEgdgqqWDP8iCH1G9NgBQkNQqLP9IFLFk1tJk906ccDdKv3Wv/oN1/so34zhlY+QHSdC83aivSABkjeKItAaZJ5/iJmk3ZzbDiAu8nC8KVj99r9c70MYoIq85BmC7ALZsJ6kX3uvlhBEG+bO7EPkIS2ASA7wCvy+TP8JrRan7PY5QN4jPV4DfSdJRLMPBM0aQCrT2h1jm+YBcb5CcnmM6Vv3IHHIGiQGnvU8nAeiyVxTTy+Z8jQU0uk2r1vORao1IdYgt5EX/59uNwj/a+Sk2uvt7dc54gLezRN+p2lma5ye2HSikz4+wrXWILsV0LFe5eCdOauFB2ls/OiYt/feXLoGiXg5RmvtsAJ5H+2HoJv/cCBoItYg1pn5QJxfN0iViaQgPCxzxRIQsUbQPCDDliB/uI0OCInSbhDkLX55zH8iSNsjtovtRHOBBDbyfnj5D4ntu2gsizTOoZ1SkD9+TV2tQg8LghJVJhQPp9kYG49Gh6713NDldB2SgAiaVjCLDuR8oseU1p06WeQ++YxU9SQApw6IQX73NaqPhpS5GgmqBFOhHgy1Smmn6fSenYwaVI12+vkEkE31qaur6xCuPalqecXtROeoanB6yFR3fgE6A5BEuyc3qm6M9QbSPZrYeAPsJ7mJtep9yUOYfybvAcZ7z6O+HPqmXFxiCSOpiu737a9uQ8pMJmxpaLGJ/9tIT64PJhf+y+QaUq0NQYtPN5N4Ft86vDX9Z1pMA45FqD4vo0TpL6NFqpCdIpSa5NVo8SqkL3lVd3rk5eGqHcHoqZ7qqZ7qyVMxRo8if9Owwjjs/zg99sdyVvggAz2KlvHZ5LhUf03Sw5tBcVkyNK9kLRhn6YT6wTioc/sSfBDNr+ew1JGlrLCnaEEgKvyjOsK6eylOuXDhsDsuQfOpBesP42JRNU8P9oW0clXz0kODgBYE8gqbxxpkWUREWdFZfu7W0uEUddlZd+GC6Peoy4pasY4cFm7G8ocE4TfOPw7H0Zu+rRrHzcBvdXEJNG2jLfTIuVEh8SELWjhINQYJRv54m78/B0GgP+PtzL5FBu6RHjk/pAR8Fenc30FcBa1qBPoTvVPbS5WlHyEu7hsMLCyGeXQUJK4agXALB+F8BOZiczlZZxsubb6IsxBy31egP6zBMiSHlsP7yLgZXN78DnEjC6foP8AM5MMU/MYFVEiNpnQw6/dBQSKQiAy4I3H79G+4Y11EaQFxEn+DqFLwTNy5W4gLMyQlfpdQ3UEf7xM+7XLwrRhmnPpAn4JbqMflWE6cvWgBIscp55VBeRg2OOOI8vxb4L/7d0Xqsn/gb2HhH5VlencZMQpSHm29TwvqPWBNlLAMfxqBCmBYWTP+O4IaQiIQ5O4Op9SsbroHW32HrF5QmsAsrmlw3rEEM8ib/Pc5cFBThpq+YwfHlg1KwfKlOG+PGpzUEY9fxCqEGvHvLUBU+EUo3LoAp58nk8n+jTOJAwh9imfRq/gnuU5dFAFGP0CfwmT9JhauqAyXk92E3YeaFchLmrsy2V3Y6jLNdjD9mDs4pdHs0yFZsZwBLBNAfiotLCx85yqt89XA8aXASpadBI/JWnRPpCD8g02IgOWZvqcg1JumN87RGw5GTNx6mQBC7LjT1iDnkDumAg/zXkIHNU3MoFrzr2a4J5l8AI43g+gwk0wIJjDdKzAjW45+DBexTo7vIAuQ66byXZziSqQWQFDTsf80u2M5GDXTPhhpCXKXg5yzApHhz9G5DDruKNlX2dU81g+HmKBsxsXvapS0nvEJv0jX0UFmn7GdtlznINelINfwX1X4G0uQt7GK5eqIjALWKIBkVaME5Rc4E4zYzOhVat0ggPBhcnDaEqQYLsbn5lCqzNgOdaq/4Xio6zG+yOrlLIPch2tfUM5aqCt82e34bSlIROm7V88mMAf+IgPp6I07iw/K/TFs1hc4S75tpkUE8hlpKcD/JEb+ssIWf9TUiv0LZ7AAwoaVTGluSUBkspJqfFiJbmmmSuQH4whN+fEMJetPyMMz8sL7GP/A6kGteKYQ7PUJcvwq3y8S/Omy4NtZpRQE3XHHn3EHqKpp89G84/j4W3sQUkOcxAWfiUDUemg5dyECjFKO4ynFNQi5pRh/clgA4cNK7yWIQUBTpRfKwOd7YH+8nBBcgwPg2vPWPphXX2o6rmO0ju/rPuJfUZOGpBK27PGUo8gCpAxr1GwLXKmK0FFXMu1m183n6fAiaAOLoiKyG65B4CS0HIugQ8DoCJQSjkBLmSvi8yj5MOjiNToURKxBEUegGERLrrAI1/nNMIv6CB/A63rccmszb9gMG2taNog6w5ZjHiNNHnqCpdZ/nGCfZQncwCeapMkuM1nJVCtYLn59i1s/RP8PKnPlr5v/ATeU1EkHfFh/AAAAAElFTkSuQmCC",t.LicenseExpired="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABaCAMAAADKKOnkAAAB7FBMVEVMaXEzMzMzMzMzMzMzMzMzMzMAAAAAAAAAAAAzMzMzMzMCmMsAmcwzMzMAmcwAmc0AmcwAmcwzMzMzMzMzMzMAAAAzMzMAmcwzMzMAAAABmcwAmcwAmc0AmcwAmcwzMzMAm88zMjIzMzMAmcwzMzMzMzMAmcwAmcwAmcwzMjIzMzMAAAAzMzMAmcwAms4AAAAAAAAAms0AAAAyMjIAAAAAmcwAmc0zMzMzMzMAmc0zMjIAmcwzMzMzMjIzMzMAAAAAms7MMzMAAAAAmcwvLy8zMzMzMzMAmcwzMzMAms4zMzMzMzMAmcwzMzMzMjIAmcwAmcwzMzIAmc0zMzMzMzMAms0zMzMAAAAAmcwAms0zMzMAms0zMzMAmcwzMzMzMzMzMzMAms3MMzMzMjIAAAAzMzMzMzMzMzMzMzMAms0AmcwAms3MMzMAms0zMzMzMzM1NTUAAAAyMjIzMzMAmcwAmcwzMjEzMzMAmcwAmcwzMzMzMzMAmcwzMzMzMzMzMzPOMjIyMjIAmcwvLS3VLizXLSozMzPPMTHTLy3WLSsAAAAAAADPMjHQMTAAAAAAAADMMzMzMzMAmcz///8AAADy1tblp6fTXV3rv7/hmpr56+v89fXafX3QSUnvy8vXbm7os7P14ODejIwAms2gRU9CAAAAkHRSTlMATQz04gS7kHfW+wLNKGVbMdEcQlSZ0LwRZgf5D/Yh6FXdAuftMMbwFQb4ERX9giJElMy87h3gZCTlGetrQP7dUQmqJoMKR4whNAFhGXG41qVde6uwQsGIR016bDyr+aZaweHKM1eQgPHKsLd4OQ6JllU3SyuanWdg29M0dH4etSeZLt96sC5e1D0SYPLqGwwy0eDzAAAKN0lEQVR42u2Yh18bORbHBQYOTIClGWNMNdX03gMbCL23pZejBThqCCmbupfs3u5eWXewKSH7j56epLFmPGBPIIQPWf8+n2BJ8zTSV3p6TxP0dRUcZDKZ4tDtKjetfT17YWBoM/waIGEYJABdSTXb29uTedfGSCmtNzNFR+puA6QNd80MvC5HJMbgyv7pFkBicdeg64K0M4LkZPqbM373QDjHwlRnZWXn1AIh2ryLIGkw9apmoTpRBdXcrw3SCCAPrxWuDHji9yp5Q+U93PAESrqelv2WHncY06fs76fokYe2Xtd0FORxkDaEMgo6amI8J6WNqampk4elDG1MRwb+nQaQYCRSF34L71CUINU6n0h4bkpKjw4N4WkbgIOT1JrNSd91Dm1U5RSaC3P6SzdxW9STNUMybjdsRIpYIl6NparUxsz0kcmsYApS3T0XlmlUq4KG47qEKb3uPtCkqmaNj9KH50WAdQGtI2GpqtSA8vJyDe5qHCvHGiYOlrWiyTTO4g7VBQi0YZaqsIftQ9RAdH1ycs7z9VrcGoUkioIDL+40MCOuPhdiQd62yuTW/XkKouZN5TXUriDVxBX2mDbGNPQ9oi2Z3SaxVFr89NWsu546DebrHiA5PQSj3SBu7PdIguHRZq9KaqbOUm4SqwFApErvoCsPvJz4KWnjcCo5yKS4YR7sZ5LcSibxCECias0SFSEPDbFwXNUf3V/PF6E/O2HNQEop4DAjdMHGhuf6wowm01M3iDEoLJ2u9lgwmTS2WhzeWXlXnkpIGnHbayPbjvTFkTaNRpOOy7MvNFhjWyhLTZahb254MdNkWiZrnyKoknjZQDhPG0mGqtokKEx4gowT0/FKXTg+Sc39JKyVjpNjr4+EBSnFpUEy2KCWHNmO6rFqCpK+EtARGJxXN/gCV+gktKttWuZkk+AyixgvRoWJ5rp/hDghi1oHQBiXR3oEDAd4ZO9CcCI9Qk/oas9Eteh1+pS0gWSzLGt0msUHpxI2ZUiyXVV6lAez1tTxToEe4VcLJH3IQw2A10hB1DGy8MujXy8PbEiszWSYfSeOY4Rjhl9DWgZGkYc2wSTSXS3FtXV3rQfe1ElGVk/L8wg7y2zLMrWe4RZsthlIxMUJcQs8cO+SbPGczW0UNqZwComlk+VIKUgkXMB4KOgn3tgKPuI1IdaAG/2IPLSCG994B3kInwM7XUguiF40y+lIQHqGvKtUChIFKZODQMJMQ314sBWvINpU8QYFRky3BbRN/7wKC+AdBPWRQLFMd1Mehu7pYHFJlPIuvcErCKxFM4JJN3gFCeTfWVvdI0FqGnxhmzQZ3kECcAXqc/MFSCTmTzktbDWjdT5Aisy+QP5sRv+ECK8QZDDdxKUABG0LlpkHYt/sqRWi0H6hAscaTVIEcv/+/ThlIKsmKrVKpVYGgnrd+XK2l4+cYGahH03BxUrvnWM8x6x0R5YVgSzT3DjZFvG6I2JvRxEIKqh+kylcGSSesgD+RHLIzMXb0MKSRnuhWREIeEu1AhCacIJiEVO3IhBQXdycCkCMzGwCZlWfQsoJLLXJNZQ88zIt7SW9HQ5keweBqLWIh1hVApJ1H0+5EQl6qhQEFEGuQds039WLbiFrfIKg793CqYOrPXzBNwhcI0aUgEAISg++CgioHLySJLtsccBdk571X/7O9AE1uzGimxHyvSM0bxcoBcmT3FE0XXKQS74QB6Hdnds2EBNcHF9yq3/8wfQBwgDIsB6lQ4pA6h5B+lXqWjyIDl+c2afhIs1BJBv4Av8+I19CueKUPXAByHt4Ej0+ug8RTRkI2jFhtQpjb803XgIS/AJyeY1w1tUQh+QgNfhaz8J5F9pbEZ50wCsPcKGWLHP2PSaoVunkIG9RNPtOVwzCPo3CWpdjY+N654JMDZeF32qS2d5VtzU+7u2DcqpWDpIB37qPWgNiB3e0+EJqLF+dj41dXiFjQMSrN8s1IQP5gDZx0G3+PBDUZjSJ9fQykOA3JqkGkQwEwjKTEUDEmkOXgCx4gvznLdrgiVIxCIoV3zwu3xGkHRHbGXvRRSBd74RbiRYODFcfiWUG8wWakoL8+1cy1Xb0uSCooFVAUYft1Hi5NAbAfzQQBR1kIQkIV7WGWmyh4McjQloP66WRe/87qTohACePi0H+9SvqzMEpMxdxtWBTXtfjWov0obB7D/e6J1tXe+Mi8mBRI7Kysra420NVyyoxj3tXWyerp4V68M/4YR6SKGOvofXVfEcXWaO2hlfYfo+ZyNWZBBdhdkzeY4z336PRenKnvFuiCaOwnaz321/eIqQrArbSu0XBvzZqizr14PA/FVVBdUaH7p5eFrIsvrawVvsnKZbq0F3UqMf/JNY+Q3dUuikRSlVRLrq70o0WJfTXGp4vtE/okV9+/XX1xzciP4gfxA/yFwOxWWzuNofFckRLJx8tFovtSDBhgordYvkk6XeCWyxOO61AmehYNBRrIh2OLJZDOtL5Cbc/ZeaHFqdoRBe8VDYBG+uhCMThpB0PLwRxivududgslYHAyxwwY2LB7Y8uAKGwchDWwzcINLrwOKdsNG7ChrbzRmb0EXrSp/LNpx34GIf0D7d3nFtcJ1IQG31ol8yRVxwY59g3yBl9w4nF8vEiEDwqb3TSX5flUBkIMDts5BXc/hNMSwrCXyoHgbm5LKc+QcCRz8gw9k8XgZzC+/mOwOaBlIHAFM6h5XogMK5vEDv4sbgrlUN4BpziM+K0n3EQ5sDyM+Jk1SNaVuRax9IJ8Gdwyq4Ngv/ZeD/HITnIDmUgIHbKfB52aP3CIDap85w4LUfiRjs+8S6Hb9fik3eeSEBssvBLdSqbgBjk2mcEDJznuJHrGOKCMhCHy2Kj1nJ7DsJyjt3bGbl21GJLZnObYjmVRi1YSvDGM18gWLBY14paMM9Pl+cRugPu8OvERnbFO3LM8ojNJwj7UZ5HqOzKMzsdkr382MWO8omyzO6EAAXdj5SAnCvO7HIQfoE6v+SuJXi6yNRlBw4FIJCtaXfXmS8QyJ1nl961/Nd4P4gfxA9yR0H88ssvv66kEGuIH8QPcvMgoVarNVQoV1itISWsuWnX+gAXEq3WkhCrNR6JhbvEY9PikiZrRYnoRfH5ks7QvQm3Ft84CFRAdNAHVqIlOhesHwgIVagEhKqM/KXTpOWmfN6ZlFjrjYMkwgxD6eTzYfAlPoNEagEN+U3WMilIWT4qA5NdgsjsS+jO8c7FsEZLYHKzILAJFfiveKQmeErm4kbFzoMdycO1iAleaQYeAqTsdbwzLBE8e3DjIGVix1mKh+LngBRDMZ7yx9Neks4/WKlCvipIcYX1C4Dk3wII9wXEPbvpaiBlXlwLdPOHHVx8KdQ96u6VdkR+2JFw2EPyUX7oTUUtqlAeckkILSGliquAyMMv32VQ4k2DsCRYlkjG362wVuzGWyvyrwICVUh9UhC0iwEr8I749e3rf9Zb0e+///aFQX772y3pv+hb0f8Bf+WgGjFCqjoAAAAASUVORK5CYII=",t.ErrorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQIHWP4zwAAAgEBAMVfG14AAAAASUVORK5CYII=",t.PiechartBack="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAA1CAMAAADmtEJjAAAAYFBMVEVMaXEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIAgUIAAAAH3RSTlMACbeu3XUBgH/vy+gqMRghOfqXYUpWwkDGihCfgmebkGEUkgAAAQVJREFUeNqV0ttugzAURNEx2BADBMItTXqZ///Lyi0qrXOkZvajtcbyg2F1gtSJIqfIKXKKnCKnyClyipwip8gpcmo8FaNvitewdtV/PB8WYRD4V83sBJ5q50rgqW2QOBlHiZOXUeJkewZQ8/kKiIOrOCigDS5ncbBCG9ygDUqYgxhpt8EcALh3Syjb3L/AHAB7/a3N7jcHOHIhZu83BvjduTj8BHOAP1XTjw8wB8gG5fGBzAGynN//g4M5QN7y7Rs8VJu+8ky9wR7gocBUD2tg+TFxD7Pa8C75GnbWeSQ54Pk8WULzV8VHNgp35Kr4nk2l+JkLlD42SPle4t0Eqfe75jvsfQLbYGzTrP2yIAAAAABJRU5ErkJggg=="}(c),function(t){var e=function(){function t(){this._dict=new Object(null),this._count=0}return t.prototype.add=function(t){var e=this._dict[t.id];e?e.push(t):this._dict[t.id]=[t],this._count++},t.prototype.remove=function(t){var e=this._dict[t.id];e&&d.Helpers.removeFromArrayHasty(e,t),this._count--},t.prototype.contains=function(t){var e=this._dict[t.id];return e&&e.indexOf(t)>=0},t.prototype.clone=function(){var e=new t;for(var i in this._dict)e._dict[i]=this._dict[i].slice();return e._count=this._count,e},t.prototype.count=function(){return this._count},t}(),i=function(t){function i(){t.apply(this,arguments),this.centerX=0,this.centerY=0,this.zoom=1,this.hoverNode=null,this.hoverLink=null,this.hoverItem=null,this.lastClickedNode=null,this.selection=[],this.selectionSet=new e,this.notifyChanges=!0,this.lastNotifiedSelectionSet=new e,this.autoZoomMode=!1,this.layoutActive=!1}return n(i,t),i.prototype.xyInChart=function(t,e){return t>=this.x0&&t<this.x0+this.width&&e>=this.y0&&e<this.y0+this.height},i.prototype.toDisplay=function(t,e){return{x:(t-this.centerX)*this.zoom+this.x0+.5*this.width,y:(e-this.centerY)*this.zoom+this.y0+.5*this.height}},i.prototype.fromDisplay=function(t,e){return{x:(t-this.x0-.5*this.width)/this.zoom+this.centerX,y:(e-this.y0-.5*this.height)/this.zoom+this.centerY}},i.prototype.toDisplayTransform=function(){return{xm:this.zoom,xa:this.x0+.5*this.width-this.centerX*this.zoom,ym:this.zoom,ya:this.y0+.5*this.height-this.centerY*this.zoom}},i.prototype.objectRemoved=function(t){d.Helpers.removeFromArray(this.selection,t)&&(t.selected=!1),this.hoverNode!==t&&this.hoverLink!==t||this.setActiveObject(null,null)},i.prototype.addToSelection=function(t){return!this.selectionSet.contains(t)&&(this.selectionSet.add(t),this.selection.push(t),t.layer.touchNodeOrLink(t),t.selected=!0,!0)},i.prototype.removeFromSelection=function(t){return!!this.selectionSet.contains(t)&&(this.selectionSet.remove(t),d.Helpers.removeFromArray(this.selection,t),t.selected=!1,t.layer.touchNodeOrLink(t),!0)},i.prototype.setSelection=function(t){for(var i=this.selectionSet,n=this.selection,s=new e,r=[],a=!1,o=0;o<t.length;o++){var l=t[o];s.contains(l)||(s.add(l),r.push(l)),i.contains(l)||(i.add(l),l.selected=!0,a=!0,l.layer.touchNodeOrLink(l))}for(var o=0;o<n.length;o++){var l=n[o];s.contains(l)||(l.selected=!1,l.layer.touchNodeOrLink(l),a=!0)}return this.selectionSet=s,this.selection=r,a},i.prototype.setActiveObject=function(t,e){if(this.hoverNode){this.hoverNode.layer.touchNode(this.hoverNode);for(var i=0;i<this.hoverNode.links.length;i++){var n=this.hoverNode.links[i];n.layer.touchLink(n)}this.hoverNode.hovered=!1,this.hoverNode.locks--}if(this.hoverLink&&(this.hoverLink.layer.touchLink(this.hoverLink),this.hoverLink.from.layer.touchNode(this.hoverLink.from),this.hoverLink.to.layer.touchNode(this.hoverLink.to),this.hoverLink.hovered=!1),this.hoverNode=null,this.hoverLink=null,this.hoverItem=e,t instanceof h){this.hoverNode=t,t.hovered=!0,t.locks++,this.hoverNode.layer.touchNode(this.hoverNode);for(var i=0;i<this.hoverNode.links.length;i++){
  38. var n=this.hoverNode.links[i];n.layer.touchLink(n)}}else if(t instanceof u)this.hoverLink=t,t.hovered=!0,this.hoverLink.layer.touchLink(this.hoverLink),this.hoverLink.from.layer.touchNode(this.hoverLink.from),this.hoverLink.to.layer.touchNode(this.hoverLink.to);else if(null!==t)throw"scene.setActiveObject invalid active object type "+t},i.prototype.getVisibleBounds=function(){var t=this.fromDisplay(this.x0,this.y0),e=t.x,i=t.y;t=this.fromDisplay(this.x0+this.width,this.y0+this.height);var n=t.x,s=t.y;return new d.Rect(e,i,n,s)},i.prototype.disableSelectionChangeNotification=function(){this.notifyChanges=!1},i.prototype.enableSelectionChangeNotification=function(){this.notifyChanges=!0},i.prototype.notifySelectionChangesIfNeeded=function(t,e){if(this.notifyChanges){for(var i=!1,n=0;n<this.selection.length;n++)if(!this.lastNotifiedSelectionSet.contains(this.selection[n])){i=!0;break}(i||this.selection.length!==this.lastNotifiedSelectionSet.count())&&(t.events.notifySceneChanges({selection:!0}),t.notifySelectionChanged(t.createEventArguments(null,e)),this.lastNotifiedSelectionSet=this.selectionSet.clone())}},i}(d.Scene);t.Scene=i;var s=2*Math.PI,r=function(){function t(t,e){this.node=t,this.nodesLayer=e}return t.prototype.postProcess=function(t,e,i){var n=this.node;n.targetHWidth=n.targetHHeight,n.bounds=new d.Rect(-n.targetHHeight,-n.targetHHeight,n.targetHHeight,n.targetHHeight),this.sizeScale=n.targetHHeight/t.nodeLabelScaleBase,this.postProcessLabel(e,i)},t.prototype.postProcessLabel=function(t,e){var i,n,s,r=this.node;if(null!=r.label&&this.nodesLayer.chart.assetsLoaded){var a=r.label.toString();if(0===a.length)this.currentLabel=null;else{var o=this.currentLabel;null==o?o=this.currentLabel=new d.Label(r.labelStyle,!0):o.style=r.labelStyle,o.text=a,e.measure(t,o),s=o.style.scaleWithSize?this.sizeScale:(o.style.scaleWithZoom,1),i=0,n=r.targetHHeight+o.hheight*s*.8,r.outerBounds.addBounds(i-o.hwidth*s,n-o.hheight*s,i+o.hwidth*s,n+o.hheight*s)}}},t.prototype.getAnchor=function(){return{x:0,y:0}},t.prototype.adaptToViewport=function(t,e,i,n,s){var r=this.node;this.x=r.x*t+e,this.y=r.y*i+n,this.hWidth=r.hHeight*s,this.hHeight=r.hWidth*s,this.zoom=s},t.prototype.isInViewport=function(t,e,i,n,s){var r=this.node.outerBounds;return this.x+r.x0*s<e&&this.x+r.x1*s>t&&this.y+r.y0*s<n&&this.y+r.y1*s>i},t.prototype.paintSelection=function(t,e,i){var n=this.hWidth*(1+e)+i;t.moveTo(this.x,this.y),t.arc(this.x,this.y,n,0,2*Math.PI),t.closePath()},t.prototype.paint=function(t,e,i){this.paintBasicShape(t),i&&(this.image=this.nodesLayer.getNodeImage(this.node),this.paintDetails(t,e))},t.prototype.paintBasicShape=function(t){var e=d.Graphics.beginStrokeAndFill(t,this.node);if(this.hWidth!==this.hHeight){var i=this.x+this.hHeight-this.hWidth;e.moveTo(i,this.y-this.hWidth),e.arc(i,this.y,this.hWidth,-Math.PI/2,Math.PI/2,!1),i=this.x-this.hHeight+this.hWidth,e.lineTo(i,this.y+this.hWidth),e.arc(i,this.y,this.hWidth,.5*Math.PI,1.5*Math.PI,!1),e.closePath()}else e.moveTo(this.x+this.hWidth,this.y),e.arc(this.x,this.y,this.hWidth,0,s,!1);d.Graphics.endStrokeAndFill(t,e,this.node)},t.prototype.paintDetails=function(t,e){this.image&&this.basicPaintImage(t),this.paintLabel(t,e)},t.prototype.basicPaintImage=function(t,e){if(void 0===e&&(e=1),this.image){var i,n,s=0,r=0;if(this.node.imageSlicing){var a=this.node.imageSlicing;s=a[0],r=a[1],i=a[2],n=a[3]}else i=this.image.width,n=this.image.height;d.Graphics.drawImageInSquare(t,this.image,s,r,i,n,this.x-this.hHeight+this.hWidth,this.y,this.hWidth*e)}},t.prototype.paintLabel=function(t,e){var i=this.nodesLayer.style.nodeLabelScaleBase;if(this.node.hovered&&(i=d.Helpers.toleranceMin(i,this.hWidth,.9)),this.currentLabel){var n=this.hWidth/i,s=this.currentLabel,r=1;if(this.node.labelStyle.scaleWithSize?r=n:this.node.labelStyle.scaleWithZoom&&(r=this.zoom),e.measure(t,s),s.hheight>1.5){var a=this.getLabelPosition(s,r);e.paint(t,a.x,a.y,r,s)}}},t.prototype.getLabelPosition=function(t,e){return{x:this.x,y:this.y+this.hWidth+t.hheight*e*.8+(t.style.margin||0)*this.zoom}},t.prototype.distanceToEdge=function(t,e,i,n){return t},t.prototype.hitTest=function(t,e,i,n){var s,r=this.node,a=r.renderHheight*i,o=r.renderHwidth*i,l=r.x,h=r.y;if(a<o){var u=o-a;s=d.Geometry.distanceToSegmentSq(l-u,h,l+u,h,t,e)}else s=(t-l)*(t-l)+(e-h)*(e-h);var c=(a+n)*(a+n);if(s<c){var p=a*a;return s<p?0:Math.sqrt(s)-a}return n},t}();t.Shape=r;var a=function(t){function e(e,i){t.call(this,e,i),this.validate()}return n(e,t),e.prototype.postProcess=function(t,e){var i=this.node.customShape.onUpdate.call(this.node,e,this.node.radius),n=new d.Rect(i.bounds[0],i.bounds[1],i.bounds[2],i.bounds[3]);this.node.targetHWidth=i.HWidth,this.node.targetHHeight=i.HHeight,this.node.bounds=n,this.node.outerBounds=n.clone(),i.anchor&&(this.node.shapeAnchorX=i.anchor[0],this.node.shapeAnchorY=i.anchor[1])},e.prototype.paint=function(t,e,i){var n=this.nodesLayer.getNodeImage(this.node);this.node.customShape.paint.call(this.node,t,this.x,this.y,this.hWidth,this.hHeight,n,i)},e.prototype.paintSelection=function(e,i,n){this.node.customShape.paintSelection?this.node.customShape.paintSelection.call(this.node,e,this.x,this.y,this.hWidth,this.hHeight):t.prototype.paintSelection.call(this,e,i,n)},e.prototype.distanceToEdge=function(e,i,n,s){return"function"==typeof this.node.customShape.distanceToEdge?this.node.customShape.distanceToEdge.call(this.node,e,i,n,s):t.prototype.distanceToEdge.call(this,e,i,n,s)},e.prototype.hitTest=function(e,i,n,s){return"function"==typeof this.node.customShape.hitTest?this.node.customShape.hitTest.call(this.node,e,i,n,s):t.prototype.hitTest.call(this,e,i,n,s)},e.prototype.validate=function(){var t=this.node;"object"!=typeof t.customShape?d.Helpers.error('If the display of an object is "customShape", it\'s mandatory to supply the rendering methods for the custom shape'):("function"!=typeof t.customShape.onUpdate&&d.Helpers.error("onUpdate function was not supplied for the custom shape"),"function"!=typeof t.customShape.paint&&d.Helpers.error("paint function was not supplied for the custom shape"))},e}(t.Shape);t.CustomShape=a,function(t){t[t.Floating=0]="Floating",t[t.Scene=1]="Scene",t[t.Fixed=2]="Fixed"}(t.NodeAnchorMode||(t.NodeAnchorMode={}));var o=t.NodeAnchorMode,l=function(){function t(){this.id=null,this.data=null,this.added=!1,this.removed=!1,this.visibility=1,this.selected=!1,this.hovered=!1,this.dragging=!1,this.selectionLock=!1,this.cursor=null,this.invisible=!1,this.items=[],this.currentItems=null,this.label=null,this._labelStyle=null}return Object.defineProperty(t.prototype,"labelStyle",{get:function(){return this._labelStyle},set:function(t){null!==this._labelStyle?(d.Helpers.warn("For performance reasons it is not recommended to set `labelStyle` to a custom object. Instead modify properties on the existing object."),d.SettingsHelper.updateRecursive(this._labelStyle,t,d.SettingsMapping.ItemsChartSettingsItemsLayerLabelStyle,{})):this._labelStyle=t},enumerable:!0,configurable:!0}),t}();t.ItemsLayerObject=l;var h=function(t){function e(e,i,n){void 0===n&&(n=!1),t.call(this),this.parentNode=null,this.data=null,this.links=[],this.dataLinks=[],this.isNode=!0,this.isLink=!1,this.aura=null,this.x=null,this.y=null,this.anchorX=null,this.anchorY=null,this.shapeAnchorX=0,this.shapeAnchorY=0,this.targetHHeight=null,this.targetHWidth=null,this.hHeight=0,this.hWidth=0,this.renderHheight=0,this.renderHwidth=0,this.anchorMode=o.Floating,this.coordinates=null,this.coordinatesCache=null,this.coordinatesCachePrecision=1/0,this.expanded=!1,this.focused=!1,this.background=!1,this.loading=!1,this.userLock=!1,this.relevance=1,this.display="image",this.image=null,this.imageCropping=null,this.imageSlicing=null,this.tintImage=!1,this._anchorStyle=null,this.zindex=0,this.opacity=1,this.aspectRatio=1,this.locks=0,this.locked=null,this.fillColor=null,this.lineColor=null,this.lineWidth=1,this.layer=i,this.id=e}return n(e,t),Object.defineProperty(e.prototype,"anchorStyle",{get:function(){return this._anchorStyle},set:function(t){null!==this._anchorStyle?(d.Helpers.warn("For performance reasons it is not recommended to set `anchorStyle` to a custom object. Instead modify properties on the existing object."),d.SettingsHelper.updateRecursive(this._anchorStyle,t,d.SettingsMapping.ItemsChartSettingsNodeAnchorStyle,{})):this._anchorStyle=t},enumerable:!0,configurable:!0}),e}(l);t.Node=h;var u=function(t){function e(e,i){t.call(this),this.data=null,this.from=null,this.to=null,this.isNode=!1,this.isLink=!0,this.multiId=null,this.radius=1,this.fillColor=null,this.lineColor=null,this.length=1,this.strength=1,this.dashed=!1,this.currentRadius=0,this.background=null,this._angle=null,this.targetRadius=null,this.targetStrength=null,this.targetLength=null,this.direction=null,this.fromDecoration=null,this.toDecoration=null,this.relevance=1,this.toPieValue=0,this.toPieColor=null,this.toPie0=null,this.toPie1=null,this.currentCenterOffset=0,this.layer=i,this.id=e}return n(e,t),e.prototype.otherEnd=function(t){return t===this.from?this.to:t===this.to?this.from:null},e.prototype.commonNode=function(t){return this.from===t.from||this.from===t.to?this.from:this.to===t.from||this.to===t.to?this.to:null},e}(l);t.Link=u;var c=function(t){function e(e,i){t.call(this,e),this.parentId=null,this.scaleNodesWithZoom=!0,this.scaleLinksWithZoom=!0,this._nodes=[],this._links=[],this._nodesDel=null,this._linksDel=null,this.idToNode={},this.idToLink={},this.lastClickedNode=null,this.newNodes={},this.newLinks={},this.modifiedNodes={},this.modifiedLinks={},this.deletedNodes={},this.deletedLinks={},this.drilldownId=null,this.layerSettings=i,this.scene=e,this.clearModified(),this.styleUpdater=this.createStyleUpdater(this.layerSettings.style)}return n(e,t),e.prototype.onSettingsChanged=function(t){if(t.style){this.styleUpdater=this.createStyleUpdater(this.layerSettings.style);for(var e=0,i=this.nodes();e<i.length;e++){var n=i[e];this.touchNode(n)}for(var s=0,r=this.links();s<r.length;s++){var a=r[s];this.touchLink(a)}}},e.prototype.updateStyle=function(t){this.styleUpdater.updateLayer(t,!0)},e.prototype.postprocessStyle=function(t){this.styleUpdater.postprocessLayer(t)},e.prototype.createStyleUpdater=function(t){return null},e.prototype.paintPrepare=function(t){},e.prototype.paintBackground=function(t){},e.prototype.findObjectById=function(t){return this.idToNode.hasOwnProperty(t)?this.idToNode[t]:this.idToLink.hasOwnProperty(t)?this.idToLink[t]:null},e.prototype.paint=function(t){this.paintPrepare(t),this.clearModified(),this.paintBackground(t);var e=this.scene.selection;if(e.length>0){for(var i=[],n=[],s=0;s<e.length;s++){var r=e[s];r.layer===this&&r instanceof h&&i.push(r),r.layer===this&&r instanceof u&&n.push(r)}(i.length>0||n.length>0)&&this.paintSelection(t,i,n)}var a=this.links(),o=this._makeHoveredLast(a,this.scene.hoverLink);this.paintLinks(t,a),this._restoreHovered(a,o);var l=this.nodes(),c=this._makeHoveredLast(l,this.scene.hoverNode);this.paintNodes(t,l),this._restoreHovered(l,c)},e.prototype.clearObjects=function(){for(var t=0,e=this.nodes();t<e.length;t++){var i=e[t];this.removeNode(i)}for(var n=0,s=this.links();n<s.length;n++){var r=s[n];this.removeLink(r)}},e.prototype.nodes=function(){if(null===this._nodesDel)return this._nodes;for(var t=[],e=0;e<this._nodes.length;e++){var i=this._nodes[e];this._nodesDel[i.id]||t.push(i)}return this._nodes=t,this._nodesDel=null,t},e.prototype.links=function(){if(null===this._linksDel)return this._links;for(var t=[],e=0;e<this._links.length;e++){var i=this._links[e];this._linksDel[i.id]||t.push(i)}return this._links=t,this._linksDel=null,t},e.prototype.addNode=function(t){this.nodes();var e;return this.idToNode.hasOwnProperty(t)?(e=this.idToNode[t],e.removed=!1,e.added||(e.added=!0)):this.deletedNodes.hasOwnProperty(t)?(e=this.deletedNodes[t],e.removed=!1,e.added||(e.added=!0),this.idToNode[t]=e,this._nodes.push(e),delete this.deletedNodes[t]):(e=new h(t,this),e.added=!0,this.idToNode[t]=e,this._nodes.push(e),this.newNodes[t]=e),this.modifiedNodes[t]=e,e},e.prototype.touchNodeOrLink=function(t){t instanceof h?this.modifiedNodes[t.id]=t:t instanceof u&&(this.modifiedLinks[t.id]=t)},e.prototype.touchNode=function(t){this.modifiedNodes[t.id]=t},e.prototype.removeNode=function(t){var e=t.id;this.idToNode.hasOwnProperty(e)&&(t===this.lastClickedNode&&(this.lastClickedNode=null),this.scene.objectRemoved(t),this.newNodes.hasOwnProperty(t.id)?this.deleteNode(t):(t.removed||(t.removed=!0),t.added=!1,this.modifiedNodes[e]=t))},e.prototype.deleteNode=function(t){null===this._nodesDel&&(this._nodesDel={}),this._nodesDel[t.id]=!0,this.scene.objectRemoved(t),delete this.newNodes[t.id],delete this.modifiedNodes[t.id],delete this.idToNode[t.id],this.deletedNodes[t.id]=t},e.prototype.addLink=function(t,e,i){var n=this.idToNode[e],s=this.idToNode[i];if(!n||!s)throw new Error("Cannot add link - missing nodes");var r=null;return this.links(),this.idToLink.hasOwnProperty(t)?(r=this.idToLink[t],r.removed=!1,r.added||(r.added=!0)):this.deletedLinks.hasOwnProperty(t)?(r=this.deletedLinks[t],delete this.deletedLinks[t],this.idToLink[t]=r,this._links.push(r),r.removed=!1,r.added||(r.added=!0)):(r=new u(t,this),r.added=!0,this._links.push(r),this.idToLink[t]=r,this.newLinks[t]=r),r.from&&r.from!==n&&(d.Helpers.removeFromArrayHasty(r.from.links,r),r.from=null),r.from||(r.from=n,r.from.links.push(r),this.touchNode(r.from)),r.to&&r.to!==s&&(d.Helpers.removeFromArrayHasty(r.to.links,r),r.to=null),r.to||(r.to=s,r.to!==r.from&&(r.to.links.push(r),this.touchNode(r.to))),r.multiId=e<i?e+d.Helpers.SeparatorChar+i:i+d.Helpers.SeparatorChar+e,this.modifiedLinks[t]=r,r},e.prototype.removeLink=function(t){var e=t.id;this.idToLink.hasOwnProperty(e)&&(this.scene.objectRemoved(t),this.newLinks.hasOwnProperty(e)?this.deleteLink(t):(t.added=!1,t.removed||(t.removed=!0),this.modifiedLinks[e]=t))},e.prototype.deleteLink=function(t){null===this._linksDel&&(this._linksDel={}),this._linksDel[t.id]=!0,this.scene.objectRemoved(t),this.newLinks.hasOwnProperty(t.id)?delete this.newLinks[t.id]:this.deletedLinks[t.id]=t,delete this.modifiedLinks[t.id],delete this.idToLink[t.id],d.Helpers.removeFromArrayHasty(t.from.links,t),d.Helpers.removeFromArrayHasty(t.to.links,t)},e.prototype.touchLink=function(t){this.modifiedLinks[t.id]=t},e.prototype.getModified=function(){return{this_newNodes:this.newNodes,this_newLinks:this.newLinks,this_modifiedNodes:this.modifiedNodes,this_modifiedLinks:this.modifiedLinks,this_deletedNodes:this.deletedNodes,this_deletedLinks:this.deletedLinks}},e.prototype.hasTopologyChanges=function(){return d.Helpers.hasProperties(this.newNodes)||d.Helpers.hasProperties(this.newLinks)||d.Helpers.hasProperties(this.deletedNodes)||d.Helpers.hasProperties(this.deletedLinks)},e.prototype.hasStyleChanges=function(){return this.hasTopologyChanges()||d.Helpers.hasProperties(this.modifiedLinks)||d.Helpers.hasProperties(this.modifiedNodes)},e.prototype.clearModified=function(){this.newNodes={},this.newLinks={},this.modifiedNodes={},this.modifiedLinks={},this.deletedNodes={},this.deletedLinks={}},e.prototype.paintNodeDetails=function(t,e,i,n,s,r,a,o,l){var h,u,c,p=o.labelRenderer,f=o.context;if(t.hovered?(u=d.Helpers.toleranceMax(r,1,.9),c=d.Helpers.toleranceMin(a,s,.9)):(u=r,c=a),t.currentItems)for(var g=0;g<t.currentItems.length;g++){var m=t.currentItems[g];if(l){if(m.style.zIndex>=0)break}else if(m.style.zIndex<0)continue;var v=m.style.x||0,y=m.style.y||0,S=m.style.px||0,b=m.style.py||0,C=e+n*S+v,x=i+s*b+y;h=m.style.scaleWithSize?s/(m.style.hoverEffect?c:a):m.style.scaleWithZoom?m.style.hoverEffect?u:r:1,p.measure(f,m),m.hheight>1.5&&p.paint(f,C,x,h,m)}},e.prototype.getNodesSceneZoom=function(){return this.scaleNodesWithZoom?1:1/this.scene.zoom},e.prototype.getGeometry=function(){var t=this.scene.toDisplayTransform(),e=t.xm,i=t.xa,n=t.ym,s=t.ya,r=this.bounds.x0,a=this.bounds.x1,o=this.bounds.y0,l=this.bounds.y1,h=(r-i)/e,u=(a-i)/e,c=(o-s)/n,d=(l-s)/n,p=this.scaleNodesWithZoom?this.scene.zoom:1,f=this.scaleLinksWithZoom?this.scene.zoom:1;return{txm:e,txa:i,tym:n,tya:s,zoom:p,linkZoom:f,x0s:r,x1s:a,y0s:o,y1s:l,x0w:h,y0w:c,x1w:u,y1w:d}},e.prototype._makeHoveredLast=function(t,e){var i=t.length;if(i<2||!e||e===t[i-1])return i-1;for(var n=0;n<t.length;n++){var s=t[n];if(s===e){var r=t[i-1];return t[i-1]=e,t[n]=r,n}}return i-1},e.prototype._restoreHovered=function(t,e){var i=t.length;if(e!==i-1){var n=t[e];t[e]=t[i-1],t[i-1]=n}},e}(d.Layer);t.ItemsLayer=c;var p=function(){function t(){this.nameLegend=null,this.showInLegend=!0,this.legendGroupId=null}return t}();t.SettingsItemClass=p;var f=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(p);t.SettingsNodeClass=f;var g=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(p);t.SettingsLinkClass=g;var m=function(){function t(){this.allObjectsStyleFunction=null,this.linkStyleFunction=null,this.nodeStyleFunction=null,this.nodeRules={},this.linkRules={},this.nodeClasses=[],this.linkClasses=[],this.node={fillColor:"#c7dae0",lineColor:null,lineWidth:null,radius:30,aspectRatio:1,shadowColor:null,lineDash:null},this.nodeAnchor={lineColor:"blue",lineWidth:1},this.link={fillColor:"#333",shadowColor:null,fromDecoration:null,toDecoration:null,label:null,radius:1,length:1,strength:1,lineDash:null,toPieValue:0,toPieColor:null},this.item={align:"center",aspectRatio:4,borderRadius:1e3,textStyle:{fillColor:"black",font:"12px Arial"},backgroundStyle:{fillColor:"rgba(255,255,255,0.7)"},hoverEffect:!0,zIndex:0},this.linkLabel={padding:.6,margin:0,align:"center",aspectRatio:4,borderRadius:1e3,lineSpacing:.2,textStyle:{fillColor:"black",font:"12px Arial"},backgroundStyle:{fillColor:"#FFF",lineColor:"gray"},scaleWithZoom:!0,scaleWithSize:!1,rotateWithLink:!1},this.nodeLabel={padding:0,margin:0,align:"center",aspectRatio:4,borderRadius:1e3,lineSpacing:.2,textStyle:{fillColor:"black",font:"12px Arial"},backgroundStyle:{fillColor:"rgba(255,255,255,0.7)"},scaleWithZoom:!1,scaleWithSize:!0},this.nodeLocked={},this.nodeExpanded={},this.nodeFocused={fillColor:"#09c"},this.nodeNotLoaded={fillColor:"#fff"},this.nodeHovered={shadowOffsetX:0,shadowOffsetY:2,shadowBlur:6,shadowColor:"rgba(0,0,0,.6)"},this.linkHovered={shadowOffsetX:0,shadowOffsetY:0,shadowBlur:2,shadowColor:"blue"},this.nodeSelected={},this.linkSelected={},this.selection={enabled:!0,fillColor:null,lineColor:"rgba(0,0,0,0)",lineWidth:1,sizeConstant:.5,sizeProportional:0,shadowBlur:8,shadowOffsetX:1,shadowOffsetY:3,shadowColor:"rgba(0,0,0,0.8)"},this.removedColor="#EEE",this.nodeBackground={},this.nodeDetailMinZoom=.2,this.nodeDetailMinSize=5,this.linkDetailMinZoom=.5,this.linkDetailMinSize=12,this.linkDecorationScale=4,this.linkDecorationMinSize=4,this.nodeLabelScaleBase=30,this.linkLabelScaleBase=1,this.scaleObjectsWithZoom=!0,this.scaleLinksWithZoom=null}return t}();t.SettingsItemsLayerStyle=m;var v=function(){function t(t,e){this.layer=e,this.styleSettings=t,this.nodeClasses=d.Helpers.arrayToMap(this.styleSettings.nodeClasses,"className"),this.linkClasses=d.Helpers.arrayToMap(this.styleSettings.linkClasses,"className"),this.nodeRules=this.sortRules(this.styleSettings.nodeRules),this.styleSettings.nodeStyleFunction&&this.nodeRules.unshift(this.styleSettings.nodeStyleFunction),this.linkRules=this.sortRules(this.styleSettings.linkRules),this.styleSettings.linkStyleFunction&&this.linkRules.unshift(this.styleSettings.linkStyleFunction)}return t.getClasses=function(t){return t?t.trim().split(/\s+/g):[]},t.prototype.updateLayer=function(t,e){void 0===e&&(e=!1),null==e&&(e=!1),this.isIncremental=e;var i=this.styleSettings,n=t.changes.style||t.changes.zoom&&!(!this.nodeRules.length&&!this.linkRules.length);if(n){this.isIncremental=!1;for(var s=0,r=this.layer.nodes();s<r.length;s++)this.layer.touchNode(r[s]);for(var a=0,o=this.layer.links();a<o.length;a++)this.layer.touchLink(o[a])}var l=this.layer.modifiedNodes;for(var h in l){var u=l[h];if(this.updateNode(u),e)for(var a=0;a<u.links.length;a++)this.layer.touchLink(u.links[a])}var c=this.layer.modifiedLinks;for(var h in c){var d=c[h];this.updateLink(d)}if(i.allObjectsStyleFunction&&(t.changes.zoom||this.layer.hasStyleChanges())){var p=this.layer.nodes(),f=this.layer.links(),g=i.allObjectsStyleFunction(p,f),m=f,v=p;g&&(m=g.modifiedLinks,v=g.modifiedNodes);for(var y=0;y<v.length;y+=1)this.layer.touchNode(v[y]);for(var y=0;y<m.length;y+=1)this.layer.touchLink(m[y])}if(this.nodeRules.length>0){l=this.layer.modifiedNodes;for(var h in l){var u=l[h];this.applyStyleRules(u,this.nodeRules)}}if(this.linkRules.length>0){c=this.layer.modifiedLinks;for(var h in c){var d=c[h];this.applyStyleRules(d,this.linkRules)}}},t.prototype.postprocessLayer=function(t){var e=this.layer.modifiedNodes;for(var i in e){var n=e[i];this.postprocessNode(n)}var s=this.layer.modifiedLinks;for(var i in s){var r=s[i];this.postprocessLink(r)}},t.prototype.postprocessItems=function(t){for(var e=t.currentItems,i=t instanceof h?d.SettingsMapping.ItemsChartSettingsNodeItem:d.SettingsMapping.ItemsChartSettingsLinkItem,n=this.styleSettings.item,s=0;s<t.items.length;s++){var r=t.items[s],a=new d.Label(n);d.SettingsHelper.updateRecursive(a.style,r,i,{},"items["+s+"]"),e.push(a)}},t.prototype.sortRules=function(t){var e=[];for(var i in t)e.push(i);e.sort();for(var n=[],s=0;s<e.length;s++){var i=e[s];n.push(t[i])}return n},t.prototype.updateNode=function(t){var e=this.styleSettings,i=t.hovered;if(t.radius||(t.radius=10),t.label=null,d.Helpers.extendStyleTo(e.node,t),t._labelStyle=d.Helpers.realClone(e.nodeLabel),t._anchorStyle=d.Helpers.realClone(e.nodeAnchor),t.userLock&&d.Helpers.extendStyleTo(e.nodeLocked,t),t.expanded&&d.Helpers.extendStyleTo(e.nodeExpanded,t),t.focused&&d.Helpers.extendStyleTo(e.nodeFocused,t),t.background&&d.Helpers.extendStyleTo(e.nodeBackground,t),t.data.loaded||d.Helpers.extendStyleTo(e.nodeNotLoaded,t),t.data&&(t.data.error&&(t.label=t.data.error,t.fillColor="red"),t.data.style&&d.Helpers.extendStyleTo(t.data.style,t),t.data.className))for(var n=this.getClassSequence(t.data.className,this.nodeClasses),s=0;s<n.length;s++){var r=n[s];d.Helpers.extendStyleTo(this.styleSettings.nodeClasses[r].style,t)}t.removed&&(t.fillColor=e.removedColor),t.selected&&d.Helpers.extendStyleTo(e.nodeSelected,t),i&&d.Helpers.extendStyleTo(e.nodeHovered,t)},t.prototype.updateLink=function(t){var e=this.styleSettings;t.label=null,t._labelStyle=d.Helpers.realClone(e.linkLabel),t.radius=1,d.Helpers.extendStyleTo(e.link,t);var i=t.hovered||t.from.hovered||t.to.hovered;if(t.data.style&&d.Helpers.extendStyleTo(t.data.style,t),t.data.className)for(var n=this.getClassSequence(t.data.className,this.linkClasses),s=0;s<n.length;s++){var r=n[s];d.Helpers.extendStyleTo(e.linkClasses[r].style,t)}t.selected&&d.Helpers.extendStyleTo(e.linkSelected,t),i&&(d.Helpers.extendStyleTo(e.linkHovered,t),t.from.hovered&&(t.toPieColor=t.fillColor)),t.removed&&(t.fillColor=e.removedColor)},t.prototype.applyStyleRules=function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n(t)}},t.prototype.getClassSequence=function(e,i){for(var n=t.getClasses(e),s=[],r=0;r<n.length;r++){var a=n[r],o=i[a];o?s.push(o.index):d.Helpers.error("Unable to apply item style: class `"+a+"` undefined")}return s.sort(function(t,e){return t-e})},t}();t.ItemsStyle=v;var y=function(t){function e(){t.apply(this,arguments),this.data=[],this.info={enabled:!1,nodeContentsFunction:null,linkContentsFunction:null},this.interaction=new b,this.nodeMenu=new _,this.linkMenu=new R,this.advanced=new w,this.style={}}return n(e,t),e.prototype.apply=function(e){return this.applyCompatibility(e,[{from:"style.makeImagesCircular",to:"style.node.imageCropping"},{from:"style.nodeDecorationMinSize",alternative:"style.nodeDetailMinSize"},{from:"style.nodeLabelMinSize",to:"style.nodeDetailMinSize"},{from:"style.nodeRules",alternative:"style.nodeStyleFunction",alternativeAsWarning:!0},{from:"style.linkRules",alternative:"style.linkStyleFunction",alternativeAsWarning:!0}]),t.prototype.apply.call(this,e)},e}(d.Settings);t.Settings=y;var S=function(t){function e(){t.apply(this,arguments),this.cacheSize=1e4,this.random=null,this.randomGridLinkProbability=.6,this.randomNodes=0,this.randomLinks=0,this.randomTreeDensity=3,this.requestMaxUnits=2}return n(e,t),e}(d.SettingsData);t.SettingsData=S;var b=function(t){function e(){t.apply(this,arguments),this.nodesMovable=!0,this.zooming=new x,this.panning={enabled:!0},this.selection=new C}return n(e,t),e}(d.SettingsInteraction);t.SettingsInteraction=b;var C=function(){function t(){this.enabled=!0,this.nodesSelectable=!0,this.linksSelectable=!0,this.lockNodesOnMove=!0,this.allowMoveNodesOffscreen=!0,this.tolerance=10}return t}();t.SettingsInteractionSelection=C;var x=function(){function t(){this.zoomInOnDoubleClick=!0,this.autoZoomAfterClick=!1,this.doubleClickZoom=1.5,this.sensitivity=1,this.wheel=!0,this.fingers=!0}return t}();t.SettingsInteractionZooming=x;var w=function(t){function e(){t.apply(this,arguments),this.perNodeLoadingIndicator=!0}return n(e,t),e}(d.SettingsAdvanced);t.SettingsAdvanced=w;var L=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(r);t.ImageShape=L;var A=function(t){function e(){t.apply(this,arguments),this.leftOffset=0}return n(e,t),e.prototype.postProcessLabel=function(t,e){if(this.nodesLayer.chart.assetsLoaded){var i=this.node.targetHHeight,n=this.currentLabel;null==n?n=this.currentLabel=new d.Label(this.node.labelStyle,!0):n.style=this.node.labelStyle,n.text=this.node.label.toString(),n.style.backgroundStyle=null,n.style.image=null,e.measure(t,n);var s=n.hwidth,r=n.hheight,a=s/r*i;this.node.image&&(a+=i),this.node.targetHWidth=Math.max(a,i),this.node.bounds.x0=-this.node.targetHWidth,this.node.bounds.x1=this.node.targetHWidth}},e.prototype.distanceToEdge=function(t,e,i,n){return d.Geometry.distanceToBalloon(t,e,i,n)},e.prototype.paintSelection=function(t,e,i){var n=this.node.renderHheight*(1+e)+i,s=this.node.renderHwidth-this.node.renderHheight+n,r=this.x,a=this.y,o=r+s-n;t.moveTo(o,a-n),t.arc(o,a,n,-Math.PI/2,Math.PI/2,!1),o=r-s+n,t.lineTo(o,a+n),t.arc(o,a,n,Math.PI/2,-Math.PI/2,!1),t.closePath()},e.prototype.paintDetails=function(t,e){var i=this.currentLabel;if(i){if(this.hWidth>2){if(e.measure(t,i),this._computeScale(),this.image){var n=this.image,s=this.x-this.hHeight,r=this.y-this.imSize/2;if(this.node.imageSlicing){var a=this.node.imageSlicing;d.Graphics.drawImageHighQuality(t,n,a[0],a[1],a[2],a[3],s,r,this.imSize,this.imSize)}else d.Graphics.drawImageHighQuality(t,n,0,0,n.width,n.height,s,r,this.imSize,this.imSize)}e.paint(t,this.x+this.leftOffset,this.y,this.scale,i),d.Graphics.clearShadow(t)}}else this.basicPaintImage(t)},e.prototype._computeScale=function(){this.scale=this.hWidth/this.currentLabel.hheight,this.image&&(this.leftOffset=this.hWidth,this.imSize=2*this.hWidth)},e}(r);t.TextShape=A;var T=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.postProcessLabel=function(t,e){if(this.nodesLayer.chart.assetsLoaded){var i=this.node.labelStyle;i.backgroundStyle.fillColor="transparent";var n=this.currentLabel;null==n?n=this.currentLabel=new d.Label(i,!0):n.style=this.node.labelStyle,n.text=this.node.label.toString(),n.style.aspectRatio=1,n.style.image=null}},e.prototype.distanceToEdge=function(t,e,i,n){return r.prototype.distanceToEdge.call(this,t,e,i,n)},e.prototype._computeScale=function(){var t=Math.sqrt(this.currentLabel.hwidth*this.currentLabel.hwidth+this.currentLabel.hheight*this.currentLabel.hheight);if(this.image){var e=this.currentLabel.lineHeight+2*this.currentLabel.hwidth,i=(e*e+this.currentLabel.hheight*this.currentLabel.hheight)/2/e;i>t&&(this.leftOffset=i-t,t=i)}this.scale=this.hWidth/t,this.image&&(this.imSize=this.currentLabel.lineHeight*this.scale)},e}(A);t.RoundTextShape=T;var M={a0x:0,a0y:-1,a1x:.556548642145067,a1y:-1,a2x:1,a2y:-.5534547954623581,b0x:1,b0y:0,b1x:1,b1y:.808869027157099,b2x:0,b2y:1.2870402200068753,apexX:0,apexY:1.878652526641458,imageRadius:.6170212765957447},k=[M.a0x,M.a0y,M.a1x,M.a1y,M.a2x,M.a2y,M.b0x,M.b0y,M.b1x,M.b1y,M.b2x,M.b2y,M.apexX,M.apexY],P=d.Helpers.reversePolyline(d.Geometry.transformPolyline(k,-1,0,1,0)),I=[0,-1,.7095605708093294,-.7046444467621514,1,0,1,0,.4313896533498214,.9021657092700437,1,0],D=d.Helpers.reversePolyline(d.Geometry.transformPolyline(I,-1,0,1,0)),F=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.postProcess=function(e,i,n){t.prototype.postProcess.call(this,e,i,n),this.node.bounds.addBounds(0,0,0,this.node.targetHHeight*M.apexY),this.node.shapeAnchorX=0,this.node.shapeAnchorY=this.node.radius*M.apexY},e.prototype.getAnchor=function(){return{x:0,y:this.hWidth*M.apexY}},e.prototype.adaptToViewport=function(e,i,n,s,r){t.prototype.adaptToViewport.call(this,e,i,n,s,r),this.controlPoints=d.Geometry.transformPolyline(k,this.hWidth,this.x,this.hHeight,this.y),this.reverseControlPoints=d.Geometry.transformPolyline(P,this.hWidth,this.x,this.hHeight,this.y)},e.prototype.paintSelection=function(t,e,i){var n=this.hWidth*e+i,s=d.Geometry.outlinePolylineByVectors(this.controlPoints,I,n),r=d.Geometry.outlinePolylineByVectors(this.reverseControlPoints,D,n);t.moveTo.apply(t,s.slice(0,2)),t.bezierCurveTo.apply(t,s.slice(2,8)),t.bezierCurveTo.apply(t,s.slice(8,14)),t.arc(this.controlPoints[12],this.controlPoints[13],n,0,Math.PI,!1),t.bezierCurveTo.apply(t,r.slice(2,8)),t.bezierCurveTo.apply(t,r.slice(8,14)),t.closePath()},e.prototype.paintBasicShape=function(t){var e=d.Graphics.beginStrokeAndFill(t,this.node);e.beginPath(),e.moveTo.apply(e,this.controlPoints.slice(0,2)),e.bezierCurveTo.apply(e,this.controlPoints.slice(2,8)),e.bezierCurveTo.apply(e,this.controlPoints.slice(8,14)),e.bezierCurveTo.apply(e,this.reverseControlPoints.slice(2,8)),e.bezierCurveTo.apply(e,this.reverseControlPoints.slice(8,14)),e.closePath(),d.Graphics.endStrokeAndFill(t,e,this.node)},e.prototype.paintDetails=function(t,e){this.image&&this.basicPaintImage(t,M.imageRadius),this.paintLabel(t,e)},e.prototype.getLabelPosition=function(t,e){return{x:this.x,y:this.y-this.hWidth-t.hheight*e*1.1}},e.prototype.distanceToEdge=function(t,e,i,n){var s=e,r=t*M.apexY,a=d.Geometry.rayIntersectsSegment(0,0,i,n,0,r,s,0),o=d.Geometry.rayIntersectsSegment(0,0,i,n,-s,0,0,r),l=Math.min(a,o);return l<1/0?l:t},e}(r);t.DropletShape=F;var N=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.calcHalf=function(t,e){return this.node.aspectRatio>1?{hWidth:t,hHeight:t/this.node.aspectRatio}:{hWidth:e*this.node.aspectRatio,hHeight:e}},e.prototype.render=function(t,e,i){var n=this.calcHalf(this.hWidth,this.hHeight),s=n.hHeight,r=n.hWidth;s=s*(1+e)+i,r=r*(1+e)+i,t.moveTo(this.x,this.y),t.moveTo(this.x-r,this.y-s),t.lineTo(this.x+r,this.y-s),t.lineTo(this.x+r,this.y+s),t.lineTo(this.x-r,this.y+s),t.lineTo(this.x-r,this.y-s)},e.prototype.paintBasicShape=function(t){var e=d.Graphics.beginStrokeAndFill(t,this.node);this.render(e,0,0),d.Graphics.endStrokeAndFill(t,e,this.node)},e.prototype.paintSelection=function(t,e,i){this.render(t,e,i),t.closePath()},e.prototype.distanceToEdge=function(t,e,i,n){var s=this.calcHalf(t,e);return Math.min(s.hHeight/Math.abs(n),s.hWidth/Math.abs(i))},e.prototype.hitTest=function(t,e,i,n){var s=this.node,r=this.calcHalf(s.renderHwidth*i,s.renderHheight*i),a=Math.max(Math.abs(t-s.x)-r.hWidth,Math.abs(e-s.y)-r.hHeight);return a<0?0:Math.min(a,n)},e}(r);t.RectangleShape=N;var E=function(t){function e(){t.apply(this,arguments),this.multilinkSpacing=10,this.nodeRadiusExtent=[10,150],this.linkRadiusExtent=[.6,30],this.linkStrengthExtent=[.1,1],this.linkLengthExtent=[.3,150],this.nodeAutoScaling=null,this.linkAutoScaling=null,this.linkStrengthAutoScaling=null,this.linkLengthAutoScaling=null,this.hiddenLinks={lineColor:"rgba(100,100,100,0.3)",lineWidth:1,size:7},this.fadeTime=600}return n(e,t),e}(m);t.SettingsNodesLayerStyle=E;var z=function(t){function e(e,i,n){t.call(this,e,i),this.g=null,this.fadeout=n,this.styleSettings=e}return n(e,t),e.prototype.updateLayer=function(e,i){
  39. void 0===i&&(i=!1),this.nodeRadiusChanged=d.Helpers.hasProperties(this.layer.newNodes)||d.Helpers.hasProperties(this.layer.deletedNodes)||this.styleSettings.allObjectsStyleFunction&&this.layer.hasStyleChanges()||this.nodeRules.length>0,this.linkRadiusChanged=d.Helpers.hasProperties(this.layer.newLinks)||d.Helpers.hasProperties(this.layer.deletedLinks)||this.styleSettings.allObjectsStyleFunction&&this.layer.hasStyleChanges()||this.linkRules.length>0,t.prototype.updateLayer.call(this,e,i)},e.prototype.postprocessLayer=function(t){this.g=t.context;var e=this.layer,i=this.styleSettings.removedColor;this.itemRenderer=t.labelRenderer;for(var n in e.modifiedLinks){var s=e.modifiedLinks[n];this.fadeout&&s.relevance<1&&(s.fillColor&&(s.fillColor=d.Colors.blend(i,s.fillColor,s.relevance)),s.lineColor&&(s.lineColor=d.Colors.blend(i,s.lineColor,s.relevance)),s.length=.2+(s.length-.2)*s.relevance),this.postprocessLink(s)}for(var r in e.modifiedNodes){var a=e.modifiedNodes[r];this.fadeout&&a.relevance<1&&(a.fillColor&&(a.fillColor=d.Colors.blend(i,a.fillColor,a.relevance)),a.lineColor&&(a.lineColor=d.Colors.blend(i,a.lineColor,a.relevance)))}var o=this.layer.nodes();if(this.nodeRadiusChanged||this.fadeout&&t.changes.navigation){this.computeNodeSize(o,this.styleSettings.nodeAutoScaling,this.styleSettings.nodeRadiusExtent);for(var l=0;l<o.length;l++){var h=o[l];this.postprocessNode(h)}}else for(var u in e.modifiedNodes){var c=e.modifiedNodes[u];this.postprocessNode(c)}if(this.linkRadiusChanged||t.changes.navigation){var p=e.links();this.computeRadii(p,this.styleSettings.linkAutoScaling,this.styleSettings.linkRadiusExtent),this.computeStrengths(p,this.styleSettings.linkStrengthAutoScaling,this.styleSettings.linkStrengthExtent),this.computeLengths(p,this.styleSettings.linkLengthAutoScaling,this.styleSettings.linkLengthExtent),d.Helpers.sort(p,function(t,e){return t.targetRadius===e.targetRadius?0:t.targetRadius>e.targetRadius?1:-1})}d.Helpers.sort(o,function(t,e){return t.zindex-e.zindex})},e.prototype.updateLink=function(e){var i=e.radius;t.prototype.updateLink.call(this,e),i!==e.radius&&(this.linkRadiusChanged=!0)},e.prototype.updateNode=function(e){var i=e.radius;t.prototype.updateNode.call(this,e),i!==e.radius&&(this.nodeRadiusChanged=!0),null==e.label&&e.data&&(e.label=e.data.id)},e.prototype.computeNodeSize=function(t,e,i){var n=i[0],s=i[1];if("linear"===e||"logarithmic"===e||"square"===e){for(var r=1/0,a=-(1/0),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)?(r=Math.min(r,h),a=Math.max(a,h)):l.targetHHeight=n}}if(r>=a)for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetHHeight=n)}else if("linear"===e)for(var u=s/a,o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)&&(l.targetHHeight=Math.max(n,h*u))}}else if("square"===e)for(var u=s/Math.sqrt(a),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)&&(l.targetHHeight=Math.max(n,Math.sqrt(h)*u))}}else{r=Math.max(1e-4,r),a=Math.max(r+1e-4,a);for(var u=s/Math.log(a),o=0;o<t.length;o++){var l=t[o];!l.removed&&d.Helpers.isNumber(l.radius)&&(l.targetHHeight=Math.max(n,Math.log(Math.max(1e-4,l.radius))*u))}}}else for(var o=0;o<t.length;o++){var l=t[o];l.removed||(d.Helpers.isNumber(l.radius)?l.targetHHeight=Math.min(Math.max(1e-6,l.radius),1e30):l.targetHHeight=n)}if(this.fadeout)for(var o=0;o<t.length;o++){var l=t[o];l.relevance<1&&(l.targetHHeight=l.targetHHeight*l.relevance)}},e.prototype.computeRadii=function(t,e,i){var n=i[0],s=i[1];if("linear"===e||"logarithmic"===e||"square"===e){for(var r=1/0,a=-(1/0),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)?(r=Math.min(r,h),a=Math.max(a,h)):l.targetRadius=n}}if(r>=a)for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetRadius=n)}else if("linear"===e)for(var u=s/a,o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)&&(l.targetRadius=Math.max(n,h*u))}}else if("square"===e)for(var u=s/Math.sqrt(a),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var h=l.radius;d.Helpers.isNumber(h)&&(l.targetRadius=Math.max(n,Math.sqrt(h)*u))}}else{r=Math.max(1e-4,r),a=Math.max(r+1e-4,a);for(var u=s/Math.log(a),o=0;o<t.length;o++){var l=t[o];!l.removed&&d.Helpers.isNumber(l.radius)&&(l.targetRadius=Math.max(n,Math.log(Math.max(1e-4,l.radius))*u))}}}else for(var o=0;o<t.length;o++){var l=t[o];l.removed||(d.Helpers.isNumber(l.radius)?l.targetRadius=Math.min(Math.max(1e-6,l.radius),1e30):l.targetRadius=n)}if(this.fadeout)for(var o=0;o<t.length;o++){var l=t[o];l.relevance<1&&(l.targetRadius=l.targetRadius*l.relevance)}},e.prototype.computeStrengths=function(t,e,i){var n=i[0],s=i[1];if("linear"===e||"logarithmic"===e||"square"===e){for(var r=1/0,a=-(1/0),o=0;o<t.length;o++){var l=t[o];l.removed||(r=Math.min(r,l.strength),a=Math.max(a,l.strength))}if(r>=a)for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetStrength=n)}else if("linear"===e)for(var h=s/a,o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetStrength=Math.min(n,l.strength*h))}else if("square"===e)for(var h=s/Math.sqrt(a),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var u=l.strength;d.Helpers.isNumber(u)&&(l.targetStrength=Math.max(n,Math.sqrt(u)*h))}}else{r=Math.max(1e-4,r),a=Math.max(r+1e-4,a);for(var h=s/Math.log(a),o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetStrength=Math.max(n,Math.log(Math.max(1e-4,l.strength))*h))}}}else for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetStrength=Math.min(Math.max(n,l.strength),s))}},e.prototype.computeLengths=function(t,e,i){var n=i[0],s=i[1];if("linear"===e||"logarithmic"===e||"square"===e){for(var r=1/0,a=-(1/0),o=0;o<t.length;o++){var l=t[o];l.removed||(r=Math.min(r,l.length),a=Math.max(a,l.length))}if(r>=a)for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetLength=n)}else if("linear"===e)for(var h=(s-n)/(a-r),u=s-a*h,o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetLength=l.length*h+u)}else if("square"===e)for(var h=s/Math.sqrt(a),o=0;o<t.length;o++){var l=t[o];if(!l.removed){var c=l.length;d.Helpers.isNumber(c)&&(l.targetLength=Math.max(n,Math.sqrt(c)*h))}}else{r=Math.max(1e-4,r),a=Math.max(r+1e-4,a);for(var h=(s-n)/Math.log(a/r),u=s-h*Math.log(a),o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetLength=Math.log(Math.max(1e-4,l.length))*h+u)}}}else for(var o=0;o<t.length;o++){var l=t[o];l.removed||(l.targetLength=Math.min(Math.max(n,l.length),s))}},e.prototype.postprocessNode=function(t){var e;switch(t.display){case"customShape":e=a;break;case"roundtext":e=T;break;case"text":e=A;break;case"droplet":e=F;break;case"rectangle":e=N;break;default:e=L}t.shape&&t.shape.constructor===e||(t.shape&&(t.shape.node=null),t.shape=new e(t,this.layer));var i=t.outerBounds=d.Rect.createEmpty();t.shape.postProcess(this.styleSettings,this.g,this.itemRenderer),i.addRect(t.bounds),t.currentItems=[],this.postprocessItems(t);for(var n=t.targetHWidth,s=t.targetHHeight,r=0;r<t.currentItems.length;r++){var o=t.currentItems[r];this.measureCustomItem(n,s,t.shape.sizeScale,o,i)}},e.prototype.measureCustomItem=function(t,e,i,n,s){this.itemRenderer.measure(this.g,n);var r=1;n.style.scaleWithSize&&(r=i);var a=n.style.x||0,o=n.style.y||0,l=n.style.px||0,h=n.style.py||0,u=t*l+a,c=e*h+o;s.addBounds(u-n.hwidth*r,c-n.hheight*r,u+n.hwidth*r,c+n.hheight*r)},e.prototype.postprocessLink=function(t){var e=[];if(t.label){var i=void 0;t.currentItems&&t.currentItems.length?(i=t.currentItems[0],i.style=t.labelStyle):i=new d.Label(t.labelStyle),i.text=t.label.toString(),i.style.px=0,i.style.py=0,e.push(i)}t.currentItems=e,this.postprocessItems(t)},e}(v);t.NodesStyle=z;var O=function(){function t(){this.className=null,this.text=null,this.onInit=null,this.onRefresh=null,this.onClick=null}return t}();t.SettingsMenuButton=O;var H=function(){function t(){this.enabled=!0,this.showData=!1,this.contentsFunction=null,this.buttons=[]}return t}();t.SettingsMenu=H;var _=function(t){function e(){t.apply(this,arguments),this.contentsFunction=null}return n(e,t),e}(H);t.SettingsNodeMenu=_;var R=function(t){function e(){t.apply(this,arguments),this.contentsFunction=null}return n(e,t),e}(H);t.SettingsLinkMenu=R;var B=function(t){function e(e){t.call(this),this.animationOrder=600,this.paintOrder=40,this.updateOrder=2e3,this.node=null,this.link=null,this.contents=null,this.x=0,this.y=0,this.chart=e,this.container=e.shell.menuContainer,this.scene=e.scene,this.events=e.events,this.buttons=[],this.popup=d.Helpers.createDom("div","DVSL-Menu",null,this.container),this.closeButton=d.Helpers.createDom("a","DVSL-Menu-close",null,this.popup),this.popupValue=d.Helpers.createDom("div","DVSL-Menu-title",null,this.popup),this.detailsDiv=d.Helpers.createDom("div","DVSL-Menu-details",null,this.popup),this.popupActions=d.Helpers.createDom("nav",null,null,this.popup),this.buildDetailsPanel(this.detailsDiv),this.buildCloseButton(this.closeButton),this.popup.style.position="absolute",this.popup.style.display="none"}return n(e,t),e.prototype.doAnimations=function(t){this.node&&(this.node.removed||this.link&&this.link.removed?this.hideMenu():this.node.layer.modifiedNodes.hasOwnProperty(this.node.id)&&this.updateMenu())},e.prototype.previewPointerDown=function(t){this.hideMenu()},e.prototype.previewWheel=function(t){this.hideMenu()},e.prototype.toggleNodeMenu=function(t){this.node===t?this.hideMenu():this.showNodeMenu(t)},e.prototype.toggleLinkMenu=function(t,e,i){this.link===i?this.hideMenu():this.showLinkMenu(t,e,i)},e.prototype.showNodeMenu=function(t){this.scene.settings.nodeMenu.enabled&&(this.node===t?this.updateMenu():(this.hideMenu(),this.showPopup(t,null)))},e.prototype.showLinkMenu=function(t,e,i){this.scene.settings.linkMenu.enabled&&(this.x=t,this.y=e,this.link===i?this.updateMenu():(this.hideMenu(),this.showPopup(null,i)))},e.prototype.showPopup=function(t,e){this.node=t,this.link=e,this.node&&(this.node.locks+=1),this.buildButtons(),this.contents=null,this.popupValue.innerHTML="",this.popup.style.display="block",this.updateMenu(),this.updateXY()},e.prototype.hideMenu=function(){(this.node||this.link)&&(this.node&&(this.node.locks-=1),this.node=null,this.link=null,this.popup.style.display="none")},e.prototype.updateMenu=function(){var t=this;this.closeButton.title=this.scene.settings.localization.closeButton;var e,i;this.node?(e=this.scene.settings.nodeMenu,i=this.node):(e=this.scene.settings.linkMenu,i=this.link);var n=null,s=this.node,r=this.link,a=function(e){if(t.node===s&&t.link===r&&e!==t.contents){if(null==e)t.popupValue.innerHTML="";else if(d.Helpers.isString(e))t.popupValue.innerHTML=e;else{if(!d.Helpers.isDomObject(e))return void d.Helpers.error("Invalid value for menu text. Must be either a string or a DOM element.");t.popupValue.innerHTML="",t.popupValue.appendChild(e)}t.contents=e}};if(e.contentsFunction){var o=e.contentsFunction.call(this.chart.api,i.data,i,a);n=d.Helpers.isString(o)||d.Helpers.isDomObject(o)?o:null==this.contents?"<small>"+this.scene.settings.localization.loadingLabel+"</small>":this.contents}else n=i.label;a(n),this.updateButtons(),e.showData?(this.details.innerHTML=JSON.stringify(i.data,null," "),this.detailsDiv.style.display="block"):(this.detailsDiv.style.display="none",null==n&&0===this.buttons.length&&this.hideMenu())},e.prototype.updateXY=function(){var t,e,i,n,s,r,a=12;if(this.node){var o=this.scene.toDisplay(this.node.x,this.node.y);s=o.x,r=o.y,t=r-this.node.renderHheight-a,n=r+this.node.renderHheight+a,e=s-this.node.renderHheight-a,i=s+this.node.renderHheight+a}else t=n=r=this.y,e=this.x-a,i=this.x+a;var l=this.chart.getRootChart().scene,h=l.x0,u=l.x0+l.width,c=this.popup.offsetWidth,d=this.popup.offsetHeight;r=Math.max(Math.min(r,l.y0+l.height-d),l.y0),i+c<=u?s=i:e-c>=h?s=e-c:(s=Math.max(e-c/2,h),r=n),this.popup.style.left=s+"px",this.popup.style.top=r+"px"},e.prototype.buildDefaultButton=function(t,e){this.chart.error("The menu does not support any named buttons.")},e.prototype.buildButton=function(t,e,i,n,s,r){var a=this,o=d.Helpers.createDom("a",e,i,this.popupActions);o.title=i,o.onclick=function(e){s&&s.call(a.chart.api,t,o),a.hideMenu(),e.preventDefault()},o.href="#",n&&n.call(this.chart.api,t,o),this.buttons.push({e:o,t:t,a:r})},e.prototype.buildButtons=function(){this.popupActions.innerHTML="",this.buttons=[];var t,e;this.node?(t=this.scene.settings.nodeMenu,e=this.node):(t=this.scene.settings.linkMenu,e=this.link);var i=t.buttons;if(i)for(var n=0;n<i.length;n++){var s=i[n];d.Helpers.isString(s)?this.buildDefaultButton(e,s):this.buildButton(e,s.className,s.text,s.onInit,s.onClick,s.onRefresh)}},e.prototype.updateButtons=function(){for(var t=0;t<this.buttons.length;t++){var e=this.buttons[t];e.a&&e.a.call(this.chart.api,e.t,e.e)}},e.prototype.buildCloseButton=function(t){var e=this;t.onclick=function(t){e.hideMenu(),t.preventDefault()}},e.prototype.buildDetailsPanel=function(t){var e=d.Helpers.createDom("small",null,"Technical data",t),i=this.details=d.Helpers.createDom("pre",null,"",t);i.style.display="none",e.onclick=function(){"none"===i.style.display?i.style.display="block":i.style.display="none"}},e}(d.ChartElement);t.Menu=B;var U=function(t){function e(e){t.call(this),this.animationOrder=800,this.paintOrder=45,this.updateOrder=2e3,this.chart=e,this.scene=e.scene,this.options=this.scene.settings,this.item=null,this.x=null,this.y=null,this.popup=new d.InfoPopup(e)}return n(e,t),e.prototype.previewPointerMove=function(t){this.onMove(t.x,t.y)},e.prototype.doAnimations=function(t){null!==this.x&&null!==this.y&&this.onMove(this.x,this.y)},e.prototype.previewPointerDown=function(t){this.x=this.y=null,this.setCurrentObject(0,0,null)},e.prototype.previewPointerDrag=function(t){this.x=this.y=null,this.setCurrentObject(0,0,null)},e.prototype.onPointerOut=function(t){this.x=this.y=null,this.setCurrentObject(0,0,null)},e.prototype.onMove=function(t,e){if(this.y=e,this.x=t,this.options.info.enabled){var i=this.scene.hoverNode?this.scene.hoverNode:this.scene.hoverLink;this.setCurrentObject(t,e,i)}},e.prototype.setCurrentObject=function(t,e,i){if(i){if(i!==this.item){var n=this.buildContents(i);this.popup.show(t,t,e,n)}else this.popup.updateXY(t,t,e);this.item=i}else this.item=null,this.popup.hide()},e.prototype.buildContents=function(t){var e=this,i=null;if(t instanceof h?i=this.options.info.nodeContentsFunction:t instanceof u&&(i=this.options.info.linkContentsFunction),i){var n=function(i){t===e.item&&e.popup.updateContents(i)};return i.call(this.chart.api,t.data,t,n)}return t.label},e}(d.ChartElement);t.InfoPopup=U;var V="undefined"!=typeof Float32Array,G=function(){function t(){this.enabled=!0,this.drawLimit=.8,this.cellSize=3,this.intensity=6,this.style={},this.defaultStyle=null,this.defaultColors=["rgba(47,195,47,0.3)","rgba(176,220,11,0.3)","rgba(234,180,4,0.3)","rgba(222,103,44,0.3)","rgba(236,46,46,0.3)","rgba(213,66,155,0.3)","rgba(111,82,184,0.3)","rgba(28,124,213,0.3)","rgba(86,185,247,0.3)","rgba(10,232,235,0.3)"],this.overlap=!1}return t}();t.SettingsNodesLayerAuras=G;var W=function(){function t(t,e,i){this._marginCells=1,this._polygons=[],this._autoAuraCounter=0,this._overlapWarning=!0,this._settings=i,this._scene=t,this._events=e}return t.prototype.reinitialize=function(t){var e=this._scene,i=this._settings;this._overlapWarning=i.overlap;var n=e.width,s=e.height,r=Object.keys(i.style);r.sort(function(t,e){var n=i.style[t].zIndex-i.style[e].zIndex;return 0===n?t.localeCompare(e):n}),this._auras=new Array(r.length+1),this._aurasMap=Object.create(null),this._aurasMap[""]=0;for(var a=0;a<r.length;a++){var o=r[a];this._aurasMap[o]=a+1,this._auras[a+1]=i.style[o]}for(var l=this._marginCells,h=i.cellSize,u=this._widthCells=Math.ceil(n/h)+2*l,c=this._heightCells=Math.ceil(s/h)+2*l,d=this._cellLength=r.length+1,p=u*c*d,f=this._cells=V?new Float32Array(p):new Array(p),g=this._cellEdges=V?new Int8Array(p):new Array(p),m=u*d,v=0;v<p;v++)g[v]=-1;if(!V)for(var a=0;a<f.length;a++)f[a]=0;var y=[-m,-m+d,+d,+m+d,+m,+m-d,-d,-m-d,-m,-m+d,+d,+m+d,+m,+m-d,-d,-m-d];this._edgeFinderDeltas=V?new Int16Array(y):y},t.prototype.doAnimations=function(t,e){if(this._settings.enabled&&t){for(var i=!1,n=!1,s=0;s<t.length;s++){var r=t[s].aura;if(r){Array.isArray(r)?!this._overlapWarning&&r.length>1&&(d.Helpers.warn("One or more nodes defined more than one aura. It is recommended to set `overlap: true` in the chart configuration to better handle this scenario."),this._overlapWarning=!0):r=[r];for(var a=0;a<r.length;a++){var o=""+(r[a]||"");""!==o&&(n=!0,i=this.ensureAura(o)||i)}}}if(!n)return void(this._polygons.length>0&&(this._polygons=[]));i&&this._events.notifySceneChanges({settingsChanges:{auras:{}}});var l=e.changes,h=l.settingsChanges;(i||!this._auras||l.bounds||h&&h.auras)&&this.reinitialize(e),this.reset(),this.stage1(t),this.stage2(),this.stage3()}},t.prototype.ensureAura=function(t){var e=this._settings,i=this._autoAuraCounter,n=e.defaultColors;if(!n||!n.length)return!1;var s=e.style[t];s||(s=d.Helpers.realClone(this._settings.defaultStyle)||{},e.style[t]=s);var r=!1;return void 0===s.lineWidth&&(s.lineWidth=1,r=!0),void 0===s.fillColor&&(s.fillColor=n[i],this._autoAuraCounter=(i+1)%n.length,r=!0),null==s.showInLegend&&(s.showInLegend=!0),null==s.enabled&&(s.enabled=!0),null==s.zIndex&&(s.zIndex=0),r},t.prototype.reset=function(){for(var t=this._cellEdges,e=0;e<t.length;e++)t[e]=-1;for(var i=this._cells,e=0;e<i.length;e++)i[e]=0;this._polygons=new Array(this._auras.length);for(var e=0;e<this._polygons.length;e++)this._polygons[e]=[]},t.prototype.stage1=function(t){for(var e=this._scene,i=e.zoom,n=this._settings,s=n.cellSize,r=this._marginCells,a=this._widthCells,o=this._heightCells,l=this._cells,h=this._cellLength,u=this._aurasMap,c=n.intensity,d=e.centerX*e.zoom%s,p=e.centerY*e.zoom%s,f=0;f<t.length;f++){var g=t[f],m=e.toDisplay(g.x,g.y),v=(m.x+d)/s+r,y=(m.y+p)/s+r,S=0|v,b=0|y,C=v-S,x=y-b,w=t[f].aura;if(w){Array.isArray(w)||(w=[w]);for(var L=0;L<w.length;L++){var A=""+(w[L]||""),T=u[A];if(void 0!==T&&this._auras[T].enabled){var M=Math.min((g.hHeight*i+5)/s,a,o),k=M*c+1,P=2*k;if(v>-P&&v<a+P&&y>-P&&y<o+P){var I=M/2,D=Math.ceil(k);k-=I;for(var F=-D;F<D;F++)if(!(v+F<r||v+F>=a-r))for(var N=C-F,E=-D;E<D;E++)if(!(y+E<r||y+E>=o-r)){var z=x-E,O=Math.sqrt(N*N+z*z)-I;if(O<k){O=O<=0?1:1-O/k;var H=T+(b+E)*a*h+(S+F)*h;l[H]=l[H]+O-l[H]*O}}}}}}}},t.prototype.stage2=function(){var t=this._cellLength;if(1!==t&&!this._settings.overlap)for(var e=this._cells,i=0;i<e.length;i+=t)for(var n=i,s=e[i],r=1;r<t;r++){var a=e[i+r];a>s?(s=a,e[n]=0,n=i+r):a>0&&(e[i+r]=0)}},t.prototype.stage3FindEdge=function(t,e){var i=this._cells,n=this._cellEdges,s=this._settings,r=s.drawLimit,a=this._edgeFinderDeltas,o=[e],l=e,h=2,u=0,c=0,p=s.overlap,f=0,g=0;do{for(var m=n[l],v=void 0,y=(h+5)%8,S=y,b=!1;S<y+8;S++)if(m!==S&&(v=l+a[S],i[v]>=r)){b=!0;break}if(!b){l!==e&&d.Helpers.error("Edge finder stuck");break}if(S%=8,(h!==S||++f>5)&&(0===u&&(u=7===S?7:1,c=7===S?6:2),(!p||h!==(S+u)%8&&h!==(S+c)%8)&&o.push(l),f=0),m===-1&&(n[l]=S),h=S,l=v,++g>1e4){d.Helpers.error("Edge finder run into a loop");break}}while(l!==e);o[o.length-1]!==e&&o.push(e),t.push(o)},t.prototype.stage3=function(){for(var t=this._cellLength,e=this._widthCells*t,i=this._cells,n=this._cellEdges,s=this._settings,r=s.drawLimit,a=e-t,o=this._polygons,l=0,h=i.length-t,u=0;u<h;u++){var c=i[u];if(u%e>=a||c<r){var p=u+t;if(i[p]>=r&&n[p]<0&&(this.stage3FindEdge(o[p%t],p),++l>1e4)){d.Helpers.error("Edge finder found too many polygons");break}}}},t.prototype.paintPolygons=function(t){if(this._settings.enabled){var e=t.context;e.save();for(var i=this._settings,n=i.cellSize,s=this._marginCells,r=s*n-n/2,a=this._cellLength,o=this._widthCells,l=this._auras,h=this._polygons,u=this._scene,c=-u.centerX*u.zoom%n,p=-u.centerY*u.zoom%n,f=1;f<h.length;f++){for(var g=h[f],m=l[f],v=d.Graphics.beginStrokeAndFill(e,m),y=0;y<g.length;y++){var S=g[y],b=S[0]/a|0,C=b%o*n-r+c,x=(b/o|0)*n-r+p,w=S[1]/a|0,L=w%o*n-r+c,A=(w/o|0)*n-r+p;v.moveTo((C+L)/2,(A+x)/2);for(var T=2;T<S.length;T++){w=S[T]/a|0;var M=w%o*n-r+c,k=(w/o|0)*n-r+p;v.quadraticCurveTo(L,A,(M+L)/2,(k+A)/2),L=M,A=k}w=S[1]/a|0;var P=w%o*n-r+c,I=(w/o|0)*n-r+p;v.quadraticCurveTo(L,A,(P+L)/2,(I+A)/2),v.closePath()}d.Graphics.endStrokeAndFill(e,v,m)}d.Graphics.restore(e)}},t}();t.NodesLayerAuras=W;var j=function(e){function i(t,i,n){e.call(this,t.scene,i),this.chart=t,this.imageCache={},this.imageLoading={},this.multilinks={},this.useFadeout=n,this.styleUpdater=this.createStyleUpdater(i.style),this.events=t.events,this.layerSettings=i;var s=i.style;this.style=s,this.scaleNodesWithZoom=s.scaleObjectsWithZoom,this.scaleLinksWithZoom=null==s.scaleLinksWithZoom?s.scaleObjectsWithZoom:s.scaleLinksWithZoom,this._auras=new W(t.scene,t.events,i.auras)}return n(i,e),i.prototype.createStyleUpdater=function(t){return null==this.useFadeout?null:new z(t,this,this.useFadeout)},i.prototype.updateStyle=function(t){var e=!t.changes.newGraph;this.styleUpdater.updateLayer(t,e)},i.prototype.postprocessStyle=function(t){e.prototype.postprocessStyle.call(this,t),this.animateSize(t)},i.prototype.animateSize=function(t){var e=t.timeStamp,i=t.changes.newGraph,n=t.dtime,s=!1,r=!1,a=this.style.fadeTime;i=i||!(a>0)||n>a;var o=[],l=[];if(i){for(var h=0,u=this.nodes();h<u.length;h++){var c=u[h];c.removed?(c.visibility=0,o.push(c)):c.targetHWidth!==c.hWidth&&(c.added=!1,c.visibility=1,c.hHeight=c.targetHHeight,c.hWidth=c.targetHWidth)}for(var d=0,p=this.links();d<p.length;d++){var f=p[d];f.removed?(f.visibility=0,l.push(f)):f.targetRadius!==f.currentRadius&&(f.added=!1,f.visibility=1,f.currentRadius=f.targetRadius)}}else{for(var g=a>0?Math.max(0,Math.pow(.2,n/a)):0,m=.01,h=0,u=this.nodes();h<u.length;h++){var c=u[h];if(c.added===!0&&(c.added=e),c.added+a<e&&(c.added=!1),c.removed===!0&&(c.removed=e),c.removed)s=!0,c.visibility=g,c.hHeight=c.hHeight*g,c.hWidth=c.hWidth*g,e-c.removed<a?c.visibility=1-(e-c.removed)/a:o.push(c);else{e-c.added<a?(c.visibility=(e-c.added)/a,s=!0):c.visibility=1;var v=c.targetHHeight,y=c.hHeight,S=c.targetHWidth,b=c.hWidth;v===y&&S===b||(r||(Math.abs(v-y)/Math.max(v,y)>=.5||Math.abs(S-b)/Math.max(S,b)>=.5)&&(r=!0),s=!0,c.hHeight=y*g+v*(1-g),c.hWidth=b*g+S*(1-g),Math.abs(c.hHeight-v)<m*v&&(c.hHeight=v,c.hWidth=S))}}for(var d=0,p=this.links();d<p.length;d++){var f=p[d];f.added===!0&&(f.added=e),f.added+a<e&&(f.added=!1),f.removed===!0&&(f.removed=e),f.removed?(s=!0,f.currentRadius=f.currentRadius*g,e-f.removed<a?f.visibility=1-(e-f.removed)/a:l.push(f)):(e-f.added<a&&!f.invisible?(f.visibility=(e-f.added)/a,s=!0):f.visibility=1,f.targetRadius!==f.currentRadius&&(s=!0,f.currentRadius=f.currentRadius*g+f.targetRadius*(1-g),Math.abs(f.currentRadius-f.targetRadius)<m*f.targetRadius&&(f.currentRadius=f.targetRadius)))}}for(var C=0;C<l.length;C++){var x=l[C];this.deleteLink(x)}for(var w=0;w<o.length;w++){var L=o[w];this.deleteNode(L)}if(s){var A={position:!0};r&&(A.dynamicLayout=!0),this.events.notifySceneChanges(A),t.animating=!0}},i.prototype.paintPrepare=function(t){this.computeNodeRenderRadii(),this.multilinks=this.updateMultilinks(),(t.changes.position||this.hasTopologyChanges())&&this.placePies()},i.prototype.paintBackground=function(t){this._auras.doAnimations(this.nodes(),t),this._auras.paintPolygons(t)},i.prototype.paintSelection=function(t,e,i){var n=this.style.selection;if(n.enabled){null===n.fillColor&&(n=d.Helpers.clone(n),n.fillColor=this.chart.settings.area.style.fillColor,n.fillColor&&"transparent"!==n.fillColor||(n.fillColor="white"));var s=this.getGeometry(),r=s.txm,a=s.txa,o=s.tym,l=s.tya,h=s.zoom,u=t.context,c=n.sizeProportional,p=n.sizeConstant;u.beginPath();for(var f=0;f<e.length;f++){var g=e[f];g.invisible||(g.shape.adaptToViewport(r,a,o,l,h),g.shape.paintSelection(u,c,p*h))}for(var f=0;f<i.length;f++){var m=i[f];if(!m.invisible){var v=(m.currentRadius/2*(1+c)+.9*p)*h,y=m.from,S=m.to,b=y.x*r+a,C=y.y*o+l,x=S.x*r+a,w=S.y*o+l,L=b-x,A=C-w,T=1/Math.sqrt(L*L+A*A),M=L*T,k=A*T;if(0!==m.currentCenterOffset){var P=k*m.currentCenterOffset*h,I=-M*m.currentCenterOffset*h;b+=P,C+=I,x+=P,w+=I}M*=v,k*=v,u.moveTo(b+k,C-M),u.lineTo(b-k,C+M),u.lineTo(x-k,w+M),u.lineTo(x+k,w-M),u.closePath()}}return d.Graphics.paint(u,n)}},i.prototype.paintLinks=function(t,e){var i=this.getGeometry();return this.paintLinksImpl(t,e,this.multilinks,{geometry:i,paintDetails:i.zoom>this.style.linkDetailMinZoom})},i.prototype.paintNodes=function(t,e){var i=this.getGeometry();t.animating=this.paintNodesImpl(t,e,{geometry:i,paintDetails:i.zoom>this.style.nodeDetailMinZoom},t.timeStamp)||t.animating},i.prototype.updateMultilinks=function(){if(!this.hasTopologyChanges())return this.multilinks;for(var t=this.links(),e={},i=[],n=0;n<t.length;n++){var s=t[n],r=s.multiId;if(e.hasOwnProperty(r)){var a=e[r];if(a instanceof Array)a.push(s);else{var o=[a,s];i.push(o),e[r]=o}}else e[r]=s}for(var l=0;l<i.length;l++)i[l].sort(function(t,e){return(""+(t.id||"")).localeCompare(""+(e.id||""))});return e},i.prototype.getNodeImage=function(t){var e=this;if(!t.image)return null;var i=t.tintImage&&t.fillColor,n=t.imageCropping,s=t.image,r=s;if(i&&(s+="##"+t.fillColor),s+="##"+n,this.imageCache.hasOwnProperty(s))return this.imageCache[s];if(this.imageLoading[s])return null;var a=function(r){return n&&(r=d.Graphics.cropImageToCircle(r,n)),i&&(r=d.Graphics.applyColorToImage(r,t.fillColor,!1)),e.imageCache[s]=r,delete e.imageLoading[s],e.events.notifySceneChanges({layout:!0}),r},o=this.scene.assetsLoader.getAssetImage(r);return o?a(o):null},i.prototype.computeNodeRenderRadii=function(){for(var t=this.getGeometry().zoom,e=0,i=this.nodes();e<i.length;e++){var n=i[e],s=n.hHeight*t,r=n.hWidth*t;n.lineWidth&&(s+=n.lineWidth/2,r+=n.lineWidth/2),n.renderHheight=s,n.renderHwidth=r}},i.prototype.paintLinksImpl=function(t,e,i,n){var s=t.context,r=n.geometry.txm,a=n.geometry.txa,o=n.geometry.tym,l=n.geometry.tya,h=n.geometry.linkZoom,u=n.geometry.x0w,c=n.geometry.y0w,p=n.geometry.x1w,f=n.geometry.y1w,g=1/h,m=this.scaleNodesWithZoom?1:1/this.scene.zoom;s.textAlign="center",s.textBaseline="middle";for(var v=this.style,y=v.linkDetailMinSize*v.linkDetailMinSize,S=n.paintDetails&&this.chart.assetsLoaded,b=v.multilinkSpacing*h,C=v.linkDecorationScale,x=v.linkDecorationMinSize,w=v.linkLabelScaleBase,L=2,A=5,T=.1,M=0;M<e.length;M++){var k=e[M];if(!k.invisible){var P=k.from.x,I=k.from.y,D=k.to.x,F=k.to.y,N=k.currentItems,E=N&&N.length&&N[0].style.rotateWithLink,z=void 0,O=k.from.renderHheight,H=k.to.renderHheight,_=k.from.renderHwidth,R=k.to.renderHwidth,B=d.Geometry.clipSegmentToBounds(P,I,D,F,(O+_)*m,(H+R)*m,u,c,p,f);if(B){P=B[0],I=B[1],D=B[2],F=B[3],P=P*r+a,I=I*o+l,D=D*r+a,F=F*o+l;var U=D-P,V=F-I,G=U*U+V*V,W=Math.max(.25,k.currentRadius*h*.5),j=k.hovered||k.from.hovered||k.to.hovered,Y=j||S&&G>y;if(G>25){var q=Math.sqrt(G);if(E&&(z=Math.atan2(V,U)*(180/Math.PI),P>=D&&(z-=180),k.currentItems[0].style.angle=z),k.toPieValue>0){var Z=H+L,X=Z+A+T*H;this.paintLinkPie(s,D,F,Z,X,k.toPie0,k.toPie1,k.toPieColor),H=X}if(q<O+H)continue;var Q=1/q,K=U*Q,J=V*Q,$=void 0,tt=void 0;if($=k.from.shape.distanceToEdge(O,_,K,J),tt=k.to.shape.distanceToEdge(H,R,-K,-J),q<=$+tt)continue;var et=Math.min((q-$-tt)/4,Math.max(x,W*C));k.fromDecoration&&($+=et),k.toDecoration&&(tt+=et),P+=K*$,I+=J*$,D-=K*tt,F-=J*tt,U=D-P,V=F-I,q=q-$-tt,Q=1/q;var it=k.multiId,nt=i[it];if(nt instanceof Array){var st=nt.length,rt=Math.min(b*(st-1),1.5*O,1.5*H),at=rt*(nt.indexOf(k)-(st-1)/2)/(st-1);k.from.id>k.to.id&&(at=-at),k.currentCenterOffset=at*g,P-=J*at,D-=J*at,I+=K*at,F+=K*at}else k.currentCenterOffset=0;if(k.renderPoints={x0:P,y0:I,x1:D,y1:F},k.renderBounds=new d.Rect(P,I,D,F),Y&&k.currentItems&&!k.removed&&(k.currentItems.sort(function(t,e){return t.style.zIndex-e.style.zIndex}),this.paintLinkItems(s,t.labelRenderer,h,W/w,P,I,K,J,q,W,k.currentItems,k.renderBounds,j,!0)),s.beginPath(),k.fromDecoration&&this.paintLinkDecoration(s,P,I,K,J,et,k.fromDecoration,k.fillColor),k.toDecoration&&this.paintLinkDecoration(s,D,F,-K,-J,et,k.toDecoration,k.fillColor),k.lineDash){var ot=P+J*W,lt=I-K*W,ht=P-J*W,ut=I+K*W;if(k.lineDash.length>0)for(var ct=k.lineDash,dt=ct.length,pt=ct.reduce(function(t,e){return t+e})*h,ft=0,gt=0;gt<=q/pt;gt++){for(var mt=0;mt<=dt-1;mt+=2){var vt=gt*pt+ft;if(vt>q-W)break;var yt=vt+ct[mt]*h,St=yt>=q-W?q-W:yt;s.moveTo(ot+vt*K,lt+vt*J),s.lineTo(ht+vt*K,ut+vt*J),s.lineTo(ht+St*K,ut+St*J),s.lineTo(ot+St*K,lt+St*J),s.closePath(),ft+=h*(ct[mt]+ct[mt+1])}ft=0}else for(var bt=Math.max(5,3*W),gt=0;gt<=q/bt;gt+=2){var vt=gt*bt,St=Math.min((gt+1)*bt,q);s.moveTo(ot+vt*K,lt+vt*J),s.lineTo(ht+vt*K,ut+vt*J),s.lineTo(ht+St*K,ut+St*J),s.lineTo(ot+St*K,lt+St*J),s.closePath()}}else s.moveTo(P+J*W,I-K*W),s.lineTo(P-J*W,I+K*W),s.lineTo(D-J*W,F+K*W),s.lineTo(D+J*W,F-K*W),s.closePath();d.Graphics.fill(s,k),Y&&k.currentItems&&!k.removed&&this.paintLinkItems(s,t.labelRenderer,h,W/w,P,I,K,J,q,W,k.currentItems,k.renderBounds,j,!1)}else if(k.fillColor){if(s.beginPath(),s.lineWidth=Math.max(.1,2*W),s.strokeStyle=k.fillColor,k.dashed)for(var q=Math.sqrt(G),Q=1/q,K=U*Q,J=V*Q,bt=Math.max(5,3*W),gt=0;gt<=q/bt;gt+=2){var vt=gt*bt,St=Math.min((gt+1)*bt,q);s.moveTo(P+vt*K,I+vt*J),s.lineTo(P+St*K,I+St*J)}else s.moveTo(P,I),s.lineTo(D,F);s.stroke(),k.renderPoints={x0:P,y0:I,x1:D,y1:F},k.renderBounds=new d.Rect(P,I,D,F)}}}}return!1},i.prototype.paintNodesImpl=function(e,i,n,s){var r=!1,a=e.context,o=n.geometry.txm,l=n.geometry.txa,h=n.geometry.tym,u=n.geometry.tya,c=n.geometry.zoom,p=n.geometry.x0s,f=n.geometry.x1s,g=n.geometry.y0s,m=n.geometry.y1s,v=1/o,y=n.paintDetails,S=this.style.nodeDetailMinSize*this.style.nodeDetailMinSize*v*v,b=this.style.hiddenLinks,C=this.style.nodeLabelScaleBase;a.textAlign="center",a.textBaseline="middle";for(var x=this.style.removedColor,w=0;w<i.length;w++){var L=i[w];if(L.data&&!L.invisible){var A=L.shape;if(A.adaptToViewport(o,l,h,u,c),null!=L.anchorX&&null!=L.anchorY&&L.anchorMode===t.NodeAnchorMode.Floating){var T=L.anchorX*o+l,M=L.anchorY*h+u,k=A.getAnchor(),P=A.x+k.x,I=A.y+k.y,D=P-T,F=I-M,N=I;F<0&&(N=Math.max(N,M-F*Math.min(.3,Math.abs(D)/F))),a.beginPath(),a.moveTo(P,I),a.lineTo(P,N),a.lineTo(T,M),d.Graphics.stroke(a,L.anchorStyle)}}}for(var w=0;w<i.length;w++){var L=i[w],A=L.shape;if(L.data&&!L.invisible&&A.isInViewport(p,f,g,m,c)){var E=L.opacity,z=L.outerBounds.w(),O=L.outerBounds.h(),H=y&&z*O>S||L.hovered;if(E<1&&(a.globalAlpha=E),H&&!L.removed){var _=L.dataLinks.length-L.links.length;if(_>0)if(this.useFadeout&&L.relevance<1){var R=b.lineColor;b.lineColor=d.Colors.blend(x,R,L.relevance),this.paintHiddenLinks(a,L,A.x,A.y,A.hWidth,A.hHeight,_,b,b.size*c),b.lineColor=R}else this.paintHiddenLinks(a,L,A.x,A.y,A.hWidth,A.hHeight,_,b,b.size*c);L.items.sort(function(t,e){return t.zIndex-e.zIndex}),this.paintNodeDetails(L,A.x,A.y,A.hHeight,A.hWidth,c,C,e,!0)}A.paint(a,e.labelRenderer,H),H&&!L.removed&&this.paintNodeDetails(L,A.x,A.y,A.hHeight,A.hWidth,c,C,e,!1),E<1&&(a.globalAlpha=1)}}if(this.scene.settings.advanced.perNodeLoadingIndicator){var B=this.scene.settings.advanced.style.loadingArcStyle;a.save(),a.lineCap="round",a.lineWidth=B.lineWidth,a.strokeStyle=B.lineColor;var U=s/1400;U=(U-Math.floor(U))*(2*Math.PI);for(var V=U+Math.PI/2,w=0;w<i.length;w++){var L=i[w];if(!L.invisible){var A=L.shape;if(L.loading||L.image&&null===this.getNodeImage(L)){if(!A.isInViewport(p,f,g,m,c))continue;r=!0,a.beginPath(),a.arc(A.x,A.y,A.hWidth,U,V),a.stroke()}}}d.Graphics.restore(a)}return r},i.prototype.paintLinkDecoration=function(t,e,i,n,s,r,a,o){t.fillStyle=o,"circle"===a?(t.moveTo(e+r,i),t.arc(e,i,r,0,2*Math.PI,!0)):"arrow"===a?(t.moveTo(e-n*r,i-s*r),t.lineTo(e+n*r-s*r,i+s*r+n*r),t.lineTo(e+n*r+s*r,i+s*r-n*r)):d.Helpers.error("Unrecognized link decoration value. Valid values are 'circle' and 'arrow'.")},i.prototype.paintLinkPie=function(t,e,i,n,s,r,a,o){var l=(n+s)/2,h=s-n;t.beginPath(),t.arc(e,i,l,r,a),d.Graphics.paint(t,{lineColor:o,lineWidth:h})},i.prototype.paintLinkItems=function(t,e,i,n,s,r,a,o,l,h,u,c,p,f){var g,m;p?(g=d.Helpers.toleranceMax(i,1,.9),m=d.Helpers.toleranceMax(n,1,.9)):(g=i,m=n);for(var v=0;v<u.length;v++){var y=u[v];if(f){
  40. if(y.style.zIndex>=0)break}else if(y.style.zIndex<0)continue;var S=y.x||0,b=y.y||0,C=y.style.px||0,x=y.style.py||0,w=y.style.lx||0,L=y.style.ly||0;C=l*(C+1)*.5+w,x=x*h+L;var A=s+a*C-o*x+S,T=r+o*C+a*x+b,M=0;M=y.style.scaleWithSize?y.style.hoverEffect?m:n:y.style.scaleWithZoom?y.style.hoverEffect?g:i:1,e.paint(t,A,T,M,y),c.addRect(y.currentBounds)}},i.prototype.paintHiddenLinks=function(t,e,i,n,s,r,a,o,l){var h,u,c=2*Math.PI;if(e.links.length>0){for(var d=0,p=0,f=0;f<e.links.length;f++){var g=e.links[f];d+=g.otherEnd(e).x,p+=g.otherEnd(e).y}d=e.x-d/e.links.length,p=e.y-p/e.links.length;var m=1/Math.sqrt(d*d+p*p);h=d*m,u=p*m}else h=1,u=0;var v=c/a/3,y=Math.cos(-v*(a-1)/2),S=Math.sin(-v*(a-1)/2),b=h*y-u*S,C=h*S+u*y,x=b;y=Math.cos(v),S=Math.sin(v),t.beginPath();for(var w=1;w<=a;w++){var L=e.shape.distanceToEdge(s,r,x,C);t.moveTo(i+x*L,n+C*L),t.lineTo(i+x*(L+l),n+C*(L+l)),b=x*y-C*S,C=x*S+C*y,x=b}t.strokeStyle=o.lineColor,t.lineWidth=o.lineWidth,t.stroke()},i.prototype.findObjectAt=function(t,e,i){var n=this.scene,s=n.fromDisplay(t,e),r=s.x,a=s.y,o=1/n.zoom,l=this.scaleLinksWithZoom?o:1,h=null,u=[],c=null,p=i,f=n.hoverNode;if(f&&f.layer===this&&!f.invisible){var g=f.shape.hitTest(r,a,o,p*o);if(g/o<p){p=g/o,h=f;var m=this.findItem(t,e,h,i);if(m&&(c=m.item,p=Math.min(p,m.distance)),p<=0)return{object:h,details:c}}}for(var v=this.nodes(),y=v.length-1;y>=0;y--){var S=v[y];if(!S.removed&&!S.invisible&&d.Geometry.distanceToRect(r-S.x,a-S.y,S.outerBounds)<p*o){var g=S.shape.hitTest(r,a,o,p*o);if(g<=0){p=0,h=S;break}g/o<p&&(p=g/o,h=S),u.push(S)}}if(p>0){var b=n.hoverLink;if(b&&b.layer===this&&!b.invisible){var C=b.targetRadius/2*l,x=b.renderPoints,w=d.Geometry.distanceToSegmentSq(x.x0,x.y0,x.x1,x.y1,t,e);if(w<=(p+C)*(p+C)){p=0,h=b;var m=this.findItem(t,e,h,i);if(m&&(c=m.item,p=Math.min(p,m.distance)),p<=0)return{object:h,details:c}}}}if(p>0)for(var L=0,A=this.links();L<A.length;L++){var T=A[L],x=T.renderPoints;if(!T.removed&&!T.invisible&&x&&d.Geometry.distanceToRect(t,e,T.renderBounds)<p){var C=T.targetRadius/l*2,w=d.Geometry.distanceToSegmentSq(x.x0,x.y0,x.x1,x.y1,t,e),M=Math.min(p*p,C*C);w<M&&(p=Math.sqrt(w),h=T),u.push(T)}}if(0===p){var m=this.findItem(t,e,h,i);return{object:h,details:m?m.item:null}}for(var y=0;y<u.length;y++){var k=u[y],m=this.findItem(t,e,k,i);m&&m.distance<p&&(p=m.distance,h=k,c=m.item)}return p>i&&(h=null,c=null),{object:h,details:c}},i.prototype.findItem=function(t,e,i,n){if(!i)return null;var s=n*n,r=this.scene.hoverItem;if(r&&r.hwidth&&i.currentItems.indexOf(r)>-1){var a=d.Geometry.distanceToRect(t,e,r.currentBounds,!0);if(a<=s)return{item:r,distance:Math.sqrt(a)}}var o=null,l=n*n;if(i instanceof h){var u=i.shape.currentLabel;if(u&&u.currentBounds){var a=d.Geometry.distanceToRect(t,e,u.currentBounds,!0);a<l&&(o=u,l=a)}}for(var c=0;c<i.currentItems.length;c++){var p=i.currentItems[c];if(p.hwidth){var a=d.Geometry.distanceToRect(t,e,p.currentBounds,!0);a<=l&&(o=p,l=a)}}return l>s||!o?null:{item:o,distance:Math.sqrt(l)}},i.prototype.getGraphBounds=function(t){if(void 0===t&&(t=this.nodes()),!t||!t.length)return new d.Rect(0,0,0,0);for(var e=d.Rect.createEmpty(),i=0;i<t.length;i++){var n=t[i];if(!n.removed){var s=n.x,r=n.y,a=n.outerBounds;e.addBounds(a.x0+s,a.y0+r,a.x1+s,a.y1+r)}}return e},i.prototype.getNodeNeighborsBounds=function(t){if(!t||0===this.nodes().length)return new d.Rect(0,0,0,0);for(var e=t.outerBounds.clone().moveBy(t.x,t.y),i=t,n=0;n<t.links.length;n++){var s=t.links[n];if(i=s.otherEnd(t),!i.removed){var r=i.outerBounds,a=i.x,o=i.y;e.addBounds(r.x0+a,r.y0+o,r.x1+a,r.y1+o)}}return e},i.prototype.placePies=function(){for(var t=2*Math.PI,e=[],i=0,n=this.nodes();i<n.length;i++){for(var s=n[i],r=0,a=0;a<s.links.length;a++){var o=s.links[a];o.to===s&&o.toPieValue>0&&(r+=o.toPieValue,e.push(o),o._angle=Math.atan2(o.to.y-o.from.y,o.to.x-o.from.x))}if(r>0){e.sort(function(t,e){return t._angle-e._angle});for(var l=t/r,h=0,u=0,c=0;c<e.length;c++){var d=e[c];d.toPie0=h,h+=d.toPieValue*l,d.toPie1=h;var p=d._angle-(d.toPie0+d.toPie1)/2;p<0&&(p+=2*Math.PI),u+=p}u/=e.length,u-=Math.PI;for(var f=0;f<e.length;f++){var g=e[f];g.toPie0+=u,g.toPie1+=u}e=[]}}},i}(c);t.NodesLayer=j;var Y=function(t){function e(e,i,n){t.call(this,e,i,n)}return n(e,t),e.prototype.zoomOut=function(){},e.prototype.zoomOutPossible=function(){return!1},e.prototype.setSelection=function(t){for(var e,i=[],n=0;n<t.length;n++){var s=t[n];s instanceof h||s instanceof u?i.push(s):d.Helpers.isString(s)&&(e=this.getNode(s)||this.getLink(s))?i.push(e):this.error("setSelection: Could not find a chart object with the ID `"+s+"`.")}this.scene.setSelection(i)&&(this.events.notifySceneChanges({selection:!0}),this.notifySelectionChanged(this.createEventArguments(null,"api")))},e.prototype.createEventArguments=function(t,e){var i=null,n=null;if(t&&(t.x||t.y)){var s=this.scene.fromDisplay(t.x,t.y);i=s.x,n=s.y}return{chart:this.api,origin:e,chartX:i,chartY:n,hoverLink:this.scene.hoverLink,hoverNode:this.scene.hoverNode,hoverItem:this.scene.hoverItem,selection:this.scene.selection.slice()}},e}(d.Impl);t.Impl=Y}(u),function(t){var e=t.Gestures||(t.Gestures={}),i=t.Layouts||(t.Layouts={}),s=t.Bar||(t.Bar={});!function(t){t[t.NodeClass=0]="NodeClass",t[t.LinkClass=1]="LinkClass",t[t.Aura=2]="Aura"}(t.LegendItemType||(t.LegendItemType={}));var r=(t.LegendItemType,function(t){function e(e,i,n,s,r,a,o,l,h){t.call(this,i,n,s,r),this.itemId=e,this.enabled=a,this.node=o,this.link=l,this.aura=h}return n(e,t),e}(d.LegendEntry)),a=function(t){function e(e,i){t.call(this,e,null),this.halfSize=i}return n(e,t),e.prototype.distanceToEdge=function(){return this.halfSize},e}(u.Shape),o=function(t){function e(e,i){t.call(this,null,null,!0),this.data={id:null,loaded:!0},this.hHeight=e,this.hWidth=e,this.renderHheight=e,this.renderHwidth=e,this.x=i?2*-e:e+e/2,this.y=0,this.shape=new a(this,e)}return n(e,t),e}(u.Node),l=function(t){function e(){t.apply(this,arguments),this.textColorDisabled="rgba(64,62,62,0.3)",this.showItemsWithClasses="any"}return n(e,t),e}(d.SettingsLegendAdvanced);t.SettingsLegendAdvanced=l;var h=function(t){function e(){t.call(this),this.panel=new d.SettingsLegendPanel("bottom","left"),this.advanced=new l,this.marker.size=30,this.padding=15}return n(e,t),e}(d.SettingsLegend);t.SettingsLegend=h;var c=function(t){function e(){t.apply(this,arguments),this.paintOrder=51,this.updateOrder=100,this.linkClassState=Object.create(null),this.nodeClassState=Object.create(null),this.nodeAuraState=Object.create(null),this.allNodeClassesEnabled=!0,this.allLinkClassesEnabled=!0}return n(e,t),e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=e.changes.settingsChanges;i&&(i.style&&(i.style.nodeClasses||i.style.linkClasses)||i.auras||i.legend&&i.legend.text)&&(this.rebuildItems(),e.changes.bounds=!0,e.changes.filters=!0)},e.prototype.doAnimations=function(){return 1},e.prototype.paintMarker=function(t,e,i,n,s){if(s.node){var r={geometry:this.getGeometry(e,i,.6),paintDetails:!1};this.chart.renderer.paintNodes(t,[s.node],r,0)}else if(s.link){var r={geometry:this.getGeometry(e,i,1),paintDetails:!0};this.chart.renderer.paintLinks(t,[s.link],{},r)}else this.paintAuraMarker(t.context,e,i,n,s.aura)},e.prototype.paintAuraMarker=function(t,e,i,n,s){var r=n/527,a=e-n,o=i-n,l=d.Graphics.beginStrokeAndFill(t,s);l.moveTo(878.4*r+a,413.8*r+o),l.bezierCurveTo(856.4*r+a,404.2*r+o,817.1*r+a,388.9*r+o,769.7*r+a,378.2*r+o),l.bezierCurveTo(696.1*r+a,361.5*r+o,679.5*r+a,324.1*r+o,676.7*r+a,308.7*r+o),l.bezierCurveTo(674.4*r+a,296.1*r+o,652.9*r+a,188.3*r+o,589.9*r+a,107*r+o),l.bezierCurveTo(543*r+a,42.5*r+o,466.9*r+a,.6*r+o,381*r+a,.6*r+o),l.bezierCurveTo(238.4*r+a,.6*r+o,122.8*r+a,116.2*r+o,122.8*r+a,258.8*r+o),l.bezierCurveTo(122.8*r+a,264.7*r+o,123*r+a,270.5*r+o,123.4*r+a,276.3*r+o),l.lineTo(122.8*r+a,276.9*r+o),l.bezierCurveTo(122.8*r+a,276.9*r+o,127*r+a,333.8*r+o,136.7*r+a,389.3*r+o),l.bezierCurveTo(146.4*r+a,444.8*r+o,138.1*r+a,500.4*r+o,106.2*r+a,543.4*r+o),l.bezierCurveTo(74.3*r+a,586.4*r+o,2.1*r+a,689.2*r+o,4.9*r+a,754.4*r+o),l.bezierCurveTo(5*r+a,755.9*r+o,5.2*r+a,757.3*r+o,5.4*r+a,758.8*r+o),l.bezierCurveTo(4.1*r+a,769.2*r+o,3.5*r+a,779.8*r+o,3.5*r+a,790.5*r+o),l.bezierCurveTo(3.5*r+a,933.1*r+o,119.1*r+a,1048.7*r+o,261.7*r+a,1048.7*r+o),l.bezierCurveTo(349.6*r+a,1048.7*r+o,427.2*r+a,1004.7*r+o,473.9*r+a,937.6*r+o),l.lineTo(474.1*r+a,937.6*r+o),l.bezierCurveTo(474.1*r+a,937.6*r+o,510.2*r+a,891.8*r+o,518.5*r+a,884.8*r+o),l.bezierCurveTo(526.8*r+a,877.9*r+o,568.5*r+a,854.3*r+o,608.7*r+a,869.5*r+o),l.bezierCurveTo(631.7*r+a,878.2*r+o,675.6*r+a,894.2*r+o,719.1*r+a,905*r+o),l.bezierCurveTo(743.4*r+a,912.6*r+o,769.3*r+a,916.7*r+o,796.1*r+a,916.7*r+o),l.bezierCurveTo(938.7*r+a,916.7*r+o,1054.3*r+a,801.1*r+o,1054.3*r+a,658.5*r+o),l.bezierCurveTo(1054.3*r+a,544.8*r+o,980.6*r+a,448.1*r+o,878.4*r+a,413.8*r+o),l.closePath(),d.Graphics.endStrokeAndFill(t,l,s),l=d.Graphics.beginStrokeAndFill(t,{fillColor:"white"}),l.moveTo(796.1*r+a,825.2*r+o),l.bezierCurveTo(718.8*r+a,825.2*r+o,653.8*r+a,772.6*r+o,635*r+a,701.2*r+o),l.lineTo(423.3*r+a,750*r+o),l.bezierCurveTo(426.5*r+a,763*r+o,428.3*r+a,776.5*r+o,428.3*r+a,790.5*r+o),l.bezierCurveTo(428.3*r+a,882.5*r+o,353.7*r+a,957.1*r+o,261.7*r+a,957.1*r+o),l.bezierCurveTo(169.7*r+a,957.1*r+o,95.1*r+a,882.5*r+o,95.1*r+a,790.5*r+o),l.bezierCurveTo(95.1*r+a,698.5*r+o,169.7*r+a,623.9*r+o,261.7*r+a,623.9*r+o),l.bezierCurveTo(270.7*r+a,623.9*r+o,279.4*r+a,624.6*r+o,288*r+a,626*r+o),l.lineTo(331.2*r+a,417.8*r+o),l.bezierCurveTo(263.6*r+a,396.6*r+o,214.5*r+a,333.4*r+o,214.5*r+a,258.8*r+o),l.bezierCurveTo(214.5*r+a,166.8*r+o,289.1*r+a,92.2*r+o,381.1*r+a,92.2*r+o),l.bezierCurveTo(473.1*r+a,92.2*r+o,547.7*r+a,166.8*r+o,547.7*r+a,258.8*r+o),l.bezierCurveTo(547.7*r+a,298.1*r+o,534.1*r+a,334.1*r+o,511.4*r+a,362.6*r+o),l.lineTo(684*r+a,535.3*r+o),l.bezierCurveTo(713.6*r+a,508.4*r+o,752.9*r+a,492*r+o,796.1*r+a,492*r+o),l.bezierCurveTo(888.1*r+a,492*r+o,962.7*r+a,566.6*r+o,962.7*r+a,658.6*r+o),l.bezierCurveTo(962.7*r+a,750.6*r+o,888.1*r+a,825.2*r+o,796.1*r+a,825.2*r+o),l.closePath(),l.moveTo(381*r+a,425.4*r+o),l.bezierCurveTo(374.2*r+a,425.4*r+o,367.6*r+a,425*r+o,361*r+a,424.2*r+o),l.lineTo(317.5*r+a,633.5*r+o),l.bezierCurveTo(359.9*r+a,648.6*r+o,394.3*r+a,680.4*r+o,413*r+a,721*r+o),l.lineTo(630*r+a,671*r+o),l.bezierCurveTo(629.7*r+a,666.9*r+o,629.5*r+a,662.8*r+o,629.5*r+a,658.6*r+o),l.bezierCurveTo(629.5*r+a,620.8*r+o,642.1*r+a,585.9*r+o,663.4*r+a,557.9*r+o),l.lineTo(490.2*r+a,384.6*r+o),l.bezierCurveTo(460.9*r+a,410*r+o,422.8*r+a,425.4*r+o,381*r+a,425.4*r+o),l.closePath(),d.Graphics.endStrokeAndFill(t,l,{fillColor:"white"})},e.prototype.rebuildItems=function(){var t=this.chart.scene.settings.style,e=[],i=this.settings.marker.size/2,n=this.settings.text.fillColor,s=this.settings.advanced.textColorDisabled,a=this.nodeClassState,l=this.linkClassState,h=this.nodeAuraState;this.nodeClassState=Object.create(null),this.linkClassState=Object.create(null),this.nodeAuraState=Object.create(null),this.allLinkClassesEnabled=!0,this.allNodeClassesEnabled=!0;for(var c=0;c<t.nodeClasses.length;c++){var p=t.nodeClasses[c];if(p.showInLegend&&null!=p.style){var f=d.Helpers.clone(t.node);d.Helpers.extendStyleTo(p.style,f);var g=new o(i,!1);d.Helpers.extendStyleTo(f,g),this.chart.layer.styleUpdater.postprocessNode(g);var m=!d.Helpers.hasProperty(a,p.className)||a[p.className];this.nodeClassState[p.className]=m,m||(this.allNodeClassesEnabled=!1),e.push(new r(p.className,p.nameLegend||p.className,n,s,p.legendGroupId,m,g,null,null))}}for(var v=0;v<t.linkClasses.length;v++){var y=t.linkClasses[v];if(y.showInLegend&&null!=y.style){var f=d.Helpers.clone(t.link);d.Helpers.extendStyleTo(y.style,f);var S=new u.Link(null,null);d.Helpers.extendStyleTo(f,S),S.currentRadius=S.radius,S.from=new o(i,!0),S.to=new o(i,!1);var m=!d.Helpers.hasProperty(l,y.className)||l[y.className];this.linkClassState[y.className]=m,this.allLinkClassesEnabled=this.allLinkClassesEnabled&&m,e.push(new r(y.className,y.nameLegend||y.className,n,s,y.legendGroupId,m,null,S,null))}}for(var b=this.chart.settings.auras.style,C=Object.keys(b),x=0;x<C.length;x++){var w=C[x],L=b[w],m=!d.Helpers.hasProperty(h,w)||h[w];this.nodeAuraState[w]=m,m||(this.allNodeClassesEnabled=!1),(L.showInLegend||null==L.showInLegend)&&e.push(new r(w,L.nameLegend||w,n,s,L.legendGroupId,m,null,null,L))}this.resetEntries(e)},e.prototype.getGeometry=function(t,e,i){var n=this.settings.marker.size,s=-n,r=n,a=-n,o=n,l=i,h=i,u=t,c=e,d=t-n,p=t+n,f=e-n,g=e+n;return{txm:l,txa:u,tym:h,tya:c,zoom:i,x0s:d,x1s:p,y0s:f,y1s:g,x0w:s,y0w:a,x1w:r,y1w:o,linkZoom:i}},e.prototype.itemClicked=function(e,i){t.prototype.itemClicked.call(this,e,i),this.nodeClassState=Object.create(null),this.linkClassState=Object.create(null),this.allLinkClassesEnabled=!0,this.allNodeClassesEnabled=!0;for(var n=0;n<this.entries.length;n++){var s=this.entries[n];s.node?(this.nodeClassState[s.itemId]=s.enabled,s.enabled||(this.allNodeClassesEnabled=!1)):s.link?(this.linkClassState[s.itemId]=s.enabled,s.enabled||(this.allLinkClassesEnabled=!1)):(this.nodeAuraState[s.itemId]=s.enabled,s.aura.enabled=s.enabled,s.enabled||(this.allNodeClassesEnabled=!1))}this.chart.events.notifySceneChanges({filters:!0})},e.prototype.isNodeVisible=function(t){if(this.allNodeClassesEnabled)return!0;var e=t.className,i=t.style?t.style.aura:null;if(!e&&!i)return!0;var n=u.ItemsStyle.getClasses(e),s=Array.isArray(i)?i:[i];if("any"===this.settings.advanced.showItemsWithClasses){for(var r=!1,a=!1,o=0;o<n.length;o++)if(d.Helpers.hasProperty(this.nodeClassState,n[o])){if(this.nodeClassState[n[o]]){a=!0;break}r=!0}for(var o=0;o<s.length;o++)if(d.Helpers.hasProperty(this.nodeAuraState,s[o])){if(this.nodeAuraState[s[o]]){a=!0;break}r=!0}return a||!r}for(var o=0;o<n.length;o++)if(d.Helpers.hasProperty(this.nodeClassState,n[o])&&!this.nodeClassState[n[o]])return!1;for(var o=0;o<s.length;o++)if(d.Helpers.hasProperty(this.nodeAuraState,s[o])&&!this.nodeAuraState[s[o]])return!1;return!0},e.prototype.isLinkVisible=function(t){if(this.allLinkClassesEnabled)return!0;var e=t.className;if(!e)return!0;var i=u.ItemsStyle.getClasses(e);if("any"===this.settings.advanced.showItemsWithClasses){for(var n=!1,s=!1,r=0;r<i.length;r++)if(d.Helpers.hasProperty(this.linkClassState,i[r])){if(this.linkClassState[i[r]]){s=!0;break}n=!0}return s||!n}for(var r=0;r<i.length;r++)if(d.Helpers.hasProperty(this.linkClassState,i[r])&&!this.linkClassState[i[r]])return!1;return!0},e}(d.Legend);t.Legend=c,function(e){var i=function(t){function e(e,i){var n=this;t.call(this,e,i),this.scene=e.scene,this.events=e.events;var s=d.Helpers.createDom("li",null,null,null),r=d.Helpers.createDom("span","DVSL-NC-zoom",null,s);this.handle=d.Helpers.createDom("em",null,null,r),this.mouse=new d.MouseEvents(s,this.scene.settings.advanced.pointer),this.mouse.listen("drag",function(t){return n.zoomMove(t)}),this.mouse.listen("down",function(t){return n.zoomDown(t)}),this.domElement=s}return n(e,t),e.prototype.zoomDown=function(t){t.y<100&&this.zoomMove(t)},e.prototype.zoomMove=function(t){var e=t.y-10;e=Math.max(0,Math.min(80,e)),this.handle.style.top=e+"px";var i=this.getZoomValue(e/80);this.chart.autoZoom.manualZoom(i/this.scene.zoom),this.events.notifySceneChanges({position:!0}),t.consumed=!0},e.prototype.getSliderPosition=function(){var t=this.scene.settings.interaction.zooming.zoomExtent,e=Math.min(t[0],this.chart.autoZoom.minimumAutoZoom),i=t[1],n=Math.log(Math.max(e,Math.min(i,this.scene.zoom)));return e=Math.log(e),i=Math.log(i),1-(n-e)/(i-e)},e.prototype.getZoomValue=function(t){var e=this.scene.settings.interaction.zooming.zoomExtent,i=Math.min(e[0],this.chart.autoZoom.minimumAutoZoom),n=e[1];i=Math.log(i),n=Math.log(n);var s=(1-t)*(n-i)+i;return Math.exp(s)},e.prototype.doAnimations=function(t){var e=this.getSliderPosition();this.handle.style.top=80*e+"px"},e.prototype.remove=function(){this.mouse.remove()},e}(d.Bar.Item);e.ZoomControl=i,d.Bar.ToolbarItemNames.zoomControl=d.Bar.ToolbarItemNames.zoomcontrol=function(e,i){return new t.Bar.ZoomControl(e,i)},d.Bar.ToolbarItemNames.rearrange=function(t,e){var i=t.settings.localization.toolbar;e.label=e.label||i.rearrangeButton,e.title=e.title||i.rearrangeTitle,e.cssClass=e.cssClass||"DVSL-bar-btn-rearrange";var n=e.onClick;return e.onClick=function(e,i){t.resetLayout(),n&&n(e,i)},new d.Bar.Button(t,e)},d.Bar.ToolbarItemNames.freeze=function(t,e){var i=t.settings.localization.toolbar;return new d.Bar.ToggleButton(t,e,{labelDisabled:e.label||i.freezeButton,cssClassEnabled:"DVSL-bar-btn-lock-all-active",cssClassDisabled:e.cssClass||"DVSL-bar-btn-lock-all",titleEnabled:i.unfreezeTitle,titleDisabled:i.freezeTitle,getChartState:function(){return t.isLayoutFrozen},onEnable:function(){return t.freezeLayout()},onDisable:function(){return t.unfreezeLayout()}})},d.Bar.ToolbarItemNames.fit=function(t,e){var i=t.settings.localization.toolbar;return new d.Bar.ToggleButton(t,e,{labelDisabled:e.label||i.fitButton,cssClassEnabled:"DVSL-bar-btn-fit-active",cssClassDisabled:e.cssClass||"DVSL-bar-btn-fit",titleDisabled:e.title||i.fitTitle,getChartState:function(){return"overview"===t.scene.autoZoomMode},onEnable:function(){return t.autoZoom.setZoom("overview")},onDisable:function(){return t.autoZoom.setZoom("auto")}})};var s=function(t){function e(){t.call(this),this.zoomControl=!0,this.enabled=!0,this.side="bottom",this.align="left",this.showLabels=!1,this.fullscreen=!0,this.items=[new d.SettingsToolbarItem("fit"),new d.SettingsToolbarItem("rearrange"),new d.SettingsToolbarItem("freeze"),new d.SettingsToolbarItem("back"),new d.SettingsToolbarItem("fullscreen"),new d.SettingsToolbarItem("zoomControl","bottom","left")]}return n(e,t),e}(d.SettingsToolbar);e.SettingsToolbar=s;var r=function(t){function e(){t.apply(this,arguments),this.rearrangeButton="Rearrange",this.rearrangeTitle="Rearrange elements",this.freezeButton="Freeze",this.freezeTitle="Lock all",this.unfreezeTitle="Unlock all",this.fitButton="Fit",this.fitTitle="Fit to screen"}return n(e,t),e}(d.SettingsLocalizationToolbar);e.SettingsLocalizationToolbar=r}(s);var p=function(t){function e(i){t.call(this,d.SettingsMapping.NetChartSettings),this.theme=e.FlatTheme,this.data=[],this.area=new g,this.style=new C,this.auras=new u.SettingsNodesLayerAuras,this.layout=new b,this.filters={nodeFilter:null,linkFilter:null,nodeLinksProcessor:null,multilinkProcessor:null},this.interaction=new m,this.navigation=new S,this.toolbar=new s.SettingsToolbar,this.localization=new f,this.legend=new h,this.nodeMenu.buttons=["hide","expand","focus","lock"],this.apply(i),this._initializing=!1}return n(e,t),e.prototype.apply=function(e){return this.applyCompatibility(e,[{from:"navigation.nodeExpansionRadius",to:"navigation.focusNodeExpansionRadius"},{from:"localization.menu.dynaminc",to:"localization.menu.dynamic"}]),t.prototype.apply.call(this,e)},e.FlatTheme={advanced:{themeCSSClass:"DVSL-flat"}},e.DarkTheme={advanced:{themeCSSClass:"DVSL-dark"},area:{style:{fillColor:"rgba(28,26,28,1)"}},title:{margin:15,style:{fillColor:"#A8A7A8"}},legend:{text:{fillColor:"#A8A7A8"}},style:{node:{fillColor:"gray"},link:{fillColor:"#09c"},linkHovered:{shadowColor:"#09c"},hiddenLinks:{lineColor:"#A8A7A8"},nodeHovered:{shadowColor:"#fff",shadowOffsetY:0,shadowBlur:12},nodeLabel:{padding:4,borderRadius:10,textStyle:{fillColor:"rgba(180,180,180,1)"},backgroundStyle:{fillColor:"rgba(60,60,60,0.8)",lineColor:null}},linkLabel:{padding:.6,backgroundStyle:{lineColor:"#09c",fillColor:"#333333"},textStyle:{fillColor:"#A8A7A8"}},selection:{fillColor:"white",shadowColor:"rgba(255,255,255,0.6)",sizeConstant:4,shadowBlur:24,shadowOffsetY:4}}},e}(u.Settings);t.Settings=p;var f=function(t){function e(){t.apply(this,arguments),this.toolbar=new s.SettingsLocalizationToolbar,this.menu={dynamic:"Pin",fixed:"Unpin",focus:"Focus",unfocus:"Unfocus",collapse:"Collapse",close:"Close",expand:"Expand",hide:"Hide"}}return n(e,t),e}(d.SettingsLocalization);t.SettingsLocalization=f;var g=function(t){function e(){t.apply(this,arguments),this.centerX=.5,this.centerY=.5,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0}return n(e,t),e}(d.SettingsArea);t.SettingsArea=g;var m=function(t){function e(){t.apply(this,arguments),this.zooming=new y,this.selection=new v,this.rotation={fingers:!1}}return n(e,t),e}(u.SettingsInteraction);t.SettingsInteraction=m;var v=function(t){function e(){t.apply(this,arguments),this.dragSelect=!0}return n(e,t),e}(u.SettingsInteractionSelection);t.SettingsInteractionSelection=v;var y=function(t){function e(){t.apply(this,arguments),this.initialAutoZoom="overview",this.zoomExtent=[.5,4],this.autoZoomExtent=[null,1],this.autoZoomSize=.9,this.autoZoomPositionEllasticity=2.5e-7}return n(e,t),e}(u.SettingsInteractionZooming);t.SettingsInteractionZooming=y;var S=function(){function t(){this.mode="showall",this.initialNodes=null,this.focusNodeExpansionRadius=2,this.focusNodeTailExpansionRadius=null,this.focusAutoFadeout=!1,this.numberOfFocusNodes=3,this.minNumberOfFocusNodes=1,this.expandDelay=0,this.expandOnClick=!0,this.autoZoomOnFocus=!1,this.autoUnfocus=!0}return t}();t.SettingsNavigation=S;var b=function(){function t(){this.mode="dynamic",this._currentMode="dynamic",this.nodeSpacing=16,this.rowSpacing=null,this.groupSpacing=null,this.incrementalLayoutMaxTime=300,this.initialLayoutMaxTime=2e3,this.layoutFreezeTimeout=1e4,this.layoutFreezeMinTimeout=1500,this.aspectRatio=!1,this.globalLayoutOnChanges=!0,this.advanced={adaptiveFreezeTreshold:1.2},this.twoRingRadialLayout=!1,this.rotation=0}return t}();t.SettingsLayout=b;var C=function(t){function e(){t.apply(this,arguments),this.dragSelection={fillColor:"rgba(30,160,220,0.15)",lineColor:"#000000",lineWidth:1,lineDash:[1,2]}}return n(e,t),e}(u.SettingsNodesLayerStyle);t.SettingsStyle=C;var x=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(u.Scene);t.Scene=x,function(t){function e(t){if(0===t.children.length)return 0;var e=t.children[0],i=t.children[t.children.length-1];return(e.node.x-e.hWidth+(i.node.x+i.hWidth))/2}function i(t,e,i,n,s){null==e&&(t[0].node.x=0,e=t[0]);for(var r=e.levelIndex+1,a=null===i?t.length:i.levelIndex,o=e.node.x+e.hWidth,l=r;l<a;l++){var h=t[l];o+=h.hWidth+(null==t[l].parent||t[l-1].parent!==t[l].parent?s:n),h.node.x=o,o+=h.hWidth}}var s=function(){function t(t,e,i,n,s){this.to=null,this.K=0,this.len=0,this.strength=0,this.vis=0,this.direction=null,this.to=t,this.vis=n,this.len=i,this.strength=e,this.direction=s}return t}();t.SpringEdge=s;var r=function(){function t(){this.x=0,this.y=0,this.z=0,this.r=1,this.zattr=1,this.repulsiveForceX=0,this.repulsiveForceY=0,this.repulsiveForceZ=0,this.component=0,this.locked=!1,this.offsetX=0,this.offsetY=0,this.minr=0,this.fsum=0,this.edges=[]}return t}();t.SpringNode=r;var a=function(t){function e(){t.apply(this,arguments),this.forceLinkList=null,this.fx=0,this.fy=0,this.sizeEstimate=0,this.left=null,this.right=null,this.leafCount=0,this.leaves=null}return n(e,t),e}(r);t.RepulsiveTreeNode=a;var o=function(){function t(){this.maxLeafCount=5,this.root=null,this.freeNodeRoot=null,this.temperature=0,this.nodeCount=0}return t._swap=function(t,e,i){var n=t[e];t[e]=t[i],t[i]=n},t.prototype.buildTree=function(t){this.iters=0;var e=t.length;this.root&&this.freeNode(this.root),this.root=this.newNode(),e>0&&this.buildTreeRecursive(t,0,e,this.root);for(var i=0;i<=e-1;i++)t[i].repulsiveForceX=0,t[i].repulsiveForceY=0,t[i].repulsiveForceZ=0;this.calculateForces()},t.prototype.freeNode=function(t){t.left&&this.freeNode(t.left),t.right&&this.freeNode(t.right),t.left=this.freeNodeRoot,this.freeNodeRoot=t},t.prototype.newNode=function(){var t;return this.freeNodeRoot?(t=this.freeNodeRoot,this.freeNodeRoot=t.left,t.left=null,t.right=null,t.leafCount=0,t.sizeEstimate=0,t.forceLinkList.length=0):(t=new a,t.forceLinkList=[],t.leaves=new Array(this.maxLeafCount)),t.repulsiveForceX=0,t.repulsiveForceY=0,t.repulsiveForceZ=0,t},t.prototype.addForceLink=function(t,e){t.forceLinkList.push(e)},t.prototype.getMedianX=function(e,i,n){n-=1;for(var s=(i+n)/2|0;;){if(n<=i)return s;if(n===i+1&&e[i].x>e[n].x)return t._swap(e,i,n),s;var r=(i+n)/2|0;e[r].x>e[n].x&&t._swap(e,r,n),e[i].x>e[n].x&&t._swap(e,i,n),e[r].x>e[i].x&&t._swap(e,r,i),t._swap(e,r,i+1);for(var a=i+1,o=n;;){for(;;)if(a+=1,!(e[i].x>e[a].x))break;for(;;)if(o-=1,!(e[o].x>e[i].x))break;if(o<a)break;var l=e[a];e[a]=e[o],e[o]=l}t._swap(e,i,o),o<=s&&(i=a),o>=s&&(n=o-1)}},t.prototype.getMedianY=function(e,i,n){n-=1;for(var s=(i+n)/2|0;;){if(n<=i)return s;if(n===i+1)return e[i].y>e[n].y&&t._swap(e,i,n),s;var r=(i+n)/2|0;e[r].y>e[n].y&&t._swap(e,r,n),e[i].y>e[n].y&&t._swap(e,i,n),e[r].y>e[i].y&&t._swap(e,r,i),t._swap(e,r,i+1);for(var a=i+1,o=n;;){for(;;)if(a+=1,!(e[i].y>e[a].y))break;for(;;)if(o-=1,!(e[o].y>e[i].y))break;if(o<a)break;var l=e[a];e[a]=e[o],e[o]=l}t._swap(e,i,o),o<=s&&(i=a),o>=s&&(n=o-1)}},t.prototype.buildTreeRecursive=function(t,e,i,n){for(var s=t[e].x,r=t[e].y,a=s,o=r,l=e+1;l<=i-1;l++){var h=t[l],u=h.x,c=h.y;u<s&&(s=u),u>a&&(a=u),c<r&&(r=c),c>o&&(o=c)}n.sizeEstimate=Math.max(a-s,o-r),n.sizeEstimate=n.sizeEstimate*n.sizeEstimate+.1,n.sizeEstimate*=2;var d=i-e;if(d<=this.maxLeafCount){n.leafCount=d;for(var u=0,c=0,p=0,f=0,l=0;l<=d-1;l++){var g=t[l+e];u+=g.x,c+=g.y,p+=g.z,f+=g.r,n.leaves[l]=g}var m=1/d;return n.r=f,n.x=u*m,n.y=c*m,void(n.z=p*m)}var v;v=a-s>o-r?this.getMedianX(t,e,i):this.getMedianY(t,e,i),v++;var y=this.newNode();n.left=y,this.buildTreeRecursive(t,e,v,y),y=this.newNode(),n.right=y,this.buildTreeRecursive(t,v,i,y);var S=1/d;n.r=n.right.r+n.left.r,n.x=(n.left.x*(v-e)+n.right.x*(i-v))*S,n.y=(n.left.y*(v-e)+n.right.y*(i-v))*S,n.z=(n.left.z*(v-e)+n.right.z*(i-v))*S},t.prototype.calculateForces=function(){var t=new Array(this.nodeCount),e=0,i=0;for(null!==this.root.left?(t[i]=this.root.left,i++,t[i]=this.root.right,i++,this.addForceLink(this.root.left,this.root.right)):(t[i]=this.root,i++);e<i;){var n=t[e];e++;var s=1/n.r;if(null!==n.left){this.processTreeNode(n,n.left),this.processTreeNode(n,n.right),t[i]=n.left,i++,t[i]=n.right,i++;var r=n.left.r*s,a=n.repulsiveForceX*r,o=n.repulsiveForceY*r;n.left.repulsiveForceX+=a,n.left.repulsiveForceY+=o,n.right.repulsiveForceX+=n.repulsiveForceX-a,n.right.repulsiveForceY+=n.repulsiveForceY-o,this.addForceLink(n.left,n.right)}else for(var l=0;l<=n.leafCount-1;l++){var h=n.leaves[l];this.processLeafNode(n,h);var r=h.r*s;h.repulsiveForceX+=n.repulsiveForceX*r,h.repulsiveForceY+=n.repulsiveForceY*r;for(var u=l+1;u<=n.leafCount-1;u++){var c=n.leaves[u];this.forceBetweenParticles(h,c)}}n.forceLinkList.length=0}},t.prototype.processTreeNode=function(t,e){for(var i=t.forceLinkList.length,n=0;n<=i-1;n++){var s=t.forceLinkList[n],r=e.x-s.x,o=e.y-s.y,l=r*r+o*o,h=e.sizeEstimate;if(s instanceof a&&(h+=s.sizeEstimate),h<l){var u=e.r*s.r/(l*Math.sqrt(l)),c=r*u;e.repulsiveForceX+=c,s.repulsiveForceX-=c;var d=o*u;e.repulsiveForceY+=d,s.repulsiveForceY-=d}else s instanceof a?this.addForceLink(s,e):this.addForceLink(e,s)}},t.prototype.processLeafNode=function(t,e){for(var i=0;i<t.forceLinkList.length;i++){var n=t.forceLinkList[i];if(n instanceof a){var s=e.x-n.x,r=e.y-n.y,o=s*s+r*r,l=n.sizeEstimate;if(l<o){var h=e.r*n.r/(o*Math.sqrt(o)),u=s*h;e.repulsiveForceX+=u,n.repulsiveForceX-=u;var c=r*h;e.repulsiveForceY+=c,n.repulsiveForceY-=c}else this.addForceLink(n,e)}else this.forceBetweenParticles(e,n)}},t.prototype.forceBetweenParticles=function(t,e){var i,n=t.x-e.x,s=t.y-e.y,r=t.z-e.z,a=n*n+s*s+r*r,o=t.r+e.r;i=a*this.temperature<o?.25*this.temperature*Math.sqrt(this.temperature*o):.25*o*o/(a*Math.sqrt(a)),t.repulsiveForceX+=n*i,e.repulsiveForceX-=n*i,t.repulsiveForceY+=s*i,e.repulsiveForceY-=s*i,t.repulsiveForceZ+=r*i,e.repulsiveForceZ-=r*i},t}();t.BHTree=o;var l=function(t){function e(e){t.call(this),this.animationOrder=600,this.paintOrder=10,this.updateOrder=1600,this.chart=e}return n(e,t),e.ConstructLayout=function(t){switch(t.settings.layout.mode){case"dynamic":return new h(t);case"radial":return new u(t);case"hierarchy":return new p(t);case"static":return new f(t);default:return t.error("Unknown layout mode: '"+t.settings.layout.mode+"'"),new h(t)}},e}(d.ChartElement);t.LayoutBase=l;var h=function(t){function e(e){t.call(this,e),this.nodeRepulsionFactor=15,this.componentCenterFactor=.005,this.linkForceFactor=.2,this.nodeDegreeModifier=1.2,this.forceReductionFactor=1,this.stability=1,this.temperature=0,this.unitTemperature=0,this.randomLayoutRadius=0,this.zAxisAttraction=1,this.nodesForRepulsion=null,this.repulsiveForceTree=null,this.globalForceX=0,this.globalForceY=0,this.centerX=0,this.centerY=0,this.aspectRatio=null,this.idleSince=0,this.noMovementSince=0,this.layoutMovement=0,this.random=new d.Random(1),this.nodeCount=0,this.nodes=[],this.forceX=[],this.forceY=[],this.forceZ=[],this.forceSum=[],this.oldForceX=[],this.oldForceY=[],this.oldForceZ=[],this.componentX=[],this.componentY=[],this.componentSum=[],this.componentNodeCount=[],this.nodesForRepulsion=[],this.nodesAspect=1,this.idToIndex={},this.repulsiveForceTree=new o}return n(e,t),e.prototype.updateParams=function(t,e,i){this.aspectRatio=i,this.nodeDegreeModifier=e,this.spacing=t},e.prototype.updateGraph=function(t,e,i){if(i=i||t.length!==this.nodeCount){var n=this.nodes,a=this.oldForceX,o=this.oldForceY,l=this.oldForceZ,h=this.idToIndex;this.nodeCount=t.length,this.oldForceX=new Array(this.nodeCount),this.oldForceY=new Array(this.nodeCount),this.oldForceZ=new Array(this.nodeCount),this.forceX=new Array(this.nodeCount),this.forceY=new Array(this.nodeCount),this.forceZ=new Array(this.nodeCount),this.forceSum=new Array(this.nodeCount),this.nodes=new Array(this.nodeCount),this.idToIndex={};for(var u=0,c=0,p=0;p<t.length;p++){var f=t[p],g=f.id,m=new r;m.edges=[];var v=f.outerBounds.w(),y=f.outerBounds.h();if(y>0&&(u+=y/v,c+=1),this.idToIndex[g]=p,this.nodes[p]=m,h.hasOwnProperty(g)){var S=h[g],b=n[S];m.z=b.z,this.oldForceX[p]=a[S],this.oldForceY[p]=o[S],this.oldForceZ[p]=l[S]}else this.oldForceX[p]=0,this.oldForceY[p]=0,this.oldForceZ[p]=0}this.nodesForRepulsion=this.nodes.slice(),c>0?this.nodesAspect=Math.max(.3,u/c):this.nodesAspect=1}for(var p=0;p<t.length;p++){var f=t[p],C=this.nodes[p],v=f.outerBounds.w(),y=f.outerBounds.h();C.offsetX=f.outerBounds.x0+f.outerBounds.x1,C.offsetY=f.outerBounds.y0+f.outerBounds.y1,C.x=f.x+C.offsetX,C.y=f.y+C.offsetY,C.r=.5*Math.max(1,v),C.minr=Math.max(1,(y+.5*v)/3),C.zattr=f.visibility,C.edges.length=0,C.locked=f.locked,this.forceX[p]=0,this.forceY[p]=0,this.forceZ[p]=0,this.forceSum[p]=0}for(var x={U:"D",null:null,D:"U",L:"R",R:"L"},w=0;w<e.length;w++){var L=e[w],A=L.strength,T=L.length,M=L.visibility,k=this.nodes[this.idToIndex[L.from.id]],P=this.nodes[this.idToIndex[L.to.id]];k&&P?k!==P&&(k.edges.push(new s(P,A,T,M,L.direction)),P.edges.push(new s(k,A,T,M,x[L.direction]))):d.Helpers.log("Layout: missing node for link: "+L.from.id+" "+L.to.id+", topology = "+i)}i&&this.computeComponents();for(var I=this.spacing/2,D=0;D<this.nodes.length;D++){for(var m=this.nodes[D],F=0,N=0;N<m.edges.length;N++){var E=m.edges[N];F+=E.to.edges.length*E.vis}var z=Math.sqrt(F);m.r+=I,m.minr+=I,z>4&&(m.r+=(z-4)*m.r/4*this.nodeDegreeModifier,m.minr+=(z-4)*m.minr/4*this.nodeDegreeModifier)}for(var O=0,H=0,_=0,D=0;D<this.nodes.length;D++){for(var m=this.nodes[D],R=0,N=0;N<m.edges.length;N++){var E=m.edges[N],B=E.to;if(!(m.locked&&B.locked||m===B)){_++;var U=m.minr+B.minr;if(E.len>0){var V=E.len,G=Math.min(20,E.strength);E.len=Math.max(1,U*V),E.K=30*G/E.len,R+=E.K,O+=E.len}else{var G=E.strength;E.K=G,R+=E.K,O+=U}}}m.fsum=R,H+=m.r*m.r}_>0?(this.randomLayoutRadius=Math.max(1,O/10),this.unitTemperature=O/_/50):(this.randomLayoutRadius=Math.max(1,Math.sqrt(H)),this.unitTemperature=1)},e.prototype.computeComponents=function(){this.componentX=[],this.componentY=[],this.componentSum=[],this.componentNodeCount=[];for(var t=new Array(this.nodeCount),e=0;e<this.nodes.length;e++){var i=this.nodes[e];i.component=-1}for(var n=0,e=0;e<this.nodes.length;e++){var i=this.nodes[e];if(!(i.component>=0)){i.component=n;
  41. var s=0,r=0,a=0;for(t[a]=i,a+=1;r<a;){i=t[r],r+=1,s+=1;for(var o=0;o<i.edges.length;o++){var l=i.edges[o],h=l.to;h.component===-1&&(h.component=n,t[a]=h,a+=1)}}this.componentNodeCount.push(s),this.componentX.push(0),this.componentY.push(0),this.componentSum.push(0),n+=1}}},e.prototype.updateComponents=function(){for(var t=0;t<=this.componentNodeCount.length-1;t++)this.componentX[t]=0,this.componentY[t]=0,this.componentSum[t]=0;for(var e=0;e<this.nodes.length;e++){var i=this.nodes[e],t=i.component;this.componentX[t]+=i.x*i.r,this.componentY[t]+=i.y*i.r,this.componentSum[t]+=i.r}for(var t=0;t<=this.componentNodeCount.length-1;t++)this.componentX[t]/=this.componentSum[t],this.componentY[t]/=this.componentSum[t]},e.prototype.globalLayout=function(t,e,i){if(!(this.nodeCount<=0)){if(i){if(1===this.nodeCount)return void(t[0].x=t[0].y=0);this.initialRandomLayout()}for(var n=0,s=0;s<this.nodes.length;s++){var r=this.nodes[s];r.locked||n++}var a=Math.floor(Math.sqrt(n)+10),o=2*a;this.forceReductionFactor=1,this.temperature=(2*Math.sqrt(n)+20)*this.unitTemperature,this.zAxisAttraction=.02;for(var l=(new Date).getTime(),h=3;this.temperature>this.unitTemperature&&(o--<=0&&(o=3*a/h++,this.temperature=this.temperature/1.5-.5,this.temperature<20*this.unitTemperature&&(this.zAxisAttraction=1.5*this.zAxisAttraction+.02)),this.randomnodesForRepulsion(),this.repulsiveForceTree.temperature=1.75*this.zAxisAttraction,this.repulsiveForceTree.buildTree(this.nodesForRepulsion),this.moveNodesGlobal(),!((new Date).getTime()>l+e)););i&&this.centerNodes(),this.storeNodes(t)}},e.prototype.initialRandomLayout=function(){for(var t=this.nodeCount,e=new Array(t),i=0;i<=t-1;i++)e[i]=i;for(var i=0;i<=t;i++){var n=Math.floor(this.random.get()*(t-i))+i,s=e[i];e[i]=e[n],e[n]=s}for(var r=this.randomLayoutRadius,a=2*Math.PI/this.nodeCount,o=0;o<this.nodes.length;o++){var l=this.nodes[o];if(this.oldForceX[o]=0,this.oldForceY[o]=0,this.oldForceZ[o]=0,l.z=this.random.get()-.5,!l.locked){var h=r+l.r;l.x=h*Math.cos(e[o]*a),l.y=h*Math.sin(e[o]*a)}}},e.prototype.timedLayout=function(t,e){if(!(this.nodeCount<=1)&&e>0){var i=0;e<.1?(i=2,this.forceReductionFactor=Math.max(.002,Math.min(this.forceReductionFactor,10*e))):i=Math.min(6,Math.round(2+10*e)),this.zAxisAttraction=this.nodeRepulsionFactor/28,this.temperature=this.unitTemperature;for(var n=0;n<=i-1;n++)this.randomnodesForRepulsion(),this.applyAspect(1/this.nodesAspect),this.repulsiveForceTree.temperature=1.75*this.zAxisAttraction,this.repulsiveForceTree.buildTree(this.nodesForRepulsion),this.applyAspect(this.nodesAspect),this.moveNodesIncremental();this.storeNodes(t)}},e.prototype.prepareAspectRatio=function(t){for(var e,i,n,s,r,a,o,l=this.nodes,h=l[0].x,u=l[0].y,c=h,d=u,p=!0,f=1;f<=this.nodeCount-1;f++)h=Math.min(h,l[f].x),c=Math.max(c,l[f].x),u=Math.min(u,l[f].y),d=Math.max(d,l[f].y);var g=(h+c)/2,m=(u+d)/2,v=c-h,y=d-u;return 0===v||0===y?p=!1:(e=Math.sqrt(this.aspectRatio),i=Math.sqrt(v*y),n=i*e/v,s=i/e/y,n=t*n+(1-t),s=t*s+(1-t),r=g-g*n,a=m-m*s,o=1/this.forceReductionFactor),{scaleX:n,incX:r,scaleY:s,incY:a,invForce:o,aspectRatioPrepared:p}},e.prototype.updateAspectRatioNode=function(t,e,i){this.forceX[i]+=(e.x*(t.scaleX-1)+t.incX)*t.invForce,this.forceY[i]+=(e.y*(t.scaleY-1)+t.incY)*t.invForce},e.prototype.updateAspectRatio=function(t){for(var e=this.prepareAspectRatio(t),i=this.nodes,n=0;n<=this.nodeCount-1;n++){var s=i[n];this.updateAspectRatioNode(e,s,n)}},e.prototype.moveNodesGlobal=function(){this.initIteration();var t,e=.5*this.temperature,i=this.forceReductionFactor;this.aspectRatio&&(t=this.prepareAspectRatio(.005),t.aspectRatioPrepared||(this.aspectRatio=null));for(var n=0;n<=this.nodeCount-1;n++){var s=this.nodes[n];if(!s.locked){this.calculateForce(n,.5),this.aspectRatio&&this.updateAspectRatioNode(t,s,n);var r=this.oldForceX[n]=this.forceX[n],a=this.oldForceY[n]=this.forceY[n],o=this.oldForceZ[n]=this.forceZ[n],l=this.forceSum[n];r*=l,a*=l,o*=l;var h=r*r+a*a+o*o;h<this.temperature*this.temperature&&h>.001&&(h=this.temperature/Math.sqrt(h),r*=h,a*=h,o*=h),s.x+=r*i+(this.random.get()-.5)*e,s.y+=a*i+(this.random.get()-.5)*e,s.z+=o*i+(this.random.get()-.5)*e}}},e.prototype.moveNodesIncremental=function(){this.initIteration();for(var t=0;t<=this.nodeCount-1;t++)this.nodes[t].locked||this.calculateForce(t,0);if(this.aspectRatio){var e=Math.min(.4,.5/Math.pow(this.nodeCount,.5));this.updateAspectRatio(e)}for(var i=0,n=0,s=0,r=0,a=new Array(this.nodeCount),t=0;t<=this.nodeCount-1;t++)if(!this.nodes[t].locked){var o=this.forceX[t],l=this.forceY[t],h=this.forceZ[t],u=this.forceSum[t],c=o*o+l*l+h*h;if(c*u*u>this.unitTemperature*this.unitTemperature*.05*.05){r+=c;var d=this.oldForceX[t]*o+this.oldForceY[t]*l+this.oldForceZ[t]*h;s+=d,d>0?n+=d:i-=d}else a[t]=!0}this.stability=(n-5*i)/this.nodeCount,s>1e-7?this.forceReductionFactor*=1+.4/1.618033989:s<-1e-7&&(this.forceReductionFactor/=1.4);for(var p=this.globalForceX/this.nodeCount,f=this.globalForceY/this.nodeCount,t=0;t<=this.nodeCount-1;t++)this.forceX[t]+=p,this.forceY[t]+=f;this.forceReductionFactor=Math.min(1,this.forceReductionFactor),this.forceReductionFactor=Math.max(.002,this.forceReductionFactor);for(var t=0;t<=this.nodeCount-1;t++){var g=this.nodes[t];if(!g.locked&&!a[t]){var u=this.forceSum[t]*this.forceReductionFactor;g.x+=this.forceX[t]*u,g.y+=this.forceY[t]*u,g.z+=this.forceZ[t]*u}this.oldForceX[t]=this.forceX[t],this.oldForceY[t]=this.forceY[t],this.oldForceZ[t]=this.forceZ[t]}},e.prototype.initIteration=function(){for(var t=0,e=0,i=0,n=0;n<this.nodes.length;n++){var s=this.nodes[n];i+=s.r,t+=s.x*s.r,e+=s.y*s.r}this.centerX=t/i,this.centerY=e/i,this.updateComponents(),this.globalForceX=0,this.globalForceY=0},e.prototype.applyAspect=function(t){for(var e=0;e<this.nodes.length;e++){var i=this.nodes[e];i.y*=t}},e.prototype.calculateForce=function(t,e){for(var i=this.nodes[t],n=this.oldForceX[t]*e,s=this.oldForceY[t]*e,r=this.oldForceZ[t]*e,a=0;a<i.edges.length;a++){var o=i.edges[a],l=o.to,h=o.len,u=i.x-i.offsetX-l.x+l.offsetX,c=i.y-i.offsetY-l.y+l.offsetY,d=i.z-l.z;o.direction&&("U"===o.direction?(c-=h,h=0):"D"===o.direction?(c+=h,h=0):"L"===o.direction?(u-=h,h=0):"R"===o.direction&&(u+=h,h=0));var p=Math.sqrt(u*u+c*c+d*d);p<.01&&(p=.01);var f=(h-p)*o.K/p*this.linkForceFactor;n+=f*u,s+=f*c,r+=f*d}n+=i.repulsiveForceX*this.nodeRepulsionFactor,s+=i.repulsiveForceY*this.nodeRepulsionFactor,r+=i.repulsiveForceZ*this.nodeRepulsionFactor;var g=i.zattr*this.zAxisAttraction;r-=i.z*g;var m=i.component,v=this.componentX[m]-this.centerX,y=this.componentY[m]-this.centerY,S=Math.min(10,Math.sqrt(this.componentNodeCount[m])),b=v*S*this.componentCenterFactor,C=y*S*this.componentCenterFactor;if(n-=b,s-=C,this.globalForceX+=b,this.globalForceY+=C,isNaN(n))throw"Internal error: Nan in layout";this.forceX[t]=n,this.forceY[t]=s,this.forceZ[t]=r,i.fsum+g!==0&&(this.forceSum[t]=1/(i.fsum+g))},e.prototype.storeNodes=function(t){for(var e=0;e<=this.nodeCount-1;e++){var i=this.nodes[e];i.locked||(t[e].x=i.x-i.offsetX,t[e].y=i.y-i.offsetY)}},e.prototype.centerNodes=function(){for(var t=new d.Random(243178931),e=this.nodes,i=e[0].x,n=i,s=e[0].y,r=s,a=1;a<=this.nodeCount-1;a++)i=Math.min(i,e[a].x),n=Math.max(n,e[a].x),s=Math.min(s,e[a].y),r=Math.max(r,e[a].y);for(var o=(i+n)/2,l=(s+r)/2,a=0;a<=this.nodeCount-1;a++){var h=e[a];if(h.x-=o,h.y-=l,!h.locked){var u=.3*h.r;h.x+=t.get()*u,h.y+=t.get()*u}}},e.prototype.randomnodesForRepulsion=function(){for(var t=0;t<=this.nodeCount-1;t++){var e=Math.floor(this.random.get()*(this.nodeCount-t))+t,i=this.nodesForRepulsion[t];this.nodesForRepulsion[t]=this.nodesForRepulsion[e],this.nodesForRepulsion[e]=i}},e.prototype.onSceneChange=function(t){var e=t.changes.settingsChanges;(e&&e.layout||t.changes.navigation||this.chart.layer.hasTopologyChanges())&&this.updateBackgroundLinks()},e.prototype.updateBackgroundLinks=function(){for(var t=this.chart.layer,e=t.links(),i=0;i<e.length;i++){var n=e[i];n.background&&(n.background=!1,t.touchLink(n))}},e.prototype.doAnimations=function(t){var e=this.chart.settings.layout,i=this.chart.layer,n=e.layoutFreezeTimeout,s=e.layoutFreezeMinTimeout,r=i.hasTopologyChanges(),a=i.hasStyleChanges(),o=t.dtime;(0===this.idleSince||t.changes.dynamicLayout||r||t.changes.coordinates||t.changes.layout||t.changes.bounds)&&(this.idleSince=t.timeStamp,this.noMovementSince=0);var l=!1,h={},u=!1,c=1;if(r){this.random=new d.Random(1);var p=this.placeNewNodes();h=p.newNodes,u=p.majorChanges,l=!0}else{var f=t.timeStamp-this.idleSince;if(this.layoutMovement<e.advanced.adaptiveFreezeTreshold)if(0!==this.noMovementSince){var g=t.timeStamp-this.noMovementSince;c=Math.min((s-g)/s,c)}else this.noMovementSince=t.timeStamp;c=Math.min((n-f)/s,c)}if(c>0){var m=u?e.initialLayoutMaxTime:e.incrementalLayoutMaxTime;this.layoutMovement=this.doForceLayout(o*c,r||t.changes.layout,a,h,m,u),t.animating=!0,l=!0}l&&(t.changes.position=!0)},e.prototype.placeNewNodes=function(){for(var t={},e=this.chart.layer,i=!1,n=0,s=e.nodes();n<s.length;n++){var r=s[n];null!==r.x&&null!==r.y||(t[r.id]=!0)}for(var n=0,s=e.nodes();n<s.length;n++){var r=s[n],a=1;if(t.hasOwnProperty(r.id)){var o=0,l=0,h=0;a=1;for(var u=void 0,c=0;c<r.links.length;c++){var d=r.links[c],p=d.otherEnd(r);t.hasOwnProperty(p.id)||(u=p,l+=p.x,h+=p.y,o+=1)}var f=void 0,g=void 0;if(o>1)f=l/o,g=h/o,a=.5;else if(1===o){for(var m=0,v=0,y=0,c=0;c<u.links.length;c++){var d=u.links[c],S=d.otherEnd(u);S===r||t.hasOwnProperty(S.id)||(v+=S.x-u.x,y+=S.y-u.y,m+=1)}if(m>0){var b=Math.sqrt(v*v+y*y);if(b>0){var C=1/(b*m);v*=C,y*=C,f=u.x-v*u.hHeight*1.2,g=u.y-y*u.hHeight*1.2,a=.2}else f=u.x,g=u.y}else i=!0,f=u.x,g=u.y}else i=!0,f=0,g=0;r.x=f+(this.random.get()-.5)*a*(r.hHeight+1),r.y=g+(this.random.get()-.5)*a*(r.hHeight+1)}}return{newNodes:t,majorChanges:i}},e.prototype.doForceLayout=function(t,e,i,n,s,r){var a=this.chart.scene,o=this.chart.settings.layout,l=this.chart.layer,h=(a.width+1)/(a.height+1);h>0||(h=null);for(var u=a.settings.layout.aspectRatio?h:null,c=o.nodeSpacing,p=1,f=l.nodes(),g=!1,m=!1,v=0;v<f.length;v++){var y=f[v];y.locked=y.userLock||y.locks>0,m=m||y.locked,g=g||1!==y.visibility}for(var S={},b=[],C=0,x=l.links();C<x.length;C++){var w=x[C],L=w.multiId,A=w.targetStrength,T=w.targetLength,M=w.visibility;if(w.removed||w.added){var k=w.from.links.length>1&&w.to.links.length>1,P=void 0;P=k||w.removed?.2:A,w.added&&(T=.2+(T-.2)*M,A=A*M+P*(1-M))}if(S.hasOwnProperty(L)){var I=S[L];I.strength=Math.max(A,I.strength),I.length=Math.max(T,I.length),I.visibility=Math.max(M,I.visibility)}else{var I={from:w.from,to:w.to,strength:A,length:T,visibility:M,direction:w.direction};S[L]=I,b.push(I)}}if(this.updateParams(c,p,u),r||d.Helpers.hasProperties(n)){for(var v=0;v<f.length;v++){var y=f[v];y.locked=y.locked||!n.hasOwnProperty(y.id)}this.updateGraph(f,b,e),r||a.settings.layout.globalLayoutOnChanges?(this.updateParams(c,p,h),this.globalLayout(f,s,r&&!m),this.updateParams(c,p,u)):this.timedLayout(f,.001*t)}return this.updateGraph(f,b,e),this.timedLayout(f,.001*t),this.stability},e.prototype.resetLayout=function(){this.random=new d.Random(1);for(var t={},e=0,i=this.chart.layer.nodes();e<i.length;e++){var n=i[e];t[n.id]=!0,n.x=0,n.y=0,n.userLock=!1}this.doForceLayout(1,!0,!0,t,1e4,!0),this.idleSince=0},e}(l);t.TimedSpringEmbedder=h;var u=function(t){function e(){t.apply(this,arguments),this.twoCircles=!1}return n(e,t),e.getNodeSize=function(t){return Math.max(t.hHeight,t.hWidth)*t.visibility*2},e.getNodesBounds=function(t){if(t.length<1)return new d.Rect(0,0,0,0);for(var e=t[0],i=new d.Rect(e.x-e.hWidth,e.y-e.hHeight,e.x+e.hWidth,e.y+e.hHeight),n=1;n<t.length;n++)e=t[n],i.addBounds(e.x-e.hWidth,e.y-e.hHeight,e.x+e.hWidth,e.y+e.hHeight);return i},e.prototype.onSceneChange=function(t){var e=t.changes.settingsChanges;(e&&e.layout||t.changes.navigation||this.chart.layer.hasTopologyChanges()||t.changes.highlight)&&this.updateBackgroundLinks(this.chart.getLastFocusNode(),!1)},e.prototype.doAnimations=function(t){var e=t.changes.settingsChanges,i=null!=e&&null!=e.layout||t.changes.navigation||this.chart.layer.hasTopologyChanges(),n=t.changes.position||t.changes.dynamicLayout;(i||n)&&(this.performLayout(i),t.changes.position=!0)},e.prototype.resetLayout=function(){for(var t=this.chart.layer.nodes(),e=0;e<t.length;e++)t[e].userLock=!1;this.performLayout(!0)},e.prototype.performLayout=function(t){var i=[];this.visitedNodes={},this.subnodes={},this.minAngle={},this.radiuses=[];var n=this.chart.getLastFocusNode();if(n){i.push(this.layoutCircle(n,t));for(var s=this.chart.layer.nodes(),r=0;r<s.length;r++){var a=s[r];d.Helpers.hasProperty(this.visitedNodes,a.id)||i.push(this.layoutCircle(a,t))}if(i.length>1)for(var o=2*this.chart.settings.layout.nodeSpacing,l=e.getNodesBounds(i[0]).x1+o,r=1;r<i.length;r++){var h=i[r];if(!(h.length<1)){var u=e.getNodesBounds(h);l-=u.x0;for(var c=0;c<h.length;c++)h[c].x+=l;l+=u.x1+o}}this.updateBackgroundLinks(n,!0)&&this.chart.events.notifySceneChanges({highlight:!0})}},e.prototype.layoutCircle=function(t,e){var i=[];return this.visitedNodes[t.id]=!0,this.computeMaxRadius(t,e),this.placeNodeRec(t,0,.5*-Math.PI,2*Math.PI,i),i},e.prototype.updateBackgroundLinks=function(t,e){if(t){if(this.visitedNodes={},this.updateBackgroudLinkCircle(t,e)&&e)return!0;for(var i=this.chart.layer.nodes(),n=0;n<i.length;n++){var s=i[n];if(!d.Helpers.hasProperty(this.visitedNodes,s.id)&&this.updateBackgroudLinkCircle(s,e)&&e)return!0}return!1}},e.prototype.updateBackgroudLinkCircle=function(t,e){var i=[t];this.visitedNodes[t.id]=!0;for(var n={},s=this.chart.layer;i.length>0;){for(var r=[],a=0;a<i.length;a++)for(var o=i[a],l=0;l<o.links.length;l++){var h=o.links[l];if(!d.Helpers.hasProperty(n,h.id)){n[h.id]=!0;var u=h.otherEnd(o),c=!0;if(d.Helpers.hasProperty(this.visitedNodes,u.id)||(this.visitedNodes[u.id]=!0,r.push(u),c=!1),h.background!==c){if(e)return!0;h.background=c,s.touchLink(h)}}}i=r}return!1},e.prototype.getSubnodes=function(t){var e=t.id;if(this.subnodes[e])return this.subnodes[e];for(var i=[],n=0;n<t.links.length;n++){var s=t.links[n],r=s.otherEnd(t);d.Helpers.hasProperty(this.visitedNodes,r.id)||(i.push(r),this.visitedNodes[r.id]=!0)}return this.subnodes[e]=i,i},e.prototype.computeMaxRadius=function(t,i){var n=this.chart.settings.layout.nodeSpacing,s=0;this.radiuses[0]=s;for(var r=1,a=[t];a.length>0;){var o=void 0;if(1===r&&this.chart.settings.layout.twoRingRadialLayout){t=a[0];var l=e.getNodeSize(t);o=this.getSubnodes(t);for(var h=Math.floor(o.length/2),u=new Array(h),c=new Array(o.length-h),d=0;d<o.length;d++)(d%2===0?c:u)[Math.floor(d/2)]=o[d];for(var p=0,f=0,d=0;d<u.length;d++){var g=u[d],m=e.getNodeSize(g);p=Math.max(p,m),f+=n+m}for(var v=0,y=0,d=0;d<c.length;d++){var g=c[d],m=e.getNodeSize(g);v=Math.max(v,m),y+=n+m}var S=Math.max(.5*(Math.max(p,v)+l)+n,(f+y)/(2*Math.PI)),b=Math.max(.5*(p+l)+n,f/(2*Math.PI)),C=Math.max(b+.5*(v+p),y/(2*Math.PI));i&&(this.twoCircles=C<S),this.twoCircles?(this.radiuses[1]=b,this.radiuses[2]=C):(this.radiuses[1]=S,this.radiuses[2]=S),s=this.radiuses[2],r=3}else{var x=0,w=0;o=[];for(var L=0;L<a.length;L++){t=a[L];for(var l=e.getNodeSize(t),A=0,T=this.getSubnodes(t);A<T.length;A++){var g=T[A],m=e.getNodeSize(g);x=Math.max(x,m+l),w+=n+m,o.push(g)}}var M=s+.5*x+n,k=w/(2*Math.PI),P=Math.max(M,k);this.radiuses[r]=P,s=P,r+=1}a=o}},e.prototype.computeMinAngle=function(t,i){var n=t.id;if(d.Helpers.hasProperty(this.minAngle,n))return this.minAngle[n];for(var s=this.chart.settings.layout.nodeSpacing,r=this.radiuses[i],a=e.getNodeSize(t),o=(a+s)/r,l=0,h=this.chart.settings.layout.twoRingRadialLayout&&1===i?3:i+1,u=0,c=this.getSubnodes(t);u<c.length;u++){var p=c[u];l+=this.computeMinAngle(p,h)}return o=Math.max(o,l),this.minAngle[n]=o,o},e.prototype.placeNodeRec=function(t,e,i,n,s){var r=i+.5*n,a=this.radiuses[e];t.userLock||(t.x=a*Math.cos(r),t.y=a*Math.sin(r),s.push(t));var o=this.getSubnodes(t),l=e+1,h=!1;if(this.chart.settings.layout.twoRingRadialLayout&&(0===e?h=!0:1===e&&(l=3)),o.length>0){for(var u=0,c=0;c<o.length;c++){var d=o[c];u+=this.computeMinAngle(d,h?c%2===0?2:1:l)}for(var p=n/u,f=i,c=0;c<o.length;c++){var d=o[c];h&&(l=c%2===0?2:1);var g=this.computeMinAngle(d,l)*p;this.placeNodeRec(d,l,f,g,s),f+=g}}},e}(l);t.RadialLayout=u;var c=function(){function t(t,e){this.children=[],this.parent=null,this.node=t,this.level=e,this.reset()}return t.prototype.reset=function(){this.hWidth=this.node.hWidth,this.origX=this.node.x,this.shift=0},t}(),p=function(t){function s(){t.apply(this,arguments),this.forest=null}return n(s,t),s.prototype.wrapNodes=function(){for(var t=d.Helpers.clone(this.chart.layer.idToNode),e=[];;){var i=null;for(var n in t)if(d.Helpers.hasProperty(t,n)){i=t[n],delete t[n];break}if(null==i)return e;var s={},r=[new c(i,0)],a=0,o=0;s[i.id]=r[0];for(var l=0;l<r.length;l++)for(var h=r[l],u=h.node,p=0;p<u.links.length;p++){var f=u.links[p];if(f.to===u){var g=void 0;d.Helpers.hasProperty(s,f.from.id)?g=s[f.from.id]:(g=new c(f.from,h.level-1),a===h.level&&a--,s[f.from.id]=g,r.push(g)),null===h.parent&&h.level===g.level+1&&(h.parent=g,g.children.push(h))}else{var g=void 0;d.Helpers.hasProperty(s,f.to.id)?g=s[f.to.id]:(g=new c(f.to,h.level+1),o===h.level&&o++,s[f.to.id]=g,r.push(g)),null===g.parent&&g.level===h.level+1&&(h.children.push(g),g.parent=h)}}for(var m=new Array(o-a+1),l=0;l<m.length;l++)m[l]=[];for(var l=0;l<r.length;l++){var h=r[l];delete t[h.node.id],h.level-=a,null===h.parent&&(h.levelIndex=m[h.level].length,m[h.level].push(h))}for(var v=0;v<m.length;v++)for(var y=m[v],S=0;S<y.length;S++)for(var b=y[S],C=0;C<b.children.length;C++){var x=v+1,w=b.children[C];w.level=x,w.levelIndex=m[x].length,m[x].push(w)}e.push({levels:m,levelStarts:new Array(m.length),levelEnds:new Array(m.length)})}},s.prototype.layoutNodes=function(t){var n=t.levels,s=this.chart.settings.layout,r=s.nodeSpacing,a=null===s.groupSpacing?2*r:s.groupSpacing,o=null===s.rowSpacing?r:s.rowSpacing;i(n[n.length-1],null,null,r,a);for(var l=n.length-2;l>=0;l--){for(var h=n[l],u=null,c=void 0,d=0;d<h.length;d++)if(h[d].children.length>0){c=h[d];break}if(c.node.x=e(c),c.levelIndex>0){i(h,null,c,r,a);var p=h[c.levelIndex-1],f=p.node.x+p.hWidth+r+c.hWidth;f>c.node.x&&(c.shift=f-c.node.x,c.node.x+=c.shift)}for(;;){u=c,c=null;for(var d=u.levelIndex+1;d<h.length;d++)if(h[d].children.length>0){c=h[d];break}if(null===c)break;c.node.x=e(c)+u.shift,c.shift=u.shift;for(var g=0,m=0,d=u.levelIndex+1;d<c.levelIndex;d++)g+=2*h[d].hWidth,null!=h[d].parent&&h[d].parent===h[d-1].parent||m++;null!=c.parent&&c.parent===h[c.levelIndex-1].parent||m++;var v=c.levelIndex-u.levelIndex,y=u.hWidth+c.hWidth+g+(v-m)*r+m*a,S=c.node.x-u.node.x;if(y>S){var b=y-S;c.node.x+=b,c.shift+=b,S=y,i(h,u,c,r,a)}else if(0===m){var C=(S-u.hWidth-c.hWidth-g)/(c.levelIndex-u.levelIndex);i(h,u,c,C,0)}else{var x=(S-u.hWidth-c.hWidth-g-(v-m)*r)/m;i(h,u,c,r,x)}}i(h,u,null,r,a)}for(var w=0,l=0;l<n.length;l++){for(var h=n[l],L=0,d=0;d<h.length;d++)L=Math.max(L,2*h[d].node.hHeight);w+=L/2,t.levelStarts[l]=h[0].node.x-h[0].hWidth,t.levelEnds[l]=h[h.length-1].node.x+h[h.length-1].hWidth;for(var d=0;d<h.length;d++){var A=h[d];A.node.userLock?A.node.x=A.origX:A.node.y=w;for(var T=0;T<A.children.length;T++){var M=A.children[T];M.node.x+=A.shift,M.shift+=A.shift}}w+=L/2+o}},s.prototype.layoutTrees=function(t){var e=this.chart.settings.layout;t.sort(function(t,e){var i=e.levels.length-t.levels.length;return 0!==i?i:t.levels[0][0].node.id.localeCompare(e.levels[0][0].node.id)});for(var i=t[0].levelEnds.slice(),n=null==e.groupSpacing?4*e.nodeSpacing:2*e.groupSpacing,s=1;s<t.length;s++){for(var r=t[s],a=0,o=0;o<r.levels.length;o++){var l=i[o]+n,h=a+r.levelStarts[o];h<l&&(a+=l-h)}for(var o=0;o<r.levels.length;o++){for(var u=r.levels[o],c=0;c<u.length;c++){var d=u[c];d.node.userLock||(d.node.x+=a)}i[o]=a+r.levelEnds[o]}}var p=(e.rotation||0)%360;if(0!==p){p=p*Math.PI/180;for(var f=Math.sin(p),g=Math.cos(p),m=this.chart.layer.nodes(),s=0;s<m.length;s++){var d=m[s];if(!d.userLock){var c=d.x,o=d.y;d.x=c*g-o*f,d.y=c*f+o*g}}}},s.prototype.performLayout=function(t){if(t||null==this.forest)this.forest=this.wrapNodes();else for(var e=0;e<this.forest.length;e++)for(var i=this.forest[e],n=0;n<i.levels.length;n++)for(var s=i.levels[n],r=0;r<s.length;r++)s[r].reset();if(!(this.forest.length<1)){for(var e=0;e<this.forest.length;e++)this.layoutNodes(this.forest[e]);this.layoutTrees(this.forest),this.setBackgroundFlag(!0)&&this.chart.events.notifySceneChanges({highlight:!0})}},s.prototype.setBackgroundFlag=function(t){for(var e=d.Helpers.clone(this.chart.layer.idToNode);;){var i=null;for(var n in e)if(d.Helpers.hasProperty(e,n)){i=e[n],delete e[n];break}if(null==i)return!1;var s={},r={},a=[{node:i,level:0,hasParent:!1}],o=this.chart.layer;s[i.id]=a[0];for(var l=0;l<a.length;l++)for(var h=a[l],u=h.node,c=0;c<u.links.length;c++){var p=u.links[c];if(!d.Helpers.hasProperty(r,p.id)){r[p.id]=!0;var f=!0;if(p.to===u){var g=void 0;d.Helpers.hasProperty(s,p.from.id)?g=s[p.from.id]:(g={node:p.from,level:h.level-1,hasParent:!1},delete e[g.node.id],s[p.from.id]=g,a.push(g)),h.hasParent||h.level!==g.level+1||(h.hasParent=!0,f=!1)}else{var g=void 0;d.Helpers.hasProperty(s,p.to.id)?g=s[p.to.id]:(g={node:p.to,level:h.level+1,hasParent:!1},delete e[g.node.id],s[p.to.id]=g,a.push(g)),g.hasParent||g.level!==h.level+1||(g.hasParent=!0,f=!1)}if(p.background!==f){if(t)return!0;p.background=f,o.touchLink(p)}}}}},s.prototype.onSceneChange=function(t){var e=t.changes.settingsChanges;(e&&e.layout||t.changes.navigation||this.chart.layer.hasTopologyChanges()||t.changes.highlight)&&this.setBackgroundFlag(!1)},s.prototype.doAnimations=function(t){var e=t.changes.settingsChanges,i=this.chart.layer.hasTopologyChanges();(e&&e.layout||t.changes.navigation||i||t.changes.position||t.changes.dynamicLayout)&&(this.performLayout(i),t.changes.position=!0)},s.prototype.resetLayout=function(){for(var t=this.chart.layer.nodes(),e=0;e<t.length;e++)t[e].userLock=!1;this.performLayout(!1)},s}(l);t.HierarchyLayout=p;var f=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.resetLayout=function(){for(var t=this.chart.layer.nodes(),e=0;e<t.length;e++){var i=t[e],n=i.data;d.Helpers.isNumber(n.x)&&(i.x=n.x),d.Helpers.isNumber(n.y)&&(i.y=n.y),i.userLock=!1}},e}(l);t.StaticLayout=f}(i);var w=function(t){function e(e){t.call(this),this.animationOrder=500,this.paintOrder=35,this.updateOrder=1800,this.chart=e,this.scene=e.scene,this.events=e.events}return n(e,t),e.prototype.doAnimations=function(t){var e=this.chart.layer;e.updateStyle(t),e.postprocessStyle(t)},e.prototype.paintScene=function(t){d.Graphics.pushClip(t,this.scene.x0,this.scene.y0,this.scene.width,this.scene.height);var e=this.chart.layer;e.setBounds(this.scene.x0,this.scene.y0,this.scene.x0+this.scene.width,this.scene.y0+this.scene.height),e.paint(t),d.Graphics.popClip(t)},e.prototype.paintLinks=function(t,e,i,n){this.chart.layer.paintLinksImpl(t,e,i,n)},e.prototype.paintNodes=function(t,e,i,n){this.chart.layer.paintNodesImpl(t,e,i,n)},e.prototype.findObjectAt=function(t,e,i){return this.chart.layer.findObjectAt(t,e,i)},e}(d.ChartElement);t.Renderer=w;var L=function(t){function e(){t.apply(this,arguments),this.dataFunction=null,this.preloaded=null}return n(e,t),e}(u.SettingsData);t.SettingsData=L;var A=function(t){function e(e,i){t.call(this,e,i),this.nodes={},this.links={},this.nodeToLinks={},this.pendingNodes={},this.requestedNodes={},this.pendingAllData=!1,this.requestedAllData=!1,this.nextLinkId=0,this.hasAllData=!this.hasDataFunc()}return n(e,t),e.otherEnd=function(t,e){return e===t.from?t.to:e===t.to?t.from:null},e.multiLinkId=function(t){return t.from<t.to?t.from+d.Helpers.SeparatorChar+t.to:t.to+d.Helpers.SeparatorChar+t.from},e.prototype.buildRequest=function(){if(this.pendingAllData)return this.requestedAllData?null:(this.requestedAllData=!0,{nodes:[]});var t=[];for(var e in this.pendingNodes)if(t.push(e),delete this.pendingNodes[e],this.requestedNodes[e]=!0,t.length>=this.dataSettings.requestMaxUnits)break;return 0===t.length?null:{nodes:t}},e.prototype.dataFunc=function(t,e,i){var n=this.dataSettings;if(n.dataFunction)n.dataFunction(t.nodes||null,e,i);else if(n.url){var s=[];if(t.nodes){for(var r="",a=0;a<t.nodes.length;a++)r.length&&(r+=","),r+=encodeURIComponent(t.nodes[a]);s.push(["nodes",r])}d.Data.doRequest(n.url,n,s,e,i)}else i({error:"Chart configuration does not define data retrieval function"})},e.prototype.verifyData=function(t,e){d.Helpers.hasProperty(e,"links")||(e.links=[]),d.Helpers.hasProperty(e,"nodes")||(e.nodes=[]);var i=!0;if(!Array.isArray(e.nodes)){var n=e.nodes;e.nodes=[];for(var s=Object.keys(n),r=0;r<s.length;r++){var a=s[r],o=n[a];o.id=a,e.nodes.push(o)}}if(!Array.isArray(e.links)){var l=e.links;e.links=[];for(var s=Object.keys(l),r=0;r<s.length;r++){var a=s[r],h=l[a];h.id=a,e.links.push(h)}}for(var u={},c=!t&&!this.hasDataFunc(),r=0;r<e.nodes.length;r++){var o=e.nodes[r];null==o.id?(o.id=d.Helpers.getIdentifierStr(),d.Helpers.warn("Data response: `id` property is mandatory for all nodes in the NetChart data object.",null,!0)):o.id=o.id.toString(),u.hasOwnProperty(o.id)&&d.Helpers.warn('Data response: Multiple nodes with the same ID: "'+o.id+'". Data will be merged.'),u[o.id]=!0,c?o.loaded=!0:d.Helpers.hasProperty(o,"loaded")?o.loaded=!!o.loaded:(d.Helpers.warn('Data response: Node with ID "'+o.id+'" does not have the "loaded" flag. Assuming "false".'),o.loaded=!1),d.Helpers.hasProperty(o,"className")&&null!=o.className&&!d.Helpers.isString(o.className)&&(d.Helpers.warn('Data response: Node property "className" must be a string. Node ID: "'+o.id+'".'),o.className=o.className.toString()),d.Helpers.hasProperty(o,"error")&&null!=o.error&&!d.Helpers.isString(o.error)&&(d.Helpers.warn('Data response: Node property "error" must be a string. Node ID: "'+o.id+'".'),o.error=o.error.toString()),d.Helpers.hasProperty(o,"x")&&null!=o.x&&!d.Helpers.isNumber(o.x)&&(d.Helpers.warn('Data response: Node property "x" must be a number. Node ID: "'+o.id+'".'),o.x=d.Helpers.tryParseFloat(o.x,null)),d.Helpers.hasProperty(o,"y")&&null!=o.y&&!d.Helpers.isNumber(o.y)&&(d.Helpers.warn('Data response: Node property "y" must be a number. Node ID: "'+o.id+'".'),o.y=d.Helpers.tryParseFloat(o.y,null))}for(var p={},r=0;r<e.links.length;r++){var h=e.links[r];null!=h.from?(h.from=h.from.toString(),null!=h.to?(h.to=h.to.toString(),null==h.id?(h.id=d.Helpers.SeparatorChar+this.nextLinkId,this.nextLinkId+=1):h.id=h.id.toString(),p.hasOwnProperty(h.id)&&d.Helpers.warn('Data response: Multiple links with the same ID: "'+h.id+'". Data will be merged.'),p[h.id]=!0,d.Helpers.hasProperty(h,"className")&&null!=h.className&&!d.Helpers.isString(h.className)&&(d.Helpers.warn('Data response: Link property "className" must be a string. Link ID: "'+h.id+'".'),h.className=h.className.toString()),d.Helpers.hasProperty(h,"error")&&null!=h.error&&!d.Helpers.isString(h.error)&&(d.Helpers.warn('Data response: Link property "error" must be a string. Link ID: "'+h.id+'".'),h.error=h.error.toString()),d.Helpers.hasProperty(this.nodes,h.from)||d.Helpers.hasProperty(u,h.from)||e.nodes.push({id:h.from,loaded:c}),d.Helpers.hasProperty(this.nodes,h.to)||d.Helpers.hasProperty(u,h.to)||e.nodes.push({id:h.to,loaded:c})):d.Helpers.warn('Data response: Link missing property "to" and will be ignored. Link id: "'+h.id+'"')):d.Helpers.warn('Data response: Link missing property "from" and will be ignored. Link id: "'+h.id+'"')}if(t?this.chart.log("Got "+e.nodes.length+" nodes on ["+t.nodes.join(", ")+"]"):this.chart.log("Got "+e.nodes.length+" nodes on all nodes"),t&&t.nodes.length>0){for(var f=!1,g=!1,m=0;m<e.nodes.length;m++){var o=e.nodes[m];t.nodes.indexOf(o.id)>-1&&(f=!0,g=g||o.loaded)}f?g||(this.chart.error("Data response: loaded field was not set on any of the requested nodes!"),i=!1):(this.chart.error("Data response: Results set did not contain any of requested nodes!",t.nodes),i=!1)}return i},e.prototype.addVerifiedData=function(t,e){for(var i=this.updateGraph(e),n=0;n<e.nodes.length;n++){var s=e.nodes[n];(s.loaded||s.error)&&(delete this.requestedNodes[s.id],delete this.pendingNodes[s.id])}if(t)if(0===t.nodes.length)this.hasAllData=!0,this.pendingAllData=!1,this.requestedAllData=!1;else for(var n=0;n<t.nodes.length;n++){var r=t.nodes[n];this.requestedNodes[r]&&(this.pendingNodes[r]=!0,delete this.requestedNodes[r])}return i},e.prototype.requestFailedPermanently=function(t){if(t.nodes){for(var e=[],i=0;i<t.nodes.length;i++){var n=t.nodes[i];e.push({id:n,error:"Bad response",loaded:!0})}var s=this.addVerifiedData(t,{nodes:e,links:[]});s.dataArrived||(s.dataArrived={}),s.dataArrived[this.dataSettings.id]=!0,this.chart.events.notifySceneChanges(s)}this.chart.error("Failed data request, giving up on nodes: ",t.nodes)},e.prototype.removeData=function(t){var e={},i=[];if(t.nodes)for(var n=0;n<t.nodes.length;n++){var s=t.nodes[n];e[s.id]=!0,i=this.removeNode(s.id,i)}if(t.links)for(var r=0;r<t.links.length;r++){var a=t.links[r],o=this.links[a.id];o&&(e[o.from]=!0,e[o.to]=!0,this.removeLink(o))}for(var l=0;l<i.length;l++){var o=i[l];e[o.from]=!0,e[o.to]=!0,this.removeLink(o)}return{netChartDataNodes:e}},e.prototype.exportData=function(){var t=[],e=[];for(var i in this.nodes){var n=this.nodes[i];t.push(n)}for(var i in this.links){var s=this.links[i];e.push(s)}return{nodes:t,links:e}},e.prototype.applyPreloadedData=function(){this.dataSettings.randomNodes>0?this.addData(this.genRandomGraph(this.dataSettings)):t.prototype.applyPreloadedData.call(this)},e.prototype.getNode=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=null);var n=d.Helpers.hasProperty(this.nodes,t)?this.nodes[t]:null;if(i&&(i.loading=!1),n){if(this.settings.legend.enabled&&!this.chart.legend.isNodeVisible(n))return null;var s=this.settings.filters.nodeFilter;if(s){var r=d.Helpers.hasProperty(this.nodeToLinks,t)?this.nodeToLinks[t]:null;if(!s(n,r))return null}!n.loaded&&e&&(i&&(i.loading=!0),this.requestNodeData(t))}else e?(i&&(i.loading=!0),this.requestNodeData(t)):i&&(i.loading=this.isNodeLoading(t));return n},e.prototype.isNodeLoading=function(t){return this.pendingAllData||this.requestedAllData||d.Helpers.hasProperty(this.pendingNodes,t)||d.Helpers.hasProperty(this.requestedNodes,t)},e.prototype.getLinks=function(t,i){void 0===i&&(i=!0);var n=this.settings.legend.enabled,s=d.Helpers.hasProperty(this.nodes,t)?this.nodes[t]:null;if(!s)return i&&this.requestNodeData(t),[];if(n&&!this.chart.legend.isNodeVisible(s))return[];var r=d.Helpers.hasProperty(this.nodeToLinks,t)?this.nodeToLinks[t]:[],a=this.settings.filters.nodeFilter;if(a&&!a(s,r))return[];!s.loaded&&i&&this.requestNodeData(t);var o=this.settings.filters.linkFilter,l=this.settings.filters.nodeLinksProcessor,h=this.settings.filters.multilinkProcessor,u={};if(u[t]=!0,r.length>0&&(a||o||n)){for(var c=new Array(r.length),p=0,f=0;f<r.length;f++){var g=r[f],m=e.otherEnd(g,t);if(null!=m)if(d.Helpers.hasProperty(this.nodes,m)){var v=this.nodes[m];if(a||n)if(d.Helpers.hasProperty(u,m)){if(!u[m])continue}else{var y=!n||this.chart.legend.isNodeVisible(v);if(y&&a&&(y=a(v,d.Helpers.hasProperty(this.nodeToLinks,m)?this.nodeToLinks[m]:null)),u[m]=y,!y)continue}if(o||n){var S=void 0,b=void 0;if(g.from===t?(S=s,b=v):(S=v,b=s),n&&!this.chart.legend.isLinkVisible(g))continue;if(o&&!o(g,S,b))continue}c[p++]=g}else d.Helpers.error("Invalid situation: link data found from '"+t+"' to '"+m+"', but no node data found for '"+m+"'");else d.Helpers.error("Invalid situation: link data found from '"+g.from+"' to '"+g.to+"' in the collection of links for '"+t+"'")}c.length=p,r=c}if(l&&(r=l(s,r)),!Array.isArray(r))return[];if(h){for(var C={},x=!1,f=0;f<r.length;f++){var w=e.otherEnd(r[f],t);if(w){if(d.Helpers.hasProperty(C,w)){x=!0;break}C[w]=!0}}if(x){for(var c=[],L={},A={},f=0;f<r.length;f++){var T=r[f],M=e.multiLinkId(T);L.hasOwnProperty(M)?A.hasOwnProperty(M)?A[M].push(T):A[M]=[L[M],T]:L[M]=T}for(var f=0;f<r.length;f++){var T=r[f],M=e.multiLinkId(T);A.hasOwnProperty(M)||c.push(T)}for(var k=Object.keys(A),f=0;f<k.length;f++){var P=A[k[f]],T=P[0],I=h(P,this.nodes[T.from],this.nodes[T.to]);
  42. Array.isArray(I)?c=c.concat(I):I&&c.push(I)}r=c}}return r},e.prototype.getAllNodes=function(t){void 0===t&&(t=!0);for(var e=this.settings.filters.nodeFilter,i=Object.keys(this.nodes),n=new Array(i.length),s=0,r=0;r<i.length;r++){var a=i[r],o=this.nodes[a];this.settings.legend.enabled&&!this.chart.legend.isNodeVisible(o)||e&&!e(o,d.Helpers.hasProperty(this.nodeToLinks,a)?this.nodeToLinks[a]:null)||(n[s++]=o)}return n.length=s,this.hasAllData||this.pendingAllData||!t||(this.pendingAllData=!0,this.scheduleRequests()),n},e.prototype.requestNodeData=function(t){return this.hasDataFunc()?void(this.pendingNodes.hasOwnProperty(t)||this.requestedNodes.hasOwnProperty(t)||(this.pendingNodes[t]=!0,this.scheduleRequests())):void this.chart.error("Cannot request node data! Please specify either data function or data URL in the settings!")},e.prototype.hasDataFunc=function(){return null!=this.dataSettings.dataFunction||null!=this.dataSettings.url},e.prototype.updateGraph=function(t){for(var e={},i=0;i<t.nodes.length;i++){var n=t.nodes[i];if(d.Helpers.hasProperty(this.nodes,n.id)){var s=this.nodes[n.id];n.error||s.loaded&&!n.loaded||(d.Helpers.extendDataItem(s,n),s.resetCoordinates=(null!=n.x||null!=n.y)&&null!=s.x&&null!=s.y,e[n.id]=!0)}else{var r=d.Helpers.extendDataItem({},n);r.resetCoordinates=null!=r.x&&null!=r.y,this.nodes[n.id]=r,this.nodeToLinks[n.id]=[],e[n.id]=!0}}for(var a=0;a<t.links.length;a++){var o=t.links[a];if(d.Helpers.hasProperty(this.links,o.id)){var s=this.links[o.id];if(o.from&&s.from!==o.from||o.to&&s.to!==o.to){this.chart.error('Changing link from/to not supported. Link ignored. Link ID: "'+o.id+'"');continue}d.Helpers.extendDataItem(s,o)}else{if(!o.from||!o.to)continue;this.links[o.id]=o,this.nodeToLinks[o.from].push(o),o.from!==o.to&&this.nodeToLinks[o.to].push(o)}e[o.from]=!0,e[o.to]=!0}return{netChartDataNodes:e}},e.prototype.removeNode=function(t,e){return delete this.pendingNodes[t],delete this.requestedNodes[t],d.Helpers.hasProperty(this.nodes,t)&&delete this.nodes[t],d.Helpers.hasProperty(this.nodeToLinks,t)&&(e=e.concat(this.nodeToLinks[t]),delete this.nodeToLinks[t]),e},e.prototype.removeLink=function(t){delete this.links[t.id],d.Helpers.hasProperty(this.nodeToLinks,t.from)&&d.Helpers.removeFromArrayHasty(this.nodeToLinks[t.from],t),d.Helpers.hasProperty(this.nodeToLinks,t.to)&&d.Helpers.removeFromArrayHasty(this.nodeToLinks[t.to],t)},e.prototype.genRandomGraph=function(t){var e,i=t.randomNodes,n=t.randomLinks;e="grid"===t.random?this.genRandomGrid(i,t.randomGridLinkProbability):"tree"===t.random?this.genRandomTree(i,t.randomTreeDensity):this.genRandomUniform(i,n);for(var s=0;s<e.nodes.length;s++){var r=e.nodes[s];r.style={label:"Node "+r.id}}for(var a=0;a<e.links.length;a++){var o=e.links[a];o.style={label:"Link "+o.id}}return e},e.prototype.genRandomGrid=function(t,e){for(var i=[],n=[],s=0;s<=t-1;s++){var r={id:"n"+s,loaded:!0};i.push(r)}for(var a=Math.ceil(Math.sqrt(t)),o=new d.Random(32131),l=0;l<=a-1;l++)for(var h=0;h<=a-1;h++){var u=h+l*a;u>=t||(h>0&&o.get()<=e&&n.push({from:"n"+u,to:"n"+(u-1)}),l>0&&o.get()<=e&&n.push({from:"n"+u,to:"n"+(u-a)}))}for(var c=0;c<n.length;c++){var p=n[c];p.id=""+c}return{nodes:i,links:n}},e.prototype.genRandomUniform=function(t,e){for(var i=new d.Random(32131),n=[],s=[],r=0;r<t;r++){var a={id:"n"+r,loaded:!0};if(n.length>0){var o={id:"l"+r,from:a.id,to:n[i.get()*n.length|0].id};s.push(o)}n.push(a)}for(var r=s.length;r<=e-1;r++){var o={id:"l"+(r+1),from:n[i.get()*n.length|0].id,to:n[i.get()*n.length|0].id};s.push(o)}return{nodes:n,links:s}},e.prototype.genRandomTree=function(t,e){for(var i=new d.Random(31927832),n={id:"n0",loaded:!0},s=[n],r=[n],a=[];r.length<t;){var o=i.getArrayElement(s);d.Helpers.removeFromArrayHasty(s,o);for(var l=Math.max(1,Math.ceil(i.get()*e)),h=0;h<l;h++){var u={id:"n"+r.length,loaded:!0},c={id:"l"+r.length,from:o.id,to:u.id};a.push(c),r.push(u),s.push(u)}}return{nodes:r,links:a}},e}(d.Data);t.Data=A;var T=function(){function t(t){this.restoredState={},this.chart=t}return t.prototype.exportCoordinates=function(t){for(var e=this.chart.layer.idToNode,i=0;i<t.length;i++){var n=t[i],s=n.id;if(d.Helpers.hasProperty(e,s)){var r=e[s];r.removed||(n.x=r.x,n.y=r.y)}}},t.prototype.save=function(){for(var t={},e=this.chart.layer.idToNode,i=Object.keys(e),n=0;n<i.length;n++){var s=e[i[n]];s.removed||(t[s.id]={x:s.x,y:s.y,r:s.hHeight,w:s.hWidth})}return t},t.prototype.restore=function(t){this.restoredState={};for(var e=this.chart.layer.idToNode,i=Object.keys(t),n=0;n<i.length;n++){var s=i[n],r=t[s];if(d.Helpers.hasProperty(e,s)){var a=e[s];a.x=r.x,a.y=r.y,a.hHeight=r.r,a.hWidth=r.w?r.w:r.r}else this.restoredState[s]=r}},t.prototype.applyRestoredCoordinates=function(t){if(d.Helpers.hasProperty(this.restoredState,t.id)){var e=this.restoredState[t.id];delete this.restoredState[t.id],t.x=e.x,t.y=e.y,t.hHeight=e.r,t.hWidth=e.w?e.w:e.r}},t.prototype.lockNode=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null);var n=this.chart.layer.idToNode;if(d.Helpers.hasProperty(n,t)){var s=n[t];s.userLock=!0,null!==e&&null!==i&&(s.x=e,s.y=i),this.chart.layer.touchNode(s)}else this.chart.error("Locking nonexistant node: "+t)},t.prototype.unlockNode=function(t){var e=this.chart.layer.idToNode;if(d.Helpers.hasProperty(e,t)){var i=e[t];i.userLock&&(i.userLock=!1,this.chart.layer.touchNode(i),this.chart.events.notifySceneChanges({dynamicLayout:!0}))}else this.chart.error("Unlocking nonexistant node: "+t)},t.prototype.exportData=function(){for(var t=this.chart.layer.idToNode,e=Object.keys(t),i=new Array(e.length),n=0,s=0;s<e.length;s++){var r=t[e[s]];r.removed||(i[n++]=r.data)}i.length=n;var a=this.chart.layer.idToLink;e=Object.keys(a);var o=new Array(e.length);n=0;for(var s=0;s<e.length;s++){var l=a[e[s]];l.removed||(o[n++]=l.data)}return o.length=n,{nodes:i,links:o}},t}();t.Graph=T;var M=function(t){function e(e){t.call(this),this.numPointers=0,this.resetZoom=!1,this.minimumAutoZoom=1/0,this.animationOrder=700,this.paintOrder=20,this.updateOrder=2e3,this.chart=e,this.scene=e.scene,this.layer=e.layer,this.events=e.events,this.settings=this.scene.settings;var i=this._getInertiaAccelerations();this.inertiaX=new d.Inertia(i.x,0),this.inertiaY=new d.Inertia(i.y,0),this.inertiaZ=new d.Inertia(i.z,1)}return n(e,t),e.prototype.setZoom=function(t,e){void 0===e&&(e=!0);var i=1+this.scene.settings.interaction.zooming.sensitivity;if("auto"===t)this.scene.autoZoomMode=!0,this.autoZoom(e);else if("overview"===t)this.scene.autoZoomMode="overview",this.autoZoom(e);else{var n=void 0;"in"===t?n=1/this.inertiaZ.getTargetValue()*i:"out"===t?n=1/this.inertiaZ.getTargetValue()/i:null===(n=d.Helpers.tryParseFloat(t,null))&&(this.chart.error("Invalid zoom value: "+t),n=1/this.inertiaZ.getTargetValue()),this.manualZoom(n/this.scene.zoom,void 0,void 0,e)}this.chart.events.notifySceneChanges({position:!0})},e.prototype.previewPointerDown=function(){this.numPointers+=1},e.prototype.previewPointerUp=function(){this.numPointers-=1},e.prototype.previewPointerCancel=function(){this.numPointers-=1},e.prototype.doAnimations=function(t){var e=t.changes.settingsChanges;if(e&&e.interaction&&e.interaction.zooming){this.minimumAutoZoom=1/0;var i=e.interaction.zooming.initialAutoZoom;i&&("true"===i?i=!0:"false"===i&&(i=!1),this.scene.autoZoomMode=i)}if(this.resetZoom||t.changes.newGraph)this.resetZoom=!1,this.setZoom("overview",!1);else if(0===this.numPointers&&this.layer.nodes().length>0){this.scene.autoZoomMode&&this.autoZoom(!0)&&(t.changes.position=!0);var n=t.timeStamp,s=this.inertiaX.getValue(n),r=this.inertiaY.getValue(n),a=1/this.inertiaZ.getValue(n);s===this.scene.centerX&&r===this.scene.centerY&&a===this.scene.zoom||(this.scene.centerX=s,this.scene.centerY=r,this.scene.zoom=a,t.changes.position=!0),this.inertiaX.finished(n)&&this.inertiaY.finished(n)&&this.inertiaZ.finished(n)||(t.animating=!0)}else this.inertiaX.jump(this.scene.centerX),this.inertiaY.jump(this.scene.centerY),this.inertiaZ.jump(1/this.scene.zoom)},e.prototype._getInertiaAccelerations=function(){var t=this.scene.settings.interaction.zooming.autoZoomPositionEllasticity,e=.5*(this.scene.width+this.scene.height)*t;return{x:e,y:e,z:2*t}},e.prototype.autoZoom=function(t,e){var i=!1,n=this.computeAutoZoom("overview"===this.scene.autoZoomMode);if(null==n)return!1;var s=n.centerX,r=n.centerY,a=n.zoom,o=.01,l=1+o,h=1-o,u=1/this.inertiaZ.getTargetValue()/a,c=this._getInertiaAccelerations();(u>l||u<h)&&(t?this.inertiaZ.setTarget(1/a,e,c.z):(this.inertiaZ.jump(1/a),this.scene.zoom=a),i=!0);var d=this.scene.width,p=(this.inertiaX.getTargetValue()-s)*a/d;(p>o||p<-o)&&(t?this.inertiaX.setTarget(s,e,c.x):(this.inertiaX.jump(s),this.scene.centerX=s),i=!0);var f=this.scene.height,g=(this.inertiaY.getTargetValue()-r)*a/f;return(g>o||g<-o)&&(t?this.inertiaY.setTarget(r,e,c.y):(this.inertiaY.jump(r),this.scene.centerY=r),i=!0),i},e.prototype.computeAutoZoom=function(t,e,i){var n,s=this.scene;n=t?this.layer.getGraphBounds(e):this.layer.getNodeNeighborsBounds(s.lastClickedNode);var r=n.x0,a=n.y0,o=n.x1,l=n.y1;if(0===r&&0===o&&0===a&&0===l)return null;i&&(n.y0-=i[0],n.x1+=i[1],n.y1+=i[2],n.x0-=i[3]);var h=s.getVisibleBounds(),u=s.settings.interaction.zooming,c=(1-u.autoZoomSize)/2,d=c*n.w(),p=c*n.h(),f=Math.abs(h.x0-n.x0+d),g=Math.abs(h.x1-n.x1-d),m=Math.abs(h.y0-n.y0+p),v=Math.abs(h.y1-n.y1-p);if(f<d&&g<d&&m<p&&v<p)return null;var y=Math.min(s.width/(n.w()+2*d),s.height/(n.h()+2*p)),S=u.autoZoomExtent;return S&&(y=Math.min(S[1],y),null===S[0]?this.minimumAutoZoom=Math.min(y,this.minimumAutoZoom):y=Math.max(S[0],y)),{centerX:(n.x0+n.x1)/2,centerY:(n.y0+n.y1)/2,zoom:y}},e.prototype.manualZoom=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=!1);var s=this.scene,r=this.settings.interaction.zooming.zoomExtent,a=this.layer.getGraphBounds(),o=a.x0,l=a.y0,h=a.x1,c=a.y1,d=s.zoom*t;d=Math.min(d,Math.max(s.zoom,r[1])),d=Math.max(d,Math.min(s.zoom,Math.min(this.minimumAutoZoom,r[0]))),t=d/s.zoom;var p,f;if(null!==e&&null!==i){var g=s.fromDisplay(e,i);p=g.x,f=g.y}else if(s.selection.length>0){for(var m=0,v=0,y=0,S=0;S<s.selection.length;S++){var b=s.selection[S];b instanceof u.Node&&(m+=b.x,v+=b.y,y+=1)}y>0&&(p=m/y,f=v/y)}var C,x;p&&f?(C=(s.centerX-p)/t+p,x=(s.centerY-f)/t+f):(C=p=s.centerX,x=f=s.centerY);var w=s.zoom*t,L=s.getVisibleBounds();if(p<o||p>h){var A=void 0;A=L.x0>o&&L.x1>h?Math.max(h-L.x1,o-L.x0):L.x1<h&&L.x0<o?Math.min(h-L.x1,o-L.x0):0,C+=A}if(f<l||f>c){var T=void 0;T=L.y0>l&&L.y1>c?Math.max(c-L.y1,l-L.y0):L.y1<c&&L.y0<o?Math.min(c-L.y1,l-L.y0):0,x+=T}if(n&&w!==s.zoom?this.inertiaZ.setTarget(1/w):(this.inertiaZ.jump(1/w),s.zoom=w),!n||C===s.centerX&&x===s.centerY)s.centerX=C,s.centerY=x,this.inertiaX.jump(C),this.inertiaY.jump(x);else{var M=this._getInertiaAccelerations();this.inertiaX.setTarget(C,null,M.x),this.inertiaY.setTarget(x,null,M.y)}s.autoZoomMode=!1},e.prototype.scrollIntoView=function(t,e){if(t&&t.length){var i=d.Helpers.performanceNow();this.scene.autoZoomMode=!1;var n=this._getInertiaAccelerations(),s=this.computeAutoZoom(!0,t,e);s&&(this.inertiaX.setTarget(s.centerX,i,n.x),this.inertiaY.setTarget(s.centerY,i,n.y),this.inertiaZ.setTarget(1/s.zoom,i,n.z),this.chart.events.notifySceneChanges({position:!0}))}},e}(d.ChartElement);t.AutoZoom=M;var k=function(t){function e(e){t.call(this),this.updateOrder=150,this.chart=e}return n(e,t),e.CreateNavigator=function(t){switch(t.settings.navigation.mode){case"manual":return new P(t);case"showall":return new I(t);case"focusnodes":return new F(t);default:return t.error("Unknown navigation mode: '"+t.settings.navigation.mode+"'"),new I(t)}},e.prototype.updateGraphWithNewData=function(t,e){for(var i=this.chart.layer,n=this.chart.scene.mainData,s=i.idToNode,r=Object.keys(t?t:s),a={loading:!1},o=0;o<r.length;o++){var l=r[o];if(d.Helpers.hasProperty(s,l)){var h=s[l];if(!h.removed){var u=n.getNode(l,!1,a);u?(this.updateNodeWithNewData(h,u,n.getLinks(l,!1)),i.touchNode(h)):a.loading?h.loading||(h.loading=!0,i.touchNode(h)):this.ensureNodeRemoved(h)}}}},e.prototype.calcExpanded=function(t){var e=t.expanded;if(t.links.length<t.dataLinks.length)return t.expanded=!1,e;for(var i=0;i<t.links.length;i++)if(t.links[i].removed)return t.expanded=!1,e;return t.expanded=!0,!e},e.prototype.syncNodeLinks=function(t){for(var e=this.chart.layer,i=t.links,n=t.dataLinks,s={},r=0;r<n.length;r++)s[n[r].id]=n[r];for(var a=0;a<i.length;a++){var o=i[a];o.removed||(d.Helpers.hasProperty(s,o.id)?(o.data=s[o.id],e.touchLink(o),delete s[o.id]):this.ensureLinkRemoved(o))}for(var l=Object.keys(s),h=t.id,r=0;r<l.length;r++){var o=s[l[r]],u=A.otherEnd(o,h);d.Helpers.hasProperty(e.idToNode,u)&&!e.idToNode[u].removed&&this.ensureLink(o)}this.calcExpanded(t)},e.prototype.updateNodeWithNewData=function(t,e,i){t.data=e,e.resetCoordinates&&(t.x=e.x,t.y=e.y,e.resetCoordinates=!1),e.loaded&&(t.loading=!1),t.dataLinks=i,this.syncNodeLinks(t)},e.prototype.ensureNode=function(t,e){var i=this.chart.layer,n=d.Helpers.hasProperty(i.idToNode,t.id)?i.idToNode[t.id]:null;return!(n&&!n.removed)&&(n=i.addNode(t.id),t.x&&(n.x=t.x),t.y&&(n.y=t.y),t.resetCoordinates=!1,n.loading=!t.loaded,n.data=t,n.dataLinks=e,this.chart.graph.applyRestoredCoordinates(n),this.syncNodeLinks(n),!0)},e.prototype.ensureLink=function(t){var e=this.chart.layer,i=d.Helpers.hasProperty(e.idToLink,t.id)?e.idToLink[t.id]:null;if(i&&!i.removed)return!1;var n=d.Helpers.hasProperty(e.idToNode,t.from)?e.idToNode[t.from]:null,s=d.Helpers.hasProperty(e.idToNode,t.to)?e.idToNode[t.to]:null;return!(!n||n.removed||!s||s.removed)&&(i=e.addLink(t.id,t.from,t.to),i.data=t,this.calcExpanded(n),this.calcExpanded(s),!0)},e.prototype.ensureNodeRemoved=function(t){if(!t||t.removed)return!1;for(var e=this.chart.layer,i=t.links,n=i.length-1;n>=0;n--){var s=i[n];if(!s.removed){var r=s.otherEnd(t);r!==t&&!r.removed&&r.expanded&&(r.expanded=!1,e.touchNode(r)),e.removeLink(s)}}return e.removeNode(t),!0},e.prototype.ensureLinkRemoved=function(t){if(!t||t.removed)return!1;var e=this.chart.layer;return!t.from.removed&&t.from.expanded&&(t.from.expanded=!1,e.touchNode(t.from)),!t.to.removed&&t.to.expanded&&(t.to.expanded=!1,e.touchNode(t.to)),e.removeLink(t),!0},e}(d.Navigator);t.Navigator=k;var P=function(t){function e(){t.apply(this,arguments),this.saveHack=null,this.retryList=[]}return n(e,t),e.prototype.executeAllSceneChanges=function(t){var e=this.retryList;this.retryList=[];for(var i=0;i<e.length;i++){var n=e[i].fun(t);null===n?this.retryList.push(e[i]):n&&e[i].origin&&this.chart.notifyChartUpdate(e[i].origin)}},e.prototype.notifyNavigation=function(t,e){this.chart.events.notifySceneChanges({navigation:!0}),this.retryList.push({fun:e,origin:t})},e.prototype.clearFocusNodes=function(t){var e=this;this.notifyNavigation(t,function(){for(var t=!1,i=e.chart.layer,n=i.idToNode,s=Object.keys(n),r=0;r<s.length;r++){var a=n[s[r]];a.focused&&!a.removed&&(t=!0,a.focused=!1,i.touchNode(a))}return t})},e.prototype.hideNode=function(t,e){var i=this;this.notifyNavigation(e,function(){return i.ensureNodeRemoved(d.Helpers.hasProperty(i.chart.layer.idToNode,t)?i.chart.layer.idToNode[t]:null)})},e.prototype.showNode=function(t,e){var i=this;this.notifyNavigation(e,function(){var e={loading:!1},n=i.chart.scene.mainData,s=n.getNode(t,!0,e);return s?(i.ensureNode(s,n.getLinks(t)),!0):!!e.loading&&null})},e.prototype.collapseNode=function(t,e){var i=this;this.notifyNavigation(e,function(){var e=i.chart.layer,n=d.Helpers.hasProperty(e.idToNode,t)?e.idToNode[t]:null;if(!n||n.removed)return!1;for(var s=!1,r=0;r<n.links.length;r++){var a=n.links[r];if(!a.removed){var o=a.otherEnd(n);o!==n&&(s=i.ensureNodeRemoved(o)||s)}}return i.canHideNode(n)&&(s=i.ensureNodeRemoved(n)||s),s})},e.prototype.calculateCloseNodes=function(t){for(var e={},i=[],n=0;n<t.links.length;n++){var s=t.links[n];if(!s.removed){var r=s.otherEnd(t);r===t||r.removed||(i.push(r),e[r.id]=!0)}}e[t.id]=!0;for(var a=[],n=0;n<i.length;n++){for(var o=i[n],l=!0,h=0;h<o.links.length;h++){var r=o.links[h].otherEnd(o);if(!d.Helpers.hasProperty(e,r.id)){l=!1;break}}l&&a.push(o)}return a},e.prototype.closeNode=function(t,e){var i=this;this.notifyNavigation(e,function(){var e=i.chart.layer,n=d.Helpers.hasProperty(e.idToNode,t)?e.idToNode[t]:null;if(!n||n.removed)return!1;for(var s=!1,r=i.calculateCloseNodes(n),a=0;a<r.length;a++)s=i.ensureNodeRemoved(r[a])||s;return s})},e.prototype.focusNode=function(t,e,i){var n=this;this.notifyNavigation(i,function(){var e=n.chart.layer.idToNode[t];return e instanceof u.Node&&!e.removed&&(!e.focused&&(e.focused=!0,n.chart.layer.touchNode(e),!0))})},e.prototype.expandNode=function(t,e){var i=this,n={},s=!1;this.notifyNavigation(e,function(){var e=i.chart.layer,r=e.idToNode[t];if(!(r instanceof u.Node)||r.removed)return!1;var a=i.chart.scene.mainData,o=r.dataLinks;if(null!=o)for(var l=0;l<o.length;l++){var h=o[l];if(!d.Helpers.hasProperty(n,h.id)){n[h.id]=!0;var c=d.Helpers.hasProperty(e.idToLink,h.id)?e.idToLink[h.id]:null;if(!c||c.removed){var p=A.otherEnd(h,t);if(p!==t){var f=d.Helpers.hasProperty(e.idToNode,p)?e.idToNode[p]:null;if(!f||f.removed){var g=a.getNode(p);if(!g)continue;i.ensureNode(g,a.getLinks(p))}}s=!0}}}return r.data.loaded?s:null})},e.prototype.unfocusNode=function(t,e){var i=this;this.notifyNavigation(e,function(){var e=i.chart.layer.idToNode[t];return e instanceof u.Node&&!e.removed&&(!!e.focused&&(e.focused=!1,i.chart.layer.touchNode(e),!0))})},e.prototype.save=function(){if(this.saveHack)return this.saveHack;for(var t={},e=this.chart.layer.idToNode,i=Object.keys(e),n=0;n<i.length;n++){var s=e[i[n]];s.removed||(t[s.id]=s.focused)}return t},e.prototype.restore=function(t){var e=this,i=t;if(i){this.saveHack=i,this.chart.notifyChartUpdate("restore"),this.saveHack=null;var n={},s=!1,r=!1;this.notifyNavigation(null,function(){var t,a=e.chart.layer,o=e.chart.scene.mainData,l=!1,h={loading:!1},u=a.idToNode;if(!r){t=Object.keys(u);for(var c=0;c<t.length;c++){var p=t[c];d.Helpers.hasProperty(i,p)||u[p].removed||(s=e.ensureNodeRemoved(u[p])||s)}r=!0}t=Object.keys(i);for(var c=0;c<t.length;c++){var p=t[c];if(!d.Helpers.hasProperty(n,p)){var f=d.Helpers.hasProperty(a.idToNode,p)?a.idToNode[p]:null;if(!f||f.removed){var g=o.getNode(p,!0,h);if(!g){h.loading?l=!0:n[p]=!0;continue}e.ensureNode(g,o.getLinks(p)),a.idToNode[p].focused=i[p],s=!0}else f&&f.focused!==i[p]&&(f.focused=i[p],a.touchNode(f),s=!0);n[p]=!0}}return l?null:s})}},e.prototype.onNewDataObject=function(){for(var t=this,e=this.save(),i=this.chart.scene.mainData,n=Object.keys(e),s=0;s<n.length;s++)i.getNode(n[s]);this.notifyNavigation(null,function(){var n,s=t.chart.layer,r=s.idToNode,a={loading:!1};n=Object.keys(e);for(var o=0;o<n.length;o++){var l=n[o];if(d.Helpers.hasProperty(r,l)&&!r[l].removed){var h=i.getNode(l,!0,a);if(h)delete e[l];else if(a.loading)return null}else delete e[l]}return!0})},e.prototype.showInitialNodes=function(){var t=this,e=!1,i=this.chart.settings.navigation.initialNodes,n=!1,s=!1;this.retryList=[],this.notifyNavigation("init",function(r){var a=t.chart.layer;if(e||(d.Helpers.hasProperties(a.nodes)&&(a.clearObjects(),n=!0),e=!0),null==i||i.length<1)return n;var o={loading:!1},l=t.chart.scene.mainData,h=!1,u=i;i=[];for(var c=0;c<u.length;c++){var p=u[c],f=l.getNode(p,!0,o);f?(n=t.ensureNode(f,l.getLinks(p))||n,s||(s=!0,r.changes.newGraph=!0)):o.loading&&(i.push(p),h=!0)}return h?null:n})},e.prototype.onSceneChange=function(t){t.changes.filters?this.updateGraphWithNewData(null,t):(t.changes.dataArrived||t.changes.data)&&this.updateGraphWithNewData(t.changes.netChartDataNodes,t),this.retryList.length>0&&(t.changes.navigation||t.changes.dataArrived)&&this.executeAllSceneChanges(t)},e.prototype.canFocusNode=function(t){return!t.focused},e.prototype.canUnfocusNode=function(t){return t.focused},e.prototype.canExpandNode=function(t){return!t.expanded},e.prototype.canCollapseNode=function(t){return this.canHideNode(t)},e.prototype.canHideNode=function(t){for(var e=this.chart.layer,i=Object.keys(e.idToNode),n=0;n<i.length;n++){var s=e.idToNode[i[n]];if(s!==t&&!s.removed)return!0}return!1},e.prototype.canCloseNode=function(t){return this.calculateCloseNodes(t).length>0},e}(k);t.ManualNavigator=P;var I=function(t){function e(){t.apply(this,arguments),this.hiddenNodes={},this.isInitialized=!1}return n(e,t),e.prototype.showNode=function(e,i){delete this.hiddenNodes[e],t.prototype.showNode.call(this,e,i)},e.prototype.hideNode=function(e,i){var n=this.chart.layer.idToNode;d.Helpers.hasProperty(n,e)&&(this.hiddenNodes[e]=!0,t.prototype.hideNode.call(this,e,i))},e.prototype.collapseNode=function(e,i){var n=this.chart.layer.idToNode;if(d.Helpers.hasProperty(n,e)){this.hiddenNodes[e]=!0;for(var s=n[e],r=0;r<s.links.length;r++){var a=s.links[r];if(!a.removed){var o=a.otherEnd(s);o!==s&&(this.hiddenNodes[o.id]=!0)}}t.prototype.collapseNode.call(this,e,i)}},e.prototype.closeNode=function(e,i){var n=this.chart.layer.idToNode;if(d.Helpers.hasProperty(n,e)){for(var s=this.calculateCloseNodes(n[e]),r=0;r<s.length;r++)this.hiddenNodes[s[r].id]=!0;t.prototype.closeNode.call(this,e,i)}},e.prototype.save=function(){if(this.saveHack)return this.saveHack;var t;t=[];for(var e=this.chart.layer.idToNode,i=Object.keys(e),n=0;n<i.length;n++){var s=e[i[n]];!s.removed&&s.focused&&t.push(s.id)}return{hidden:Object.keys(this.hiddenNodes),focused:t}},e.prototype.restore=function(t){var e=this,i=t;this.hiddenNodes={};for(var n=0;n<i.hidden.length;n++)this.hiddenNodes[i.hidden[n]]=!0;this.saveHack=i,this.chart.notifyChartUpdate("restore"),this.saveHack=null,this.notifyNavigation(null,function(t){e.updateGraphWithNewData(null,t);for(var n={},s=0;s<i.focused.length;s++)n[i.focused[s]]=!0;for(var r=e.chart.layer,a=r.idToNode,o=Object.keys(a),s=0;s<o.length;s++){var l=a[o[s]],h=d.Helpers.hasProperty(n,o[s]);l.removed||l.focused===h||(l.focused=h,r.touchNode(l))}return!1})},e.prototype.expandNode=function(e,i){var n=this.chart.layer.idToNode;if(d.Helpers.hasProperty(n,e)){for(var s=n[e],r=0;r<s.dataLinks.length;r++){var a=s.dataLinks[r],o=A.otherEnd(a,e);o!==e&&delete this.hiddenNodes[o]}t.prototype.expandNode.call(this,e,i)}},e.prototype.showInitialNodes=function(){var t=this;this.retryList=[],this.notifyNavigation("init",function(e){var i=t.chart.layer,n=t.chart.scene.mainData;t.hiddenNodes={},i.clearObjects(),t.isInitialized=!0;var s,r=t.chart.settings.navigation.initialNodes,a={};if(null==r||r.length<1){s=n.getAllNodes();for(var o=0;o<s.length;o++)a[s[o].id]=!0}else{s=n.getAllNodes(!1);for(var o=0;o<s.length;o++)a[s[o].id]=!0;for(var o=0;o<r.length;o++){var l=r[o];if(!d.Helpers.hasProperty(a,l)){var h=n.getNode(l);h&&(s.push(h),a[l]=!0)}}}for(var o=0;o<s.length;o++){var u=s[o],c=n.getLinks(u.id);t.ensureNode(u,c);for(var p=0;p<c.length;p++){var f=A.otherEnd(c[p],u.id);if(f&&f!==u.id&&!d.Helpers.hasProperty(a,f)){a[f]=!0;var g=n.getNode(f);g&&s.push(g)}}}return s.length>0&&(e.changes.newGraph=!0),!0})},e.prototype.onNewDataObject=function(){var t=this,e=this.chart.settings.navigation.initialNodes;(null==e||e.length<1)&&this.chart.scene.mainData.getAllNodes(),this.notifyNavigation(null,function(e){return t.updateGraphWithNewData(null,e),!1})},e.prototype.updateGraphWithNewData=function(t,e){if(this.isInitialized){var i,n=this.chart.layer,s=this.chart.scene.mainData,r=n.idToNode,a={};if(t){i=Object.keys(t);for(var o=0;o<i.length;o++)a[i[o]]=s.getNode(i[o],!1)}else{for(var l=s.getAllNodes(!1),o=0;o<l.length;o++)a[l[o].id]=l[o];for(var h=Object.keys(r),o=0;o<h.length;o++)d.Helpers.hasProperty(a,h[o])||(a[h[o]]=null);h=Object.keys(this.hiddenNodes);for(var o=0;o<h.length;o++)d.Helpers.hasProperty(a,h[o])||(a[h[o]]=null);i=Object.keys(a)}for(var u=!1,c=Object.keys(r),o=0;o<c.length;o++)if(!r[c[o]].removed){u=!0;break}for(var p=!1,o=0;o<i.length;o++){var f=i[o],g=a[f],m=d.Helpers.hasProperty(r,f)?r[f]:null;if(g){if(d.Helpers.hasProperty(this.hiddenNodes,f)){this.ensureNodeRemoved(m);continue}var v=s.getLinks(f,!1);m&&!m.removed?(this.updateNodeWithNewData(m,g,v),n.touchNode(m)):(this.ensureNode(g,v),m=r[f],p=!0);for(var y=0;y<v.length;y++){var S=A.otherEnd(v[y],f);if(S&&S!==f&&!d.Helpers.hasProperty(this.hiddenNodes,S)){var b=d.Helpers.hasProperty(r,S)?r[S]:null;if(!b||b.removed){var C=s.getNode(S);C&&this.ensureNode(C,s.getLinks(S))}}}}else s.isNodeLoading(f)?m&&!m.loading&&(m.loading=!0,n.touchNode(m)):(this.ensureNodeRemoved(m),delete this.hiddenNodes[f])}!u&&p&&(e.changes.newGraph=!0)}},e}(P);t.ShowAllNavigator=I;var D;!function(t){t[t.Hidden=1]="Hidden",t[t.Expanded=2]="Expanded"}(D||(D={}));var F=function(t){function e(){t.apply(this,arguments),this.focusNodes=[],this.extraFlags={},this.needsFullRecalculate=!1,this.wasReset=!1}return n(e,t),e.prototype.expandNode=function(t,e){var i=this.chart.layer.idToNode,n=d.Helpers.hasProperty(i,t)?i[t]:null,s=!1;if(n&&!n.removed){n.relevance<2&&(this.extraFlags[t]=D.Expanded,s=!0);for(var r=0;r<n.dataLinks.length;r++){var a=A.otherEnd(n.dataLinks[r],t);a&&a!==t&&d.Helpers.hasProperty(this.extraFlags,a)&&this.extraFlags[a]===D.Hidden&&(delete this.extraFlags[a],s=!0)}s&&(this.scheduleFullRecalculate(),this.chart.notifyChartUpdate(e))}},e.prototype.collapseNode=function(t,e){var i=this.chart.layer.idToNode,n=d.Helpers.hasProperty(i,t)?i[t]:null,s=!1;if(n&&!n.removed){d.Helpers.hasProperty(this.extraFlags,t)&&(delete this.extraFlags[t],s=!0);for(var r=0;r<n.links.length;r++){var a=n.links[r].otherEnd(n);a&&a!==n&&!a.removed&&a.baseRelevance<n.baseRelevance&&(this.extraFlags[a.id]=D.Hidden,s=!0)}s&&(this.scheduleFullRecalculate(),this.chart.notifyChartUpdate(e))}},e.prototype.closeNode=function(t,e){},e.prototype.focusNode=function(t,e,i){for(var n=0;n<this.focusNodes.length;n++)if(this.focusNodes[n].id===t)return;if(this.focusNodes.length>=this.chart.settings.navigation.numberOfFocusNodes){if(!this.chart.settings.navigation.autoUnfocus)return;this.focusNodes.pop()}this.focusNodes.unshift({id:t,assignedRelevance:e,calculatedRelevance:null}),d.Helpers.hasProperty(this.extraFlags,t)&&this.extraFlags[t]===D.Hidden&&delete this.extraFlags[t];var s=this.chart.scene.mainData.getLinks(t,!1);if(s)for(var n=0;n<s.length;n++){var r=A.otherEnd(s[n],t);r&&r!==t&&d.Helpers.hasProperty(this.extraFlags,r)&&this.extraFlags[r]===D.Hidden&&delete this.extraFlags[r]}this.chart.notifyChartUpdate(i),this.scheduleFullRecalculate()},e.prototype.unfocusNode=function(t,e){if(!(this.focusNodes.length<=Math.max(this.chart.settings.navigation.minNumberOfFocusNodes,1)))for(var i=0;i<this.focusNodes.length;i++)if(this.focusNodes[i].id===t)return this.focusNodes.splice(i,1),this.chart.notifyChartUpdate(e),void this.scheduleFullRecalculate()},e.prototype.clearFocusNodes=function(t){this.focusNodes=[],this.extraFlags={},this.wasReset=!0,this.chart.notifyChartUpdate(t),this.scheduleFullRecalculate()},e.prototype.hideNode=function(t,e){var i=this.chart.layer.idToNode,n=d.Helpers.hasProperty(i,t)?i[t]:null;n&&!n.removed&&this.canHideNode(n)&&(this.extraFlags[t]=D.Hidden,this.chart.notifyChartUpdate(e),this.scheduleFullRecalculate())},e.prototype.showNode=function(t,e){d.Helpers.hasProperty(this.extraFlags,t)&&this.extraFlags[t]===D.Hidden&&(delete this.extraFlags[t],this.scheduleFullRecalculate())},e.prototype.showInitialNodes=function(){this.extraFlags={};var t=this.chart.settings.navigation.initialNodes;if(t){var e={};this.focusNodes=new Array(t.length);for(var i=0,n=0;n<t.length;n++){var s=t[n];d.Helpers.hasProperty(e,s)||(e[s]=!0,this.focusNodes[i++]={id:s,assignedRelevance:-1,calculatedRelevance:null})}i<this.chart.settings.navigation.minNumberOfFocusNodes&&this.chart.error("Too few initialNodes. minNumberOfFocusNodes is "+this.chart.settings.navigation.minNumberOfFocusNodes+" but there are only "+i+" nodes in initialNodes"),i>this.chart.settings.navigation.numberOfFocusNodes&&(this.chart.error("Too many initialNodes. numberOfFocusNodes is "+this.chart.settings.navigation.numberOfFocusNodes+" but there are "+i+" nodes in initialNodes. Discarding excess focus nodes."),i=this.chart.settings.navigation.numberOfFocusNodes),this.focusNodes.length=i}else this.focusNodes=[];this.wasReset=!0,this.chart.notifyChartUpdate("init"),this.scheduleFullRecalculate()},e.prototype.save=function(){return{focusNodes:this.focusNodes,extraFlags:this.extraFlags}},e.prototype.restore=function(t){this.focusNodes=d.Helpers.realClone(t.focusNodes),this.extraFlags=d.Helpers.clone(t.extraFlags),this.scheduleFullRecalculate(),this.chart.notifyChartUpdate("restore")},e.prototype.onNewDataObject=function(){for(var t=this.chart.scene.mainData,e=Object.keys(this.chart.layer.idToNode),i=0;i<e.length;i++)t.getNode(e[i])},e.prototype.onSceneChange=function(t){t.changes.filters?(this.updateGraphWithNewData(null,t),this.needsFullRecalculate=!0):t.changes.dataArrived||t.changes.data?(this.updateGraphWithNewData(t.changes.netChartDataNodes,t),this.needsFullRecalculate=!0):t.changes.settings&&t.changes.settingsChanges.navigation&&(this.needsFullRecalculate=!0),this.needsFullRecalculate&&(this.needsFullRecalculate=!1,this.fullRecalculate(t.timeStamp,t))},e.prototype.scheduleFullRecalculate=function(){this.needsFullRecalculate=!0,this.chart.events.notifySceneChanges({navigation:!0})},e.prototype.fullRecalculate=function(t,e){var i=this,n=this.chart.settings.navigation,s=this.chart.layer,r=this.chart.scene.mainData;if(this.focusNodes.length<1)return s.clearObjects(),this.wasReset&&(e.changes.newGraph=!0),void(this.wasReset=!1);for(var a=t-this.chart.settings.navigation.expandDelay,o=s.idToNode,l=Object.keys(o),h=s.idToLink,u=0;u<l.length;u++){var c=o[l[u]];c.baseRelevance=-(1/0),c.relevance=-(1/0),c.focused=!1,s.touchNode(c)}if(n.numberOfFocusNodes>1)for(var p=null==n.focusNodeTailExpansionRadius?n.focusNodeExpansionRadius:n.focusNodeTailExpansionRadius,f=Math.max(n.focusNodeExpansionRadius+1,1),g=Math.max(p+1,1),m=(f-g)/(n.numberOfFocusNodes-1),u=0;u<this.focusNodes.length;u++)this.focusNodes[u].calculatedRelevance=f-u*m;else this.focusNodes[0].calculatedRelevance=Math.max(n.focusNodeExpansionRadius+1,1);for(var v=[],y={},S={},u=0;u<this.focusNodes.length;u++){var b=this.focusNodes[u],c=d.Helpers.hasProperty(o,b.id)?o[b.id]:null;if(!c||c.removed){var C=r.getNode(b.id);if(!C)continue;this.ensureNode(C,r.getLinks(b.id)),c=o[b.id]}c.focused=!0,c.baseRelevance=b.assignedRelevance>=1?b.assignedRelevance:b.calculatedRelevance,c.relevance=c.baseRelevance,c.showTimestamp=-(1/0),v.push(c),y[b.id]=!0,S[b.id]=!0,this.wasReset&&(this.wasReset=!1,e.changes.newGraph=!0)}for(var x=Object.keys(this.extraFlags),u=0;u<x.length;u++){var w=x[u],c=d.Helpers.hasProperty(o,w)?o[w]:null;if(c&&!c.removed)if(this.extraFlags[w]===D.Hidden)c.relevance=-100;else if(c.relevance<2){c.relevance=2;for(var L=0;L<c.links.length;L++){var T=c.links[L].otherEnd(c);T&&T!==c&&T.relevance<1&&T.relevance!==-100&&(T.relevance=1)}}else delete this.extraFlags[w]}for(var M=1/0,u=0;u<v.length;u++){var c=v[u];delete y[c.id];for(var w=c.id,k=c.baseRelevance-1,P=c.relevance-1,I=d.Helpers.hasProperty(S,w)&&c.relevance>0,L=0;L<c.dataLinks.length;L++){var F=c.dataLinks[L],N=A.otherEnd(F,w);if(N&&N!==w){I&&(S[N]=!0);var E=d.Helpers.hasProperty(this.extraFlags,N)?this.extraFlags[N]:null;if(E!==D.Hidden){var z=P;E===D.Expanded&&P>=2&&delete this.extraFlags[N];var T=d.Helpers.hasProperty(o,N)?o[N]:null,O=!1;if(!T||T.removed){if(z<=0)continue;var C=r.getNode(N);if(!C)continue;if(c.showTimestamp>a){M>c.showTimestamp&&(M=c.showTimestamp);continue}this.ensureNode(C,r.getLinks(N)),T=o[N],T.relevance=z,T.baseRelevance=k,T.showTimestamp=t,O=!0}else T.relevance<z&&(T.relevance=z,s.touchNode(T),O=!0),T.baseRelevance<k&&(T.baseRelevance=k,s.touchNode(T),O=!0);var H=h[F.id],_=Math.min(c.relevance,T.relevance);H.relevance!==_&&(H.relevance=_,s.touchLink(H)),O&&!d.Helpers.hasProperty(y,N)&&(y[N]=!0,v.push(T))}}}}for(var u=0;u<l.length;u++){var w=l[u],c=o[w];c.removed||(d.Helpers.hasProperty(S,w)?c.relevance<=0&&this.ensureNodeRemoved(c):(this.ensureNodeRemoved(c),delete this.extraFlags[w]))}M<1/0&&window.setTimeout(function(){return i.scheduleFullRecalculate();
  43. },M+this.chart.settings.navigation.expandDelay-t)},e.prototype.canFocusNode=function(t){return!t.focused&&(this.focusNodes.length<this.chart.settings.navigation.numberOfFocusNodes||this.chart.settings.navigation.autoUnfocus)},e.prototype.canUnfocusNode=function(t){return t.focused&&this.focusNodes.length>Math.max(this.chart.settings.navigation.minNumberOfFocusNodes,1)},e.prototype.canExpandNode=function(t){return!t.expanded},e.prototype.canCollapseNode=function(t){for(var e=0;e<t.links.length;e++){var i=t.links[e].otherEnd(t);if(i&&i!==t&&!i.removed&&i.baseRelevance<t.baseRelevance)return!0}return!1},e.prototype.canHideNode=function(t){return!t.focused||this.canUnfocusNode(t)},e.prototype.canCloseNode=function(t){return!1},e}(k);t.FocusNodesNavigator=F,function(t){var e=function(){function t(t){this.pointers=[],this.manager=t}return t.prototype.addPointer=function(t,e){this.pointers.push(t.identifier),t.consumed=!0},t.prototype.removePointer=function(t){d.Helpers.removeFromArrayHasty(this.pointers,t.identifier),t.consumed=!0},t.prototype.movePointer=function(t){t.consumed=!0},t}();t.Gesture=e;var i=function(t){function e(){t.apply(this,arguments),this.startX=0,this.startY=0,this.lastX=0,this.lastY=0,this.selectedNodes=null}return n(e,t),e.prototype.addPointer=function(e,i){t.prototype.addPointer.call(this,e,i),this.startX=this.lastX=e.x,this.startY=this.lastY=e.y,this.selectedNodes=new Object(null),e.cursor="crosshair";var n=this.manager.chart.scene;n.disableSelectionChangeNotification();var s=n.selection.filter(function(t){return t.dragging});s.length!==n.selection.length&&n.setSelection(s),this.manager.chart.events.requestPaint()},e.prototype.movePointer=function(e){t.prototype.movePointer.call(this,e),this.lastX=e.x,this.lastY=e.y,this.manager.chart.events.requestPaint(),e.cursor="crosshair",this.updateSelection()},e.prototype.removePointer=function(e){t.prototype.removePointer.call(this,e);for(var i in this.selectedNodes)this.selectedNodes[i].selectionLock=!1;this.manager.chart.scene.enableSelectionChangeNotification(),this.manager.chart.scene.notifySelectionChangesIfNeeded(this.manager.chart,"user"),this.manager.chart.events.requestPaint()},e.prototype.doAnimations=function(t){this.pointers.length>0&&(t.changes.position||t.changes.selection||this.manager.chart.layer.hasTopologyChanges())&&this.updateSelection()},e.prototype.updateSelection=function(){for(var t=this.manager.chart.layer.nodes(),e=this.manager.chart.scene,i=e.fromDisplay(this.startX,this.startY),n=e.fromDisplay(this.lastX,this.lastY),s=Math.min(i.x,n.x),r=Math.min(i.y,n.y),a=Math.max(i.x,n.x),o=Math.max(i.y,n.y),l=0;l<t.length;l++){var h=t[l];h.removed?this.selectedNodes[h.id]&&delete this.selectedNodes[h.id]:h.dragging||(h.x>=s&&h.x<=a&&h.y>=r&&h.y<=o?this.selectedNodes[h.id]||(this.selectedNodes[h.id]=h,h.selectionLock=!0,h.selected||e.addToSelection(h)):this.selectedNodes[h.id]&&(delete this.selectedNodes[h.id],h.selectionLock=!1,h.selected&&e.removeFromSelection(h)))}},e.prototype.paintScene=function(t){if(this.pointers.length>0){var e=this.manager.chart.settings.style.dragSelection,i=d.Graphics.beginStrokeAndFill(t.context,e);i.rect(this.startX-.5,this.startY-.5,this.lastX-this.startX,this.lastY-this.startY),d.Graphics.endStrokeAndFill(t.context,i,e)}},e}(e);t.MultiSelectGesture=i;var s=function(t){function e(){t.apply(this,arguments),this.dragPointers={}}return n(e,t),e.prototype.addPointer=function(e,i){t.prototype.addPointer.call(this,e,i);var n=this.manager.chart.scene.selection.filter(function(t){return!t.dragging});n.indexOf(i.object)<0&&n.push(i.object);for(var s=n.filter(function(t){return t instanceof u.Node}),r=0;r<s.length;r++)s[r].locks++;for(var r=0;r<n.length;r++)n[r].dragging=!0;var a=this.manager.chart.scene.fromDisplay(e.x,e.y);this.dragPointers[e.identifier]={nodes:s,all:n,mainNode:i.object,startPointerX:e.x,startPointerY:e.y,lastPointerX:e.x,lastPointerY:e.y,lastSceneX:a.x,lastSceneY:a.y}},e.prototype.removePointer=function(e){t.prototype.removePointer.call(this,e);var i=this.dragPointers[e.identifier];delete this.dragPointers[e.identifier];for(var n=0;n<i.nodes.length;n++)i.nodes[n].locks--;for(var n=0;n<i.all.length;n++)i.all[n].dragging=!1;this.manager.autoZoomIn(e,i.mainNode)},e.prototype.movePointer=function(e){t.prototype.movePointer.call(this,e);var i=this.dragPointers[e.identifier];i.lastPointerX=e.x,i.lastPointerY=e.y;var n=this.manager.chart.settings.interaction.selection,s=this.manager.chart.scene,r=s.fromDisplay(e.x,e.y),a=r.x-i.lastSceneX,o=r.y-i.lastSceneY;if(0!==a||0!==o){i.lastSceneX=r.x,i.lastSceneY=r.y;var l=n.lockNodesOnMove;if(l){var h=e.x-i.startPointerX,u=e.y-i.startPointerY,c=this.manager.chart.settings.advanced.pointer,d=Math.max(c.clickSensitivity,c.longPressSensitivity);l=h*h+u*u>d*d}this.moveNodes(i.nodes,a,o,l),this.manager.chart.events.notifySceneChanges({coordinates:!0})}},e.prototype.moveNodes=function(t,e,i,n){for(var s=this.manager.chart.scene,r=s.getVisibleBounds(),a=s.zoom,o=this.manager.chart.settings.interaction.selection.allowMoveNodesOffscreen,l=this.manager.chart.layer,h=0;h<t.length;h++){var u=t[h];if(u.x+=e,u.y+=i,n&&!u.userLock&&(u.userLock=!0,l.touchNode(u)),!o){var c=1.2*u.renderHwidth/a,d=1.2*u.renderHheight/a;u.x=Math.min(Math.max(u.x,r.x0+c),r.x1-c),u.y=Math.min(Math.max(u.y,r.y0+d),r.y1-d)}}},e.prototype.doAnimations=function(t){for(var e=this.manager.chart.scene,i=0;i<this.pointers.length;i++){var n=this.dragPointers[this.pointers[i]],s=e.fromDisplay(n.lastPointerX,n.lastPointerY),r=s.x-n.lastSceneX,a=s.y-n.lastSceneY;0===r&&0===a||(n.lastSceneX=s.x,n.lastSceneY=s.y,this.moveNodes(n.nodes,r,a,!1),t.changes.coordinates=!0)}},e}(e);t.NodeDragGesture=s;var r=function(t){function e(){t.apply(this,arguments),this.pinnedSceneX=0,this.pinnedSceneY=0}return n(e,t),e.prototype.addPointer=function(e,i){t.prototype.addPointer.call(this,e,i);var n=this.manager.chart.scene.fromDisplay(e.x,e.y);this.pinnedSceneX=n.x,this.pinnedSceneY=n.y},e.prototype.movePointer=function(e){t.prototype.movePointer.call(this,e);var i=this.manager.chart.scene;i.autoZoomMode=!1;var n=i.fromDisplay(e.x,e.y);i.centerX+=this.pinnedSceneX-n.x,i.centerY+=this.pinnedSceneY-n.y,e.changes.position=!0},e}(e);t.PanGesture=r;var a=function(t){function e(){t.apply(this,arguments),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.centerX=0,this.centerY=0,this.centerDistance=0}return n(e,t),e.prototype.addPointer=function(e,i){if(t.prototype.addPointer.call(this,e,i),1===this.pointers.length)this.x1=e.x,this.y1=e.y;else{this.x2=e.x,this.y2=e.y;var n=this.manager.chart.scene,s=n.fromDisplay((this.x1+this.x2)/2,(this.y1+this.y2)/2);this.centerX=s.x,this.centerY=s.y;var r=this.x1-this.x2,a=this.y1-this.y2,o=Math.sqrt(r*r+a*a);this.centerDistance=o/n.zoom}},e.prototype.movePointer=function(e){t.prototype.movePointer.call(this,e),e.identifier===this.pointers[0]?(this.twoFingerDrag(e.x,e.y,this.x2,this.y2),this.x1=e.x,this.y1=e.y):(this.twoFingerDrag(this.x1,this.y1,e.x,e.y),this.x2=e.x,this.y2=e.y),e.changes.position=!0},e.prototype.twoFingerDrag=function(t,e,i,n){var s=this.manager.chart.settings.interaction,r=this.manager.chart.scene;r.autoZoomMode=!1;var a=i-t,o=n-e,l=this.manager.chart.settings.layout.mode;!s.rotation.fingers||"static"!==l&&"dynamic"!==l||this._twoFingerRotation(t,e,i,n);var h=Math.sqrt(a*a+o*o)/r.zoom,u=(i+t)/2,c=(n+e)/2;if(!s.rotation.fingers&&s.panning.enabled){var d=r.fromDisplay(u,c);r.centerX+=this.centerX-d.x,r.centerY+=this.centerY-d.y}if(s.zooming.fingers){var p=h/this.centerDistance;this.manager.chart.autoZoom.manualZoom(p,u,c)}},e.prototype._twoFingerRotation=function(t,e,i,n){var s=i-t,r=n-e,a=Math.atan2(r,s),o=Math.atan2(this.y2-this.y1,this.x2-this.x1),l=a-o;if(0===l)return!1;var h,u,c,p,f,g=t-this.x1,m=e-this.y1,v=i-this.x2,y=n-this.y2,S=g*g+m*m,b=v*v+y*y;S>=b?(h=this.x1,u=this.y1,c=t,p=e,f=Math.sqrt(S)):(h=this.x2,u=this.y2,c=i,p=n,f=Math.sqrt(b));var C=c-h,x=p-u,w=C/f,L=x/f,A=(Math.PI+l)/2,T=Math.PI-A,M=d.Geometry.rotateVector(w,L,Math.sin(T),Math.cos(T)),k=d.Geometry.rotateVector(w,L,Math.sin(A),Math.cos(A)),P=d.Geometry.lineIntersectsLine(0,0,M.x,M.y,C,x,C+k.x,x+k.y);if(P===1/0)return!1;for(var I,D=h+M.x*P,F=u+M.y*P,N=this.manager.chart.scene.fromDisplay(D,F),E=N.x,z=N.y,O=this.manager.chart.layer.nodes(),H=Math.sin(l),_=Math.cos(l),R=0;R<O.length;R++){var B=O[R];B.dragging||(I=d.Geometry.rotateVector(B.x-E,B.y-z,H,_),B.x=E+I.x,B.y=z+I.y)}return!0},e}(e);t.TwoFingerGesture=a;var o={object:null,details:null},l=function(t){function l(n){t.call(this),this.animationOrder=2e3,this.updateOrder=1100,this.paintOrder=37,this.hoverPointer=null,this.ignoreGesture=new e(this),this.postponeGesture=new e(this),this.multiSelectGesture=new i(this),this.nodeDragGesture=new s(this),this.panGesture=new r(this),this.twoFingerGesture=new a(this),this.pointerMap={},this.chart=n}return n(l,t),l.prototype.findObject=function(t){var e=this.chart.renderer.findObjectAt(t.x,t.y,this.chart.settings.interaction.selection.tolerance);return e?e:o},l.prototype.assignPointer=function(t,e,i){var n=this.pointerMap[t.identifier];return n?(n.gesture.removePointer(t),n.gesture=i):n=this.pointerMap[t.identifier]={gesture:i,lastX:t.x,lastY:t.y,longPressGesture:null},i.addPointer(t,e),n},l.prototype.reassignToTwoFinger=function(t,e,i){var n=this.pointerMap[t],s=new d.MouseEvent(n.lastX,n.lastY,e.timeStamp,t);n.longPressGesture=null,this.assignPointer(s,o,this.twoFingerGesture),this.assignPointer(e,i,this.twoFingerGesture)},l.prototype.assignUnknownPointer=function(t,e){e.object instanceof u.Node&&this.chart.settings.interaction.nodesMovable?this.assignNodePointer(t,e):this.assignEmptyPointer(t,e)},l.prototype.assignEmptyPointer=function(t,e){var i=this.chart.settings.interaction,n=i.rotation.fingers||i.zooming.fingers,s=i.selection.enabled&&i.selection.dragSelect;if(this.twoFingerGesture.pointers.length>0){var r=this.assignPointer(t,e,this.ignoreGesture);s&&(r.longPressGesture=this.multiSelectGesture)}else if(n&&this.panGesture.pointers.length>0)this.reassignToTwoFinger(this.panGesture.pointers[0],t,e);else if(n&&this.postponeGesture.pointers.length>0)this.reassignToTwoFinger(this.postponeGesture.pointers[0],t,e);else if(n&&this.nodeDragGesture.pointers.length>0)this.reassignToTwoFinger(this.nodeDragGesture.pointers[0],t,e);else{var r=this.assignPointer(t,e,i.panning.enabled&&this.panGesture.pointers.length<1?this.panGesture:this.postponeGesture);s&&(r.longPressGesture=this.multiSelectGesture)}},l.prototype.assignNodePointer=function(t,e){var i=this.chart.settings.interaction,n=i.rotation.fingers||i.zooming.fingers;if(n&&this.panGesture.pointers.length>0)this.reassignToTwoFinger(this.panGesture.pointers[0],t,e);else if(n&&this.postponeGesture.pointers.length>0&&this.twoFingerGesture.pointers.length<1)this.reassignToTwoFinger(this.postponeGesture.pointers[0],t,e);else if(e.object.dragging){var s=this.assignPointer(t,e,this.postponeGesture);s.longPressGesture=this.ignoreGesture}else{var s=this.assignPointer(t,e,this.nodeDragGesture);s.longPressGesture=this.ignoreGesture}},l.prototype.updateSelection=function(t,e){var i=this.chart.settings.interaction.selection;if(i.enabled&&(e.object instanceof u.Node&&i.nodesSelectable||e.object instanceof u.Link&&i.linksSelectable)&&!e.object.selectionLock&&!e.object.dragging){var n=!1;if(t.shiftKey||t.ctrlKey)n=e.object.selected?this.chart.scene.removeFromSelection(e.object):this.chart.scene.addToSelection(e.object);else if(!e.object.selected){var s=this.chart.scene.selection.filter(function(t){return t.dragging||t.selectionLock});s.push(e.object),n=this.chart.scene.setSelection(s)}n&&this.chart.scene.notifySelectionChangesIfNeeded(this.chart,"user")}},l.prototype.onPointerDown=function(t){var e=this.findObject(t);this.updateSelection(t,e),this.assignUnknownPointer(t,e)},l.prototype.onPointerUp=function(t){var e=this.pointerMap[t.identifier];if(e.gesture.removePointer(t),delete this.pointerMap[t.identifier],e.gesture===this.twoFingerGesture){var i=this.twoFingerGesture.pointers[0],n=this.pointerMap[i];delete this.pointerMap[i];var s=new d.MouseEvent(n.lastX,n.lastY,t.timeStamp,i);this.twoFingerGesture.removePointer(s),this.assignPointer(s,o,this.chart.settings.interaction.panning.enabled?this.panGesture:this.postponeGesture)}},l.prototype.onPointerDrag=function(t){var e=this.pointerMap[t.identifier];e.lastX=t.x,e.lastY=t.y,e.gesture.movePointer(t)},l.prototype.onPointerCancel=function(t){this.onPointerUp(t)},l.prototype.onInstantClick=function(t){if(!t.shiftKey&&!t.ctrlKey&&!this.findObject(t).object){var e=this.chart.scene.selection.filter(function(t){return t.dragging||t.selectionLock});e.length!==this.chart.scene.selection.length&&(this.chart.scene.setSelection(e),this.chart.scene.notifySelectionChangesIfNeeded(this.chart,"user"))}},l.prototype.doAnimations=function(t){this.nodeDragGesture.doAnimations(t),this.multiSelectGesture.doAnimations(t)},l.prototype.paintScene=function(t){this.multiSelectGesture.paintScene(t)},l.prototype.buildClickEventArgs=function(t){var e=this.chart.createEventArguments(t,"user"),i=this.findObject(t);e.clickItem=i.details;var n=i.object;return n instanceof u.Node?(e.clickNode=n,this.autoZoomIn(t,n)):e.clickLink=n,e},l.prototype.updateHover=function(t,e){t.cursor=e.object&&e.object.cursor?e.object.cursor:"default",t.changes.current=!0,this.chart.scene.setActiveObject(e.object,e.details),this.chart.notifyHoverChanged(t,this.chart.createEventArguments(null,"api"))},l.prototype.autoZoomIn=function(t,e){this.chart.scene.lastClickedNode=e,this.chart.settings.interaction.zooming.autoZoomAfterClick&&(this.chart.scene.autoZoomMode=!0,t.changes.zoom=!0)},l.prototype.onPointerMove=function(t){if(!this.chart.scene.xyInChart(t.x,t.y))return void this.onPointerOut(t);this.hoverPointer=t.identifier;var e=this.findObject(t);e.object===(this.chart.scene.hoverLink||this.chart.scene.hoverNode)&&e.details===this.chart.scene.hoverItem||this.updateHover(t,e)},l.prototype.onPointerOut=function(t){this.hoverPointer===t.identifier&&(this.hoverPointer=null,this.updateHover(t,o)),this.pointerMap[t.identifier]&&this.onPointerUp(t)},l.prototype.onWheel=function(t){if(this.chart.scene.xyInChart(t.x,t.y)&&this.chart.settings.interaction.zooming.wheel){var e=Math.pow(1+this.chart.settings.interaction.zooming.sensitivity,.004*t.wheely);this.chart.autoZoom.manualZoom(e,t.x,t.y),t.consumed=!0,t.changes.position=!0}},l.prototype.onClick=function(t){this.chart.scene.xyInChart(t.x,t.y)&&(this.chart.notifyClick(t,this.buildClickEventArgs(t)),t.defaultPrevented&&(t.consumed=!0))},l.prototype.onRightClick=function(t){this.chart.scene.xyInChart(t.x,t.y)&&(this.chart.notifyRightClick(t,this.buildClickEventArgs(t)),t.defaultPrevented&&(t.consumed=!0))},l.prototype.onLongPress=function(t){if(this.chart.scene.xyInChart(t.x,t.y)){var e=this.pointerMap[t.identifier];e&&(e.longPressGesture&&(e.longPressGesture===this.multiSelectGesture&&this.multiSelectGesture.pointers.length>0&&(e.longPressGesture=this.ignoreGesture),this.assignPointer(t,o,e.longPressGesture),e.longPressGesture=null),t.consumed=e.gesture!==this.ignoreGesture)}},l.prototype.onDoubleClick=function(t){if(this.chart.scene.xyInChart(t.x,t.y))if(this.chart.notifyDoubleClick(t,this.buildClickEventArgs(t)),t.defaultPrevented)t.consumed=!0;else{var e=this.chart.settings.interaction.zooming.doubleClickZoom;e&&this.chart.settings.interaction.zooming.zoomInOnDoubleClick&&(this.chart.autoZoom.manualZoom(e,t.x,t.y),t.changes.position=!0,t.consumed=!0)}},l}(d.ChartElement);t.GestureManager=l}(e);var N=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.buildDefaultButton=function(t,e){var i=this.chart;if(t instanceof u.Node){var n=this.scene.settings.localization.menu,s=function(t,e){t.style.display=e?"":"none"};"expand"===e?(this.buildButton(t,"DVSL-NC-button-expand",n.expand,null,function(t,e){i.expandNode(t.id)},function(t,e){s(e,i.navigator.canExpandNode(t))}),this.buildButton(t,"DVSL-NC-button-collapse",n.collapse,null,function(t,e){i.collapseNode(t.id)},function(t,e){s(e,i.navigator.canCollapseNode(t))}),this.buildButton(t,"DVSL-NC-button-collapse",n.close,null,function(t,e){i.closeNode(t.id)},function(t,e){s(e,i.navigator.canCloseNode(t))})):"focus"===e?(this.buildButton(t,"DVSL-NC-button-focus",n.focus,null,function(t,e){i.addFocusNode(t.id,-1)},function(t,e){s(e,i.navigator.canFocusNode(t))}),this.buildButton(t,"DVSL-NC-button-unfocus",n.unfocus,null,function(t,e){i.removeFocusNode(t.id)},function(t,e){s(e,i.navigator.canUnfocusNode(t))})):"lock"===e?(this.buildButton(t,"DVSL-NC-button-lock",n.fixed,null,function(t,e){i.unlockNode(t.id)},function(t,e){s(e,t.userLock)}),this.buildButton(t,"DVSL-NC-button-unlock",n.dynamic,null,function(t,e){i.lockNode(t.id)},function(t,e){s(e,!t.userLock)})):"hide"===e?this.buildButton(t,"DVSL-NC-button-hide",n.hide,null,function(t,e){i.hideNode(t.id)},function(t,e){s(e,i.navigator.canHideNode(t))}):i.error("The node menu button with name `"+e+"` was not recognized. Valid values are: expand, focus, lock, hide.")}else i.error("The link menu does not support any named buttons.")},e}(u.Menu);t.Menu=N;var E=function(s){function r(n,r){s.call(this,new p(n),new x,r),this.isLayoutFrozen=!1,this.focusNodeStack=[];var a="focusnodes"===this.settings.navigation.mode&&this.settings.navigation.focusAutoFadeout;this.layer=new u.NodesLayer(this,this.settings,a),this.graph=new T(this),this.navigator=this.events.addElement(k.CreateNavigator(this)),this.gestures=this.events.addElement(new e.GestureManager(this)),this.layout=this.events.addElement(i.LayoutBase.ConstructLayout(this)),this.info=this.events.addElement(new u.InfoPopup(this)),this.menu=this.events.addElement(new t.Menu(this)),this.autoZoom=this.events.addElement(new M(this)),this.renderer=this.events.addElement(new w(this)),this.legend=this.events.addElement(new c(this)),this.autoZoom.resetZoom=!0,this.scene.loading=!1,this.navigator.showInitialNodes(),this.finalInitialize()}return n(r,s),r.prototype.createDataObj=function(t){return new A(this,t)},r.prototype.getData=function(t){return s.prototype.getData.call(this,t)},r.prototype.onSettingsChanged=function(t){var e={};this.layer.onSettingsChanged(t),t.navigation&&t.navigation.mode&&(this.events.removeElement(this.navigator),this.navigator=k.CreateNavigator(this),this.events.addElement(this.navigator));var n=!(!t.navigation||!t.navigation.mode&&!t.navigation.initialNodes);if(t.data&&t.data.length){var s=t.data[0];(s.dataFunction||s.format||s.preloaded||s.url||s.randomNodes)&&(n=!0)}n&&(this.navigator.showInitialNodes(),this.autoZoom.resetZoom=!0),t.filters&&(e.filters=!0),t.style&&(e.style=!0),t.layout&&t.layout.mode&&(this.events.removeElement(this.layout),this.layout=i.LayoutBase.ConstructLayout(this),this.events.addElement(this.layout),this.isLayoutFrozen=!1),this.events.notifySceneChanges(e)},r.prototype.save=function(){var t=this.graph.save(),e=this.navigator.save();return JSON.stringify({xy:t,nav:e})},r.prototype.restore=function(t,e){if(t){var i=JSON.parse(t),n=i.xy,s=i.nav;s&&this.navigator.restore(s),n&&this.graph.restore(n),this.autoZoom.resetZoom=!0}},r.prototype.saveNavigation=function(){var t=JSON.stringify(this.navigator.save());return"{}"===t?null:t},r.prototype.restoreNavigation=function(t){this.navigator.restore(JSON.parse(t))},r.prototype.getCurrentNodes=function(){for(var t=[],e=0,i=this.layer.nodes();e<i.length;e++){var n=i[e];n.removed||t.push(n)}return t},r.prototype.getCurrentLinks=function(){for(var t=[],e=0,i=this.layer.links();e<i.length;e++){var n=i[e];n.removed||t.push(n)}return t},r.prototype.getNodeDimensions=function(t){var e;if(e=d.Helpers.isString(t)?this.getNode(t):t,!e)return null;var i=this.scene.toDisplay(e.x,e.y),n=i.x,s=i.y,r=e.hHeight*this.scene.zoom,a=e.hWidth*this.scene.zoom;return{x:n,y:s,radius:r,hwidth:a}},r.prototype.lockNode=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),d.Helpers.isObjectOrArray(t)&&(t=t.id),this.graph.lockNode(t,e,i)},r.prototype.unlockNode=function(t){t.id&&(t=t.id),this.graph.unlockNode(t)},r.prototype.addFocusNode=function(t,e){return t.id&&(t=t.id),this.settings.navigation.autoZoomOnFocus&&(this.scene.autoZoomMode=!0),this.focusNodeStack.push(t),this.navigator.focusNode(t,e,"api")},r.prototype.getLastFocusNode=function(){for(;this.focusNodeStack.length>0;){var t=this.focusNodeStack[this.focusNodeStack.length-1],e=d.Helpers.hasProperty(this.layer.idToNode,t)?this.layer.idToNode[t]:null;if(e&&e.focused)return e;this.focusNodeStack.pop()}if(this.settings.navigation.initialNodes)for(var i=0;i<this.settings.navigation.initialNodes.length;i++){var t=this.settings.navigation.initialNodes[i],e=d.Helpers.hasProperty(this.layer.idToNode,t)?this.layer.idToNode[t]:null;if(e)return e}var n=this.layer.nodes();return n.length>0?n[0]:null},r.prototype.clearFocus=function(){this.navigator.clearFocusNodes("api")},r.prototype.removeFocusNode=function(t){return t.id&&(t=t.id),this.navigator.unfocusNode(t,"api")},r.prototype.expandNode=function(t){return t.id&&(t=t.id),this.navigator.expandNode(t,"api")},r.prototype.collapseNode=function(t){return t.id&&(t=t.id),this.navigator.collapseNode(t,"api")},r.prototype.closeNode=function(t){return t.id&&(t=t.id),this.navigator.closeNode(t,"api")},r.prototype.hideNode=function(t){return t.id&&(t=t.id),this.navigator.hideNode(t,"api")},r.prototype.showNode=function(t){return this.navigator.showNode(t,"api")},r.prototype.getNode=function(t){return this.layer.idToNode[t]},r.prototype.getLink=function(t){return this.layer.idToLink[t]},r.prototype.touchObjects=function(t){for(var e=0;e<t.length;e++){var i=this.layer,n=i.findObjectById(t[e]);n&&i.touchNodeOrLink(n)}},r.prototype.setZoom=function(t,e){this.autoZoom.setZoom(t,e)},r.prototype.resetLayout=function(){this.layout.resetLayout(),this.autoZoom.setZoom("overview",!1),this.events.notifySceneChanges({layout:!0})},r.prototype.removeData=function(t,e){if(void 0===e&&(e="default"),null==e&&(e="default"),!this.removed){var i=this.getData(e),n=i.removeData(t);n.data={},n.data[e]=!0,this.events.notifySceneChanges(n)}},r.prototype.exportData=function(t,e){var i;return i=t?this.graph.exportData():this.scene.mainData.exportData(),e&&this.graph.exportCoordinates(i.nodes),i},r.prototype.hideMenu=function(){this.menu.hideMenu()},r.prototype.createEventArguments=function(t,e){var i=s.prototype.createEventArguments.call(this,t,e),n=this.layer;return n&&(i.nodes=n.nodes(),i.links=n.links()),i},r.prototype.defaultClick=function(t,e){if(!t.shiftKey&&!t.ctrlKey){var i=e.clickNode;i&&this.scene.settings.navigation.expandOnClick&&(i.expanded||(this.expandNode(i.id),t.preventDefault()))}},r.prototype.defaultRightClick=function(t,e){e.clickNode&&(this.scene.mainData.getLinks(e.clickNode.id),this.menu.toggleNodeMenu(e.clickNode),t.preventDefault()),e.clickLink&&(this.menu.toggleLinkMenu(t.x,t.y,e.clickLink),t.preventDefault())},r.prototype.defaultDoubleClick=function(t,e){var i=e.clickNode;i&&(this.addFocusNode(i.id,-1),t.preventDefault())},r.prototype.scrollIntoView=function(t,e){for(var i,n=[],s=0;s<t.length;s++){var r=t[s];r instanceof u.Node?n.push(r):d.Helpers.isString(r)&&(i=this.getNode(r))?n.push(i):this.error("scrollIntoView: the argument is not a node or the ID cannot be found: `"+r+"`.")}this.autoZoom.scrollIntoView(n,e)},r.prototype.freezeLayout=function(){this.isLayoutFrozen||(this.events.removeElement(this.layout),this.isLayoutFrozen=!0,this.events.notifySceneChanges({layout:!0}))},r.prototype.unfreezeLayout=function(){this.isLayoutFrozen&&(this.events.addElement(this.layout),this.isLayoutFrozen=!1,this.events.notifySceneChanges({layout:!0}))},r}(u.Impl);t.Impl=E}(h),function(t){var e=t.Bar||(t.Bar={}),i=t.Series||(t.Series={}),s=t.Renderers||(t.Renderers={}),r=function(t){function e(){t.apply(this,arguments),this.panel=new d.SettingsLegendPanel("bottom","left",void 0,95),this.advanced=new o,this.marker=new a}return n(e,t),e}(d.SettingsLegend);t.SettingsLegend=r;var a=function(t){function e(){t.apply(this,arguments),this.shape=null}return n(e,t),e}(d.SettingsLegendMarker);t.SettingsLegendMarker=a;var o=function(t){function e(){t.apply(this,arguments),this.disabledSeries={fillColor:"rgba(191,187,185,0.3)",lineColor:"rgba(64,62,62,0.3)",textColor:"rgba(64,62,62,0.3)"}}return n(e,t),e}(d.SettingsLegendAdvanced);t.SettingsLegendAdvanced=o;var l=function(t){function e(e,i,n,s,r,a,o){t.call(this,i,n,s,r),this.seriesHovered=!1,this.disabledSeries=o,this.series=e,this.enabled=a}return n(e,t),e.prototype.isHovered=function(){return this.hoverCount>0||this.seriesHovered},e}(d.LegendEntry),h=function(t){function e(e){t.call(this,e),this.paintOrder=75,this.updateOrder=100}return n(e,t),e.prototype.notifyHoveredSeries=function(t){for(var e=0;e<this.entries.length;e++){var i=this.entries[e];i.seriesHovered=i.series.indexOf(t)>=0}},e.prototype.getLastHoveredSeries=function(){var t=this.getLastHoveredEntry();return t?t.series[0]:null},e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=e.changes;i.linearChartSeries&&(this.rebuildItems(e),i.bounds=!0)},e.prototype.paintMarker=function(t,e,i,n,r){var a=t.context,o=r.isEnabled()?r.series[0]:r.disabledSeries,l=this.settings.marker,h=o.style.legend.marker,u=h.shape||l.shape;if(a.beginPath(),u){var c={fillColor:h.fillColor||o.style.fillColor||o.style.lineColor,lineColor:h.lineColor||l.lineColor,lineWidth:h.lineWidth||1};null!=h.width&&(n=h.width/2),d.Graphics.strokeMarker(a,u,e,i,n),d.Graphics.paint(a,c)}else{var p=l.size,f=e-p/2,g=e,m=e+p/2,v=p/2.1,y=p/2,S=3*p/4,b=i+p/2;if(o instanceof x){var L=o.style.marker.width;o.style.marker.width*=.8;var A=[[v,y,S]],T=[f,g,m],M=[T,[b-v,b-y,b-S]],k=b-y,P=new s.Line(null,[o]);P.paintLines(a,[o],[{markerY:null,segments:M}],T,[null],A,b),P.paintMarkers(a,o,[g],[y],[k]),o.style.marker.width=L}else if(o instanceof C){var A=[p,p],I=new s.Columns(this.chart.scene,[o]);I.paintStack(t,[e],[p/2],[A],[null],b)}else if(o instanceof w){var D=new s.Candlestick(this.chart.scene,[o]),F=[[0],[p/3],[2*p/3],[p]];D.paintStack(t,[e],[p/2],F,[null],b)}}},e.prototype.rebuildItems=function(t){for(var e=[],n=this.chart.scene.settings._computedSeries,s=this.settings.advanced.disabledSeries,r={},a=this.settings.text.fillColor,o=0;o<n.length;o++){var h=n[o];if(h.showInLegend){var u=void 0;if(h instanceof w){if(d.Helpers.hasProperty(r,h.stack)){r[h.stack].push(h);continue}u=[h],r[h.stack]=u}else u=[h];var c=h.nameLegend||h.name||this.chart.settings.localization.unnamedSeries,p=d.Helpers.realClone(h),f=p.style;f.fillColor=f._currentFillStyle=f.fillColor&&s.fillColor,f._currentFillStyleKey=null,f.fillPattern&&(f._fillPatternOpacity=.3,i.Stack.computeFillPattern(this.chart,t.context,f)),f.lineColor=s.lineColor;var g=f.legend.marker;g.fillColor=g.fillColor&&s.fillColor,g.lineColor=g.lineColor&&s.lineColor,e.push(new l(u,c,h.style.legend.textColor||a,s.textColor,h.legendGroupId,h.enabled,p))}}this.resetEntries(e)},e.prototype.itemClicked=function(e,i){t.prototype.itemClicked.call(this,e,i);for(var n=0;n<this.entries.length;n++)for(var s=this.entries[n],r=0;r<s.series.length;r++)s.series[r].enabled=s.enabled;this.chart.events.notifySceneChanges({linearChartSeries:!0})},e}(d.Legend);t.Legend=h;var u=function(){function t(){this.enabled=!0,this.logScale=!1,this.position="outside",this.side="left",this.title=null,this.minValue=null,this.maxValue=null,this.size=null,this.hgrid=null,this.axisLine=!1,this.scaleAdjustmentTolerance=.3,this.scaleAdjustmentAnimationDelay=200,this.scaleAdjustmentAnimation="=",this.scaleStep=null,this.scaleMinStep=0,this.zeroLine="visible",this.valueFormatterFunction=null,this.style={title:{textStyle:{fillColor:"#000000",font:"13px Arial"},reverseDirection:!1,align:"center",margin:5},tick:{lineColor:"#AAAAAA"},axisLine:{lineColor:"rgba(127,127,127,0.5)",lineWidth:1},valueLabel:{textStyle:{fillColor:"#000000",font:"11px Arial"},margin:0},labelSpacing:25,baseLine:{lineColor:"rgba(127,127,127,0.5)",depthColor:"rgba(127,127,127,0.5)",lineWidth:1,lineDepth:0,showLabel:1},hgrid:{lineColor:"rgba(255,255,255,0.2)"}},this.thresholds=[]}return t}();t.SettingsValueAxis=u;var c=function(){function t(){this.from=-(1/0),this.to=1/0,this.position="under",this.style={fillColor:"rgba(255,133,152,0.2)",lineColor:"rgba(255,0,0,0.5)",lineWidth:1,lineDash:null}}return t}();t.SettingsValueAxisThreshold=c;var p=function(){function t(t,e){var i=this;this.locations=[],this.values=[],this.labels=[],this.title=null,this.cachedUnits={lin:[],log:[]},this.isPrimary=!1,this._chart=t,this.options=e,this.events=t.events,this.scene=t.scene,this.isLogScale=this.options.logScale,this.isInside="inside"===this.options.position,this.panel=new d.ChartPanel,this.panel.packingOrder=110,this.panel.computeSize=function(t,e,n,s){return i.computePanelSize(t,e,n,s)},this.lastMaxValue=0,this.lastMinValue=0,this.minValue=0,this.maxValue=0,this.scale=0,this.zeroY=0,this.logOffset=1,this.minValueAnimation=null,this.maxValueAnimation=null,this.axisChanged=!1,this.seriesDepth=0,this.seriesMinValue=null,this.seriesMaxValue=null,this.series=0,this.createTitle()}return t.prototype.createTitle=function(){var t=this.options,e=t.style.title,i=this.title=new d.Label(e);i.text=t.title,i.allowCache=!1;var n=i.style.angle;null==n&&(n="right"===t.side?90:-90),e.reverseDirection&&(n=-n),i.style.angle=n},t.prototype.getPanel=function(){var t=this.options;return t.enabled?(this.panel.location=t.position,this.panel.side=t.side,this.panel):null},t.prototype.setPanel=function(t){null!=t&&(this.panel=t)},t.prototype.computePanelSize=function(t,e,i,n){if(!this._chart.assetsLoaded)return{width:0,height:0};var s=8,r=this.title;r&&(r.style.maxWidth=e);var a=this.options;if(a.size)s=a.size;else{var o=a.style.valueLabel,l="9999 M";a.valueFormatterFunction?l=a.valueFormatterFunction(1e7-1-2e-4,"M",1e6,l)||l:s++,s+=2*o.margin+d.Graphics.getTextWidth(i,o.textStyle,l),r&&r.text&&(n.measure(i,r),s+=2*(r.style.margin+r.hheight))}return{width:Math.ceil(s),height:e}},t.prototype.receiveSeriesGeometry=function(t,e,i){null!==this.options.minValue?this.seriesMinValue=this.options.minValue:void 0!==t&&(null!==this.seriesMinValue?this.seriesMinValue=Math.min(t,this.seriesMinValue):this.seriesMinValue=t),null!==this.options.maxValue?this.seriesMaxValue=this.options.maxValue:void 0!==e&&(null!==this.seriesMaxValue?this.seriesMaxValue=Math.max(e,this.seriesMaxValue):this.seriesMaxValue=e),this.seriesDepth=Math.max(i,this.seriesDepth)},t.prototype.updateMinMax=function(t){var e=t.changes,i=e.bounds||e.assets||0===this.locations.length;e.settings&&(this.isLogScale=this.options.logScale,this.isInside="inside"===this.options.position,i=!0),this.shouldChangeScale()&&(this.seriesMinValue!==this.lastMinValue&&(i=!0,null===this.lastMinValue||e.displayUnit||this.minValue===this.maxValue?this.minValueAnimation=null:this.minValueAnimation?this.minValueAnimation.retarget(this.seriesMinValue,t.timeStamp):this.minValueAnimation=new d.Animator(this.lastMinValue,this.seriesMinValue,this.options.scaleAdjustmentAnimationDelay,this.options.scaleAdjustmentAnimation,t.timeStamp),this.lastMinValue=this.seriesMinValue),this.seriesMaxValue!==this.lastMaxValue&&(i=!0,null===this.lastMaxValue||e.displayUnit||this.minValue===this.maxValue?this.maxValueAnimation=null:this.maxValueAnimation?this.maxValueAnimation.retarget(this.seriesMaxValue,t.timeStamp):this.maxValueAnimation=new d.Animator(this.lastMaxValue,this.seriesMaxValue,this.options.scaleAdjustmentAnimationDelay,this.options.scaleAdjustmentAnimation,t.timeStamp),this.lastMaxValue=this.seriesMaxValue)),this.seriesMaxValue=this.options.minValue,this.seriesMinValue=this.options.maxValue;var n,s;this.minValueAnimation?(i=!0,n=this.minValueAnimation.get(t.timeStamp),this.minValueAnimation.finished(t.timeStamp)&&(this.minValueAnimation=null)):n=this.lastMinValue,this.maxValueAnimation?(i=!0,s=this.maxValueAnimation.get(t.timeStamp),this.maxValueAnimation.finished(t.timeStamp)&&(this.maxValueAnimation=null)):s=this.lastMaxValue,
  44. this.axisChanged=i,i&&this.computeNewScale(n,s),(this.minValueAnimation||this.maxValueAnimation)&&(t.animating=!0)},t.prototype.doAnimations=function(t){if(this.axisChanged&&this._chart.assetsLoaded){this.axisChanged=!1;var e=this.options;if(e.enabled){this.locations=[],this.values=[];var i,n="right"===e.side,s=this.scene.y0,r=s+this.scene.height;if(this.scale<=0){i=e.scaleStep?e.scaleStep:100;var a=e.style.labelSpacing,o=r-a,l=1;for(e.logScale||(l=i);o>s;)this.locations.push(o),this.values.push(l),e.logScale?l*=10:l+=i,o-=a}else{if(this.fontHeight||(this.fontHeight=1.4*d.Graphics.getTextHeight(t.context,e.style.valueLabel.textStyle.font)||0),0===s&&(s+=this.fontHeight/2),this.scene.bottomAxisSize<this.fontHeight&&(r-=this.fontHeight/2),this.isLogScale){for(var h=this.calcExpValuePerLine(),u=h.unit,c=h.valueMultiplier,p=1/u;;){p*=c;var f=this.zeroY-this.valueToRelativeY(p);if(f<=s)break;f>=r||(this.locations.push((0|f)-.5),this.values.push(p))}for(p=-1/u;;){p*=c;var f=this.zeroY-this.valueToRelativeY(p);if(f>=r)break;this.locations.push((0|f)-.5),this.values.push(p)}}else{i=this.calcLinearValuePerLine();var p=0;for(e.scaleStep&&(i=Math.max(i,this.fontHeight/this.scale));;){p+=i;var f=this.zeroY-this.valueToRelativeY(p);if(f<=s)break;f>=r||(this.locations.push(0|f),this.values.push(p))}for(p=0;;){p-=i;var f=this.zeroY-this.valueToRelativeY(p);if(f>=r)break;this.locations.push(0|f),this.values.push(p)}}var g=this.minValue,m=this.maxValue;if(g<=0&&m>=0){var v=e.style.baseLine.showLabel;(2===v||1===v&&(g<0||!this.isInside&&0===g))&&(this.locations.push(0|this.zeroY),this.values.push(0))}}var y,S,b,C=e.valueFormatterFunction;if(!this.isLogScale){var x=this.getUnitAndName(i,this.scene.settings);y=x.unit,S=x.digitsAfterComma,b=x.name}for(var w=0;w<this.values.length;w++){var p=this.values[w];if(this.isLogScale){var x=this.getUnitAndName(p,this.scene.settings);y=x.unit,S=x.digitsAfterComma,b=x.name}var L=(p/y).toFixed(S);p&&(L=L+" "+b),C&&(L=C(p,b,y,L));var A=new d.Label(e.style.valueLabel);A.text=L.toString(),this.isInside||(A.style.align=n?"left":"right"),this.labels[w]=A}}}},t.prototype.paintUnder=function(t){var e=this.options;if(e.enabled){var i=t.context;if(e.thresholds)for(var n=0;n<e.thresholds.length;n++){var s=e.thresholds[n];"under"===s.position&&this.paintThreshold(i,s)}this.paintZeroLineDepth(i)}},t.prototype.paint=function(t){var e=this.options;if(e.enabled){var i=t.context;if(e.thresholds)for(var n=0;n<e.thresholds.length;n++){var s=e.thresholds[n];"above"===s.position&&this.paintThreshold(i,s)}if(this.locations.length>0&&(this.paintGrid(i),this.paintZeroLine(i),this.paintLabels(i,t.labelRenderer)),e.axisLine){var r=d.Graphics.beginStrokeAndFill(i,e.style.axisLine);this.paintAxisLine(r),d.Graphics.endStrokeAndFill(i,r,e.style.axisLine)}}},t.prototype.shouldChangeScale=function(){var t=this.seriesMinValue,e=this.seriesMaxValue;if(null===t||null===e)return!1;if(null===this.lastMinValue||null===this.lastMaxValue||!(this.lastMinValue<this.lastMaxValue))return!0;if("center"===this.options.zeroLine?(e=Math.max(e,-t),t=-e):"visible"===this.options.zeroLine&&(t=Math.min(t,0),e=Math.max(e,0)),t<this.minValue||e>this.maxValue)return!0;var i=(this.lastMaxValue-this.lastMinValue)*this.options.scaleAdjustmentTolerance;return t>this.lastMinValue+i||e<this.lastMaxValue-i},t.prototype.computeNewScale=function(t,e){var i=this.scene.height,n=this.scene.y0;if("center"===this.options.zeroLine?(e=Math.max(e,-t),t=-e):"visible"===this.options.zeroLine&&(t=Math.min(t,0),e=Math.max(e,0)),null!==this.options.minValue&&(t=this.options.minValue),null!==this.options.maxValue&&(e=this.options.maxValue),!(i>0&&t<e))return this.minValue=0,this.maxValue=0,this.logOffset=1,this.scale=0,void(this.zeroY=n+i);var s=0;this.options.scaleStep>0?s=this.options.scaleStep:this.options.scaleMinStep>0&&(s=this.options.scaleMinStep),s>0&&(t<0&&(t=Math.floor(t/s)*s),e>0&&(e=Math.ceil(e/s)*s));var r=e-t;if(0!==t&&t!==-100)if(this.isLogScale)t=d.Helpers.sign(t)*Math.pow(Math.abs(t),1-d.Helpers.sign(t)*this.options.scaleAdjustmentTolerance);else{var a=t-r*this.options.scaleAdjustmentTolerance;t>0?t=Math.max(0,a):t<0&&(t=Math.min(0,a))}if(0!==e&&100!==e)if(this.isLogScale)e=d.Helpers.sign(e)*Math.pow(Math.abs(e),1+d.Helpers.sign(e)*this.options.scaleAdjustmentTolerance);else{var o=e+r*this.options.scaleAdjustmentTolerance;e>0?e=Math.max(0,o):e<0&&(e=Math.min(0,o))}null!==this.options.minValue&&(t=this.options.minValue),null!==this.options.maxValue&&(e=this.options.maxValue),this.minValue=t,this.maxValue=e;var l;this.isLogScale?t<=0&&e>=0?(this.logOffset=1,l=Math.log(e+this.logOffset)+Math.log(-t+this.logOffset)):t<0?(this.logOffset=1-t,l=Math.log(-t+this.logOffset)):e>0&&(this.logOffset=1+e,l=Math.log(e+this.logOffset)):l=e-t,this.scale=i/l;var h=this.valueToRelativeY(t);this.zeroY=n+i+h},t.prototype.valueToRelativeY=function(t){return this.isLogScale?t>0?this.scale*Math.log(t+this.logOffset):t<0?-this.scale*Math.log(-t+this.logOffset):0:this.scale*t},t.prototype.calcLinearValuePerLine=function(){if(this.options.scaleStep)return this.options.scaleStep;var t=this.options.style.labelSpacing/this.scale,e=Math.log(t)/Math.log(10),i=Math.pow(10,Math.floor(e-1));for(i=Math.max(i,this.options.scaleMinStep);i<t;){if(2*i>=t)return 2*i;if(i>10&&2.5*i>=t)return 2.5*i;if(5*i>=t)return 5*i;i*=10}return i},t.prototype.calcExpValuePerLine=function(){var t=this.valueToRelativeY(10)-this.valueToRelativeY(1),e=10,i=10,n=t;if(n>4*this.options.style.labelSpacing)return{unit:2,valueMultiplier:2};for(;n<this.options.style.labelSpacing;)e*=10,n+=t;return{unit:i,valueMultiplier:e}},t.prototype.getUnitAndName=function(t,e){t=Math.abs(t);var i=this.isLogScale?this.cachedUnits.log:this.cachedUnits.lin,n=1,s="";if(i[t])return i[t];for(var r in e.localization.valueUnits){var a=e.localization.valueUnits[r],o=Math.abs(t/a);if(this.isLogScale)t===Math.round(t/a)*a&&n<a&&(n=a,s=r);else if(o<1e3&&o>=1){n=a,s=r;break}}var l=0;if(t>0)for(var h=1;t<h;)l+=1,h/=10;return i[t]={unit:n,digitsAfterComma:l,name:s}},t.prototype.paintGrid=function(t){if(this.options.hgrid!==!1&&(null!=this.options.hgrid||this.isPrimary)){var e=this.options.style.hgrid.lineColor;this.options.style.hgrid.lineWidth=1,d.Graphics.clearShadow(t);for(var i=d.Graphics.beginStrokeAndFill(t,this.options.style.hgrid),n=this.scene.x0,s=this.scene.x0+this.scene.width,r=0;r<this.locations.length;r++){var a=this.locations[r];0!==this.values[r]&&(i.moveTo(n,a+.5),i.lineTo(s,a+.5))}d.Graphics.endStrokeAndFill(t,i,this.options.style.hgrid);var o=d.Colors.colorTone(e,.5,.5);if(o.opacity<.3){this.options.style.hgrid.lineColor=o.color,i=d.Graphics.beginStrokeAndFill(t,this.options.style.hgrid);for(var r=0;r<this.locations.length;r++){var a=this.locations[r];0!==this.values[r]&&(i.moveTo(n,a-.5),i.lineTo(s,a-.5))}d.Graphics.endStrokeAndFill(t,i,this.options.style.hgrid),this.options.style.hgrid.lineColor=e}}},t.prototype.paintAxisLine=function(t){var e,i=this.options.side,n=this.panel.left,s=this.panel.right,r=this.scene.y0+this.scene.height;this.isInside?("right"===i&&(e=n),"left"===i&&(e=s)):e="right"===i?n-.5:s+.5,t.moveTo(e,this.scene.y0),t.lineTo(e,r)},t.prototype.paintZeroLineDepth=function(t){if(!(this.zeroY>this.scene.chartHeight)){var e=this.options.style.baseLine,i=Math.max(e.lineDepth,this.seriesDepth);if(i>0){var n=d.Graphics.beginStroke(t,this.options.style.baseLine),s=this.scene.x0,r=s+this.scene.width,a=Math.round(this.zeroY)-.5*(e.lineWidth||1);n.moveTo(s,a),n.lineTo(s+i,a-i),n.lineTo(r,a-i),n.lineTo(r,a),t.fillStyle=e.depthColor,t.fill(),d.Graphics.endStroke(t,n,e)}}},t.prototype.paintZeroLine=function(t){if(!(this.zeroY>this.scene.chartHeight)){var e=this.options.style.baseLine,i=this.scene.x0,n=i+this.scene.width,s=Math.round(this.zeroY)-.5*(e.lineWidth||1),r=d.Graphics.beginStroke(t,e);r.moveTo(i,s),r.lineTo(n,s),d.Graphics.endStroke(t,r,e)}},t.prototype.paintThreshold=function(t,e){if(0!==this.scale){var i=this.scene.x0,n=this.scene.x0+this.scene.width,s=this.scene.y0,r=s+this.scene.height,a=this.zeroY-this.valueToRelativeY(e.from),o=this.zeroY-this.valueToRelativeY(e.to);a=a>=r-.5?(0|r)+.5:(this.zeroY-this.valueToRelativeY(e.from)|0)-.5,o=o<=s-.5?(0|s)+.5:(this.zeroY-this.valueToRelativeY(e.to)|0)-.5,e.style.fillColor&&(t.fillStyle=e.style.fillColor,t.beginPath(),t.rect(i,o,this.scene.width,a-o),t.fill(),t.closePath());var l=d.Graphics.beginStroke(t,e.style);a-.5!==r&&(l.moveTo(i,a),l.lineTo(n,a)),o-.5!==s&&(l.moveTo(i,o),l.lineTo(n,o)),d.Graphics.endStroke(t,l,e.style)}},t.prototype.paintLabels=function(t,e){if(this._chart.assetsLoaded){var i=this.scene,n=this.panel.left,s=this.panel.right,r="right"===this.options.side,a=this.title;if(this.options.title&&a){var o=i.y0,l=i.height,h=a.hheight,u=a.style.margin||0,c=o+.5*l,p=void 0;r?(p=s-u-h,s-=h+2*u):(p=n+u+h,n+=h+2*u),e.paint(t,p,c,1,a)}var f,g=(n+s)/2;if(f=r?n:s-4,!this.isInside){t.beginPath();for(var m=0;m<this.locations.length;m++){var v=this.locations[m];t.moveTo(f,v),t.lineTo(f+4,v)}d.Graphics.stroke(t,this.options.style.tick)}for(var y=0;y<this.locations.length;y++){var S=this.locations[y],b=this.labels[y],C=void 0;e.measure(t,b),C=this.isInside?g:r?f+b.hwidth+7:f-b.hwidth-3,C=Math.min(C,i.chartLeft+i.chartWidth-b.hwidth),C=Math.max(C,i.chartLeft+b.hwidth),e.paint(t,C,S,1,b)}}},t}();t.ValueAxis=p,function(t){var e=function(){function t(t,e){this.series=e,this.scene=t,this.prevy=[]}return t.prototype.paintStack=function(t,e,i,n,s,r,a){if(this.zeroY=r,e.length>0){var o=this.series,l=this.prevy;l.length<e.length&&(l=this.prevy=new Array(e.length));for(var h=0;h<=e.length-1;h++)l[h]=r;for(var u=0;u<o.length;u++){var c=o[u],d=s[u],p=a&&a.length?a[u]:null;this.plainColumns(t,c.style,e,i,l,n,d,u,p)}}},t.prototype.hitTest=function(t,e,i,n,s,r,a,o){var l=t.length;if(!(l>1))return{result:null,distance:1/0};var h=this.series,u=d.Helpers.binSearch(t,r),c=t[u]-e[u],p=t[u]+e[u];if(c>r&&u>0){var f=t[u-1]-e[u-1],g=t[u-1]+e[u-1];(g>r||Math.abs(g-r)<Math.abs(c-r))&&(u-=1,c=f,p=g)}for(var m=null,v=1/0,y=s,S=0;S<h.length;S++){var b=i[S][u];if(d.Helpers.isNumber(b)){var C=y-b,x=Math.min(y,C),w=Math.max(y,C),L=d.Geometry.distanceToRect(r,a,c,x,p,w);L<v&&(v=L,m={x0:c,y0:x,x1:p,y1:w,seriesIndex:S,isMarker:!1}),y=C}}return{result:m,distance:v}},t.prototype.plainColumns=function(t,e,i,n,s,r,a,o,l){for(var h,u,c,p,f,g=t.context,m=this.scene.y0,v=this.scene.height,y=e.minHeight,S=m+v,b=r[o],C=null,x=0;x<i.length;x++){var w=i[x],L=b[x];if(d.Helpers.isNumber(L)){var A=n[x],T=s[x],M=T-L;s[x]=M;var k=w-A,P=A+A,I=void 0,D=void 0,F=void 0;if(T<M){I=Math.max(M-T,y),D=T;for(var N=!0,E=o-1;E>0;){if(null!==r[E][x]){N=!1;break}E--}F=N}else{if(!(T>M))continue;I=Math.max(T-M,y),D=T-I;for(var z=!0,E=o+1;E<r.length;){if(null!==r[E][x]){z=!1;break}E++}F=z}var O=a?a[x]||e:e;if(C!==O){C=O,f=C.lineColor?C.lineWidth:0,u=C.shadowColor,h=C.depth,c=C._currentFillStyle;var H=C.gradient,_=d.Helpers.isString(c);if(_&&h?(p=C.fillColor,d.Helpers.isNumber(C.depthBrightness)&&(p=d.Colors.derive(p,C.depthBrightness,1))):p=null,H&&1!==H&&_){var R=g.createLinearGradient(0,S,0,S-2*v/3);R.addColorStop(0,d.Colors.derive(c,H,1)),R.addColorStop(1,c),c=R}g.fillStyle=c}if(p&&(g.beginPath(),d.Graphics.applyShadow(g,C),F?(g.moveTo(k+h,D-h),g.lineTo(k+P+h,D-h),g.lineTo(k+P+h,D+I-h),g.lineTo(k+P,D+I),g.lineTo(k+P,D),g.lineTo(k,D)):(g.moveTo(k+P,D),g.lineTo(k+P+h,D-h),g.lineTo(k+P+h,D+I-h),g.lineTo(k+P,D+I),g.lineTo(k+P,D)),g.closePath(),g.fillStyle=p,g.fill(),d.Graphics.clearShadow(g),g.fillStyle=c),!p&&u&&d.Graphics.applyShadow(g,C),c&&(g.fillRect(k,D,P,I),!p&&u&&d.Graphics.clearShadow(g)),f>0){D+=f/2,k+=f/2,P-=f,I-=f;var B=d.Graphics.beginStroke(g,C);P>0?I>0?(B.moveTo(k,D),B.lineTo(k+P,D),B.lineTo(k+P,D+I),B.lineTo(k,D+I),B.lineTo(k,D)):f>0&&(g.moveTo(k,T),g.lineTo(k+P,T)):f>0&&(g.moveTo(w,D),g.lineTo(w,D+I)),d.Graphics.endStroke(g,B,C)}c||p||!u||d.Graphics.clearShadow(g);var U=C.previewLineColor;if(l&&l[x]){g.beginPath();for(var V=0,G=M-T,W=l[x],j=0;j<W.length;j++){var Y=W[j];V+=Y,L=T+V*G,g.moveTo(k,L),g.lineTo(k+P,L)}g.lineWidth=1,g.strokeStyle=U,g.stroke()}}}},t}();t.Columns=e;var i=function(){function t(t,e){this.stack=t,this.series=e,this.seriesData=[];for(var i=0;i<e.length;i++)this.seriesData.push({markerY:[],segments:[]});this.prevyL=[],this.prevyR=[]}return t.prototype.paintStack=function(t,e,i,n,s,r){if(0!==e.length){var a=t.context;this.paintLines(a,this.series,this.seriesData,e,i,n,r);for(var o=0;o<this.series.length;o++){var l=this.series[o];l.style.markerStyleFunction?this.paintCustomMarkers(a,l,e,n[o],this.seriesData[o].markerY):this.paintMarkers(a,l,e,n[o],this.seriesData[o].markerY)}}},t.prototype.paintLines=function(t,e,i,n,s,r,a){this.computeLineSegments(n,s,a,r);for(var o=[[-(1/0),0,1/0],[a,a,a]],l=0;l<e.length;l++){var h=e[l];this.paintLine(t,h.style,o,i[l].segments,a),l<e.length-1&&(o=this.mergePreviousSegments(o,this.seriesData[l].segments))}},t.prototype.mergePreviousSegments=function(t,e){for(var i=[],n=[],s=0,r=t[0],a=t[1],o=0;o<e.length;o+=2){for(var l=e[o],h=e[o+1];r[s]<=l[0];)i.push(r[s]),n.push(a[s]),s++;for(r[s-1]!==l[0]&&(i.push(l[0]),n.push(a[s-1])),i.push.apply(i,l),n.push.apply(n,h);r[s]<l[l.length-1];)s++;l[l.length-1]!==r[s]&&(i.push(l[l.length-1]),n.push(a[s]))}for(;s<r.length;)i.push(r[s]),n.push(a[s]),s++;return[i,n]},t.prototype.paintCustomMarkers=function(t,e,i,n,s){var r=e.style.markerStyleFunction(this.stack.externalItems(),n);if(!r||r.length!==n.length)return void d.Helpers.error("markerStyleFunction() must return an array with the same number of elements as the input arrays.");for(var a=e.style.marker,o=0;o<n.length;o++){var l=r[o];l&&l.shape&&(l.fillColor||(l.fillColor=a.fillColor||e.style.lineColor||e.style.fillColor),l.width||(l.width=a.width||10),t.beginPath(),d.Graphics.strokeMarker(t,l.shape,i[o],s[o],l.width/2),d.Graphics.paint(t,l))}},t.prototype.paintMarkers=function(t,e,i,n,s){var r=e.style.marker;if(r.shape){var a={fillColor:r.fillColor||e.style.lineColor||e.style.fillColor,lineColor:r.lineColor,lineWidth:r.lineWidth},o=r.width/2,l=r.shape;t.beginPath();for(var h=0;h<n.length;h++){var u=n[h];null!==u&&d.Graphics.strokeMarker(t,l,i[h],s[h],o)}d.Graphics.paint(t,a)}},t.prototype.hitTest=function(t,e,i,n,s,r,a,o){var l=this.series,h=t.length;if(0===h)return{result:null,distance:1/0};for(var u=Math.min(d.Helpers.binSearch(t,r),h-2),c=null,p=1/0,f=s-a,g=0;g<l.length;g++){for(var m=l[g],v=m.style,y=this.seriesData[g],S=Math.max(0,u-2);S<Math.min(h,u+3);S++){var b=i[g][S];if(null!==b&&v.marker){var C=t[S],x=y.markerY[S],w=v.marker.width/2,L=r-C,A=a-x,T=Math.sqrt(L*L+A*A);T<w+o&&p>T-w&&(p=T-w,c={x0:C,y0:x,x1:C,y1:x,seriesIndex:g,isMarker:!0})}}for(var M=null,k=y.segments,S=0;S<k.length;S+=2)for(var P=k[S],I=k[S+1],D=P[0],F=1;F<P.length;F++){var N=P[F];if(D<=r+o&&N>=r-o){var E=I[F-1],z=I[F],O=Math.sqrt(d.Geometry.distanceToSegmentSq(D,E,N,z,r,a));O<o&&O<=p&&(p=O,c={x0:D,y0:E,x1:N,y1:z,seriesIndex:g,isMarker:!1})}if(D<=r&&N>=r){var E=I[F-1],z=I[F],H=d.Geometry.lineIntersectsSegment(r,a,0,1,D,E,N,z);H!==1/0&&(M=H)}D=N}null!==M&&(d.Helpers.sign(M)!==d.Helpers.sign(f)&&(v.fillColor||v.fillGradient)&&p>=0&&(p=0,c={x0:0,y0:0,x1:1,y1:1,seriesIndex:g,isMarker:!1}),f=M)}return{result:c,distance:Math.max(p,0)}},t.prototype.computeLineSegments=function(t,e,i,n){var s=t.length,r=this.prevyL,a=this.prevyR;r.length<s&&(r.length=s,a.length=s);for(var o=0;o<s;o++)r[o]=i,a[o]=i;for(var l=r,h=0;h<this.series.length;h++){var u=this.series[h],c=this.seriesData[h];if(c.segments.length=0,c.markerY.length<s&&(c.markerY.length=s),u.style.steps){var d=this.buildStepSegments(t,e,i,r,a,l,n[h],u.data.noDataPolicy);c.segments=d.segments,c.markerY=d.markerY}else{var p=this.buildLineSegments(t,i,r,a,l,n[h],u.data.noDataPolicy);if(c.segments=p.segments,c.markerY=p.markerY,u.style.smoothing)for(var f=0;f<c.segments.length;f+=2){var g=this.smoothLine(c.segments[f],c.segments[f+1]);c.segments[f]=g.x,c.segments[f+1]=g.y}}l=c.markerY}},t.prototype.buildLineSegments=function(t,e,i,n,s,r,a){var o=[],l=[],h=[];if("zero"===a){for(var u=0;u<t.length;u++){var c=t[u],d=r[u],p=i[u],f=n[u];null!==d?(o.push(s[u]-d),l.push(c),h.push(p-d),p!==f&&(l.push(c),h.push(f-d)),i[u]-=d,n[u]-=d):(o.push(s[u]),p!==f?(h.push(p),h.push(f),l.push(c),l.push(c)):(h.push(p),l.push(c)))}return{segments:[l,h],markerY:o}}if("join"===a){for(var g=null,u=0;u<t.length;u++){var c=t[u],d=r[u],p=i[u],f=n[u];if(null!==d){if(null===g)o.push(s[u]-d),l.push(c),h.push(f-d),n[u]-=d;else{if(g<u-1)for(var m=r[g],v=t[g],y=(d-m)/(c-v),S=g+1;S<u;S++){var b=t[S],C=m+y*(b-v);o.push(s[S]-C);var x=i[S],w=n[S];l.push(b),h.push(x-C),x!==w&&(l.push(b),h.push(w-C)),i[S]-=C,n[S]-=C}o.push(s[u]-d),l.push(c),h.push(p-d),p!==f&&(l.push(c),h.push(f-d)),i[u]-=d,n[u]-=d}g=u}else null===g&&o.push(s[u])}return l.length>2&&l[l.length-1]===l[l.length-2]&&(l.pop(),h.pop()),{segments:[l,h],markerY:o}}for(var L=!1,A=[],u=0;u<t.length;u++){var c=t[u],d=r[u],p=i[u],f=n[u];null!==d?(o.push(s[u]-d),L?(l.length>1&&i[u-1]!==n[u-1]&&(l.push(t[u-1]),h.push(n[u-1])),l.push(c),h.push(p-d),i[u]-=d,n[u]-=d):(l.push(c),h.push(f-d),n[u]-=d),L=!0):(o.push(s[u]),L&&(l.length>0&&(1===l.length&&(l.push(l[0]),h.push(h[0])),A.push(l,h),l=[],h=[]),n[u-1]+=r[u-1]),L=!1)}return l.length>0&&(1===l.length&&(l.push(l[0]),h.push(h[0])),A.push(l,h)),{segments:A,markerY:o}},t.prototype.buildStepSegments=function(t,e,i,n,s,r,a,o){for(var l=[],h=[],u=[],c=[],d=null,p=0,f=0;f<t.length;f++){var g=t[f]-e[f],m=a[f];if(null!==m){null!==d&&(u.push(g),c.push(d));var v=r[f]-m;u.push(g),c.push(v),d=v,p=g+2*e[f],h.push(v),n[f]=s[f]=v}else if("zero"===o){var v=r[f];h.push(v),s[f]=n[f]=v,null!==d&&(u.push(p),c.push(d)),u.push(g),c.push(v),d=v,p=g+2*e[f]}else if("join"===o){var v=null!==d?d:r[f];h.push(v),s[f]=n[f]=v}else{var v=r[f];h.push(v),s[f]=n[f]=v,u.length>0&&(null!==d&&(u.push(p),c.push(d)),d=null,l.push(u,c),u=[],c=[])}}return u.length>0&&(null!==d&&(u.push(p),c.push(d)),l.push(u,c)),{segments:l,markerY:h}},t.prototype.smoothLine=function(t,e){var i=t[0],n=t[t.length-1],s=(n-i)/t.length;if(s<2)return{x:t,y:e};var r=[],a=[];r.push(i),a.push(e[0]);for(var o=0;o+1<t.length;){var l=o+1;if(t[o]!==t[l])for(;l+1<t.length&&t[l]!==t[l+1];)l+=1;if(l-o===1)r.push(t[l]),a.push(e[l]);else{var h=new d.MonotoneCurve(t,e,o,l+1);n=t[o];for(var u=o+1;u<=l;u++){i=n,n=t[u];var c=e[u];s=n-i;for(var p=Math.ceil(Math.min(50,Math.max(2,s/3))),f=s/p,g=r.length;(i+=f)<n;)r.push(i);h.interpolateArray(u-1,r,g,r.length,a),r.push(n),a.push(c)}h.clear()}o=l}return t.length=0,e.length=0,{x:r,y:a}},t.prototype.paintLine=function(t,e,i,n,s){if(e._currentFillStyle){e.shadowColor&&d.Graphics.applyShadow(t,e),t.fillStyle=e._currentFillStyle,t.beginPath();for(var r=0;r<n.length;r+=2)this.paintArea(t,n[r],n[r+1],i,s);t.fill(),e.shadowColor&&d.Graphics.clearShadow(t)}if(e.lineColor){!e.fillColor&&e.shadowColor&&d.Graphics.applyShadow(t,e);for(var a=d.Graphics.beginStroke(t,e),r=0;r<n.length;r+=2){var o=n[r],l=n[r+1];a.moveTo(o[0],l[0]);for(var h=1;h<o.length;h++)a.lineTo(o[h],l[h])}d.Graphics.endStroke(t,a,e),!e.fillColor&&e.shadowColor&&d.Graphics.clearShadow(t)}},t.prototype.paintArea=function(t,e,i,n,s){t.moveTo(e[0],i[0]);for(var r=1;r<e.length;r++)t.lineTo(e[r],i[r]);for(var a=e[0],o=e[e.length-1],l=s,h=o,u=n.length-2;u>=0;u+=-2){var c=n[u],d=n[u+1];if(!(c.length<2||c[0]>h||c[c.length-1]<a)){var p=c.length-1,f=c[p];f<h&&(t.lineTo(h,l),t.lineTo(f,l),h=f);var r=void 0,g=void 0;for(r=p;r>=0;r--){if(g=c[r],h===f)t.lineTo(f,d[r+1]),h=g;else if(h<f&&h>g){var m=d[r],v=d[r+1],y=(h-g)/(f-g),S=m+y*(v-m);t.lineTo(h,S),h=g}if(h<=a){h=a;var m=d[r],v=d[r+1],y=(h-g)/(f-g),S=m+y*(v-m);t.lineTo(h,S);break}f=g}r===-1&&h===g&&t.lineTo(h,d[0])}}h!==a&&(t.lineTo(h,l),t.lineTo(a,l)),t.closePath()},t}();t.Line=i;var n=function(){function t(t,e){this.series=e,this.scene=t,this.prevy=[]}return t.prototype.paintStack=function(t,e,i,n,s,r){if(e.length>0){var a=this.series[0];this.seriesEnabled=a.enabled;var o=this.prevy;o.length<e.length&&(o=this.prevy=new Array(e.length));for(var l=0;l<=e.length-1;l++)o[l]=r;this.plainBar(t.context,a.style,e,i,o,n)}},t.prototype.hitTest=function(t,e,i,n,s,r,a,o){var l=t.length;if(!(l>1))return{result:null,distance:1/0};var h=this.series,u=d.Helpers.binSearch(t,r),c=t[u]-e[u],p=t[u]+e[u];if(c>r&&u>0){var f=t[u-1]-e[u-1],g=t[u-1]+e[u-1];(g>r||Math.abs(g-r)<Math.abs(c-r))&&(u-=1,c=f,p=g)}for(var m=null,v=1/0,y=s,S=0;S<h.length;S++){var b=i[S][u];if(null!==b){var C=y-b,x=Math.min(y,C),w=Math.max(y,C),L=d.Geometry.distanceToRect(r,a,c,x,p,w);L<v&&(v=L,m={x0:c,y0:x,x1:p,y1:w,seriesIndex:S,isMarker:!1}),y=C}}return{result:m,distance:v}},t.prototype.plainBar=function(t,e,i,n,s,r){for(var a=0;a<i.length;a++){var o=i[a],l=s[a],h=r[0][a],u=r[1][a],c=r[2][a],p=r[3][a];if(void 0!==p&&null!==p||void 0!==h&&null!==h||void 0!==u&&null!==u||void 0!==c&&null!==c){var f=(o-n[a]||0)+.5,g=(o+n[a]||0)+.5,m=(l-p||0)+.5,v=(l-h||0)+.5,y=(l-u||0)+.5,S=(l-c||0)+.5,b=this.applyPatternStyle(t,e,y,S);if("bar"===e.pattern){var C=d.Graphics.beginStroke(t,b);C.moveTo(o,v),C.lineTo(o,m),C.moveTo(f,y),C.lineTo(o,y),C.moveTo(g,S),C.lineTo(o,S),d.Graphics.endStroke(t,C,b)}else{var C=d.Graphics.beginStroke(t,b);C.moveTo(o,v),C.lineTo(o,y),C.moveTo(o,S),C.lineTo(o,m),d.Graphics.endStroke(t,C,b),C=d.Graphics.beginStroke(t,b,!0),C.moveTo(f,y),C.lineTo(g,y),C.lineTo(g,S),C.lineTo(f,S),C.closePath(),d.Graphics.endStroke(t,C,b,!0)}e.shadowColor&&d.Graphics.clearShadow(t)}}},t.prototype.applyPatternStyle=function(t,e,i,n){var s=i>=n?e.increase:e.decrease,r="candlestick"===e.pattern?s.candlestick:s.bar,a=r;if(!this.seriesEnabled){a=d.Helpers.realClone(r);var o=this.scene.settings.legend.advanced.disabledSeries;a.lineColor=o.lineColor,void 0!==a.fillColor&&(a.fillColor=o.fillColor)}return e.lineColor&&e.shadowColor&&d.Graphics.applyShadow(t,e),a},t}();t.Candlestick=n}(s);var f=function(){function t(t,e,i){this.scene=e,this.chart=t,this.valueAxis=i}return t.prototype.setSeriesFont=function(t,e,i,n,s,r){var a=this.scene.dataLabels.metaData,o=2*n[0];null===a.styles&&(a.styles={});for(var l=0;l<i.length;l++){var h=i[l],u=this.getLongestNumber(s[l]);if(a.styles[h.id]=null,u.max===-(1/0))break;var c=this.createContent(u.max,r[u.index],h.valueLabels.contentsFunction)||"",d=this.reduceFontWidth(t,e,h.id,h.valueLabels,o,c);d&&(a.styles[h.id]=d)}},t.prototype.scanValueLabels=function(t,e,i,n,s,r,a,o,l){for(var h=this.chart.shell.getChartInnerArea(),u=this.chart.getBottomHeight(),c=0;c<2;c++){var d=0===c?r:a;if(null!==d)for(var p=0;p<n.length-1;p++)for(var f=n[p],g=this.valueAxis.zeroY,m=0,v=0;v<d.length;v++){var y=o[v][p],S=d[v][p];if(null!==S&&null!==y){m+=y,g-=S;var b=s[v];if(b.valueLabels&&b.valueLabels.enabled){var x=b.valueLabels.useStackedValue,w=this.chart.settings._computedStacks[b.stack],L=w&&"based"===w.type;if(null===x&&(x=!L),!L||0!==S||0===m){if(b instanceof C){var A=S>=0?1:-1,T=b.style.minHeight;T&&(S=S*A<T?T*A:S)}this.createDrawingSpots(t,h,S,g+S,f,b,x?m:y,u,i[0],l[p])}}}}}this.paintDataLabels(t,e,i[0],s.length)},t.prototype.createDrawingSpots=function(t,e,i,n,s,r,a,o,l,h){var u=r.id,c=r.valueLabels.position,p=this.scene.dataLabels,f=s.toFixed(1),g=this.scene.dataLabels.spots[f];if(null!==p.metaData.styles[u]){var m=this.createContent(a,h,r.valueLabels.contentsFunction);if(null!=m){var v=(new d.LabelLayoutBase).totalPadding(r.valueLabels.style);i=Math.abs(i);var y=this.getPositionVerticalDimensions(t,a,n,i,p.metaData.styles[u],r.valueLabels.minFontSize,c,v);if(null!==y){var S=y.min,b=y.max,C=e.findTopPosition(s,Math.min(s+l,this.scene.x0+this.scene.width));C>S&&(b=b-S+C,S=C);var x=this.scene.chartTop+this.scene.chartHeight-this.scene.bottomAxisSize;if(b>x&&(S=S-b+x,b=x),g)for(var w=0;w<g.length;w++){var L=g[w];if(null!=L){var A=L.edges[0],T=L.edges[1];if(S<T&&b>A){if(!(r.type===L.type&&a>L.value))return;g[w]=null}}}g||(g=this.scene.dataLabels.spots[f]=[]),g.push({value:a,type:r.type,edges:[S,b],x:parseInt(f,10),y:S+y.fontHeight/2,font:y.font,id:u,style:r.valueLabels.style,function:r.valueLabels.contentsFunction,timestamp:h})}}}},t.prototype.reduceFontSize=function(t,e,i,n,s){var r=e.match(/^([^\"\d]*)(\d+\.?\d*)(.*)$/i);if(!r)return d.Helpers.warn("Could not parse the font size from the value `"+e+"`."),{font:e,value:n(e)};for(var a=r[2],o=r[1],l=r[3],h=parseFloat(a);h>=i;){var u=o+h+l,c=n(u);if(c<=s)return{font:u,value:c};if(h===i)break;h=Math.round((h-1)*s/c*100)/100,h<i&&(h=i)}return null},t.prototype.getPositionVerticalDimensions=function(t,e,i,n,s,r,a,o){var l=e>=0?-1:1,h=null,u=null,c=l*n,p=d.Graphics.getTextHeight(t,s)+2*o+4,f=p<n;if(!f&&("insideTop"===a||"insideCenter"===a||"insideBase"===a)){var g=this.reduceFontSize(t,s,r,function(e){return d.Graphics.getTextHeight(t,e)},n);if(!g)return null;s=g.font,p=g.value+2*o+4}switch(a){case"outside":h=i+c,u=h+l*p;break;case"insideTop":h=i+c,u=h-l*p;break;case"insideCenter":h=i+c/2+p/2,u=h-p;break;case"insideBase":h=i+l*p,u=i;break;case"aboveValue":h=i+c,u=h-p;break;case"belowValue":h=i+c,u=h+p;break;case"insideTopAuto":f?(h=i+c,u=h-l*p):(h=i+c,u=h+l*p);break;case"value":f&&(h=i+c-p/2,u=h+p);break;default:d.Helpers.warn("Invalid position: '"+a+"'. Possible values: outside, insideTop, insideCenter, insideBase, aboveValue, belowValue, belowValueAuto, value."),h=i+c,u=h+l*p}return null===h?null:h>u?{min:u,max:h,font:s,fontHeight:p}:{min:h,max:u,font:s,fontHeight:p}},t.prototype.reduceFontWidth=function(t,e,i,n,s,r){var a=this.scene.dataLabels.fontWidths,o=n.style.textStyle;if(r=r.replace(/\d/g,"9"),(a[o.font+";"+r]||1/0)<=s)return o.font;var l=new d.Label(n.style),h=l.style.textStyle,u=h.font;l.text=r;var c=this.reduceFontSize(t,u,n.minFontSize,function(i){var n=a[i+";"+r];return n||(h.font=i,e.labelRenderer.measure(t,l),a[i+";"+r]=n=2*l.hwidth),n},s);return c?c.font:null},t.prototype.getLongestNumber=function(t){for(var e=0,i=-1,n=0;n<t.length;n++){var s=t[n];s<0&&(s*=-10),e<=s&&(e=s,i=n)}return{max:i===-1||null===t[i]?-(1/0):t[i],index:i}},t.prototype.createContent=function(t,e,i){if(i){var n=i.call(this.chart.api,t,e)||null;return null!=n&&"string"!=typeof n?void d.Helpers.warn("`valueLabels.contentsFunction` has to return `null` or a string value."):n}return t===(0|t)?t.toFixed(0):t.toFixed(2)},t.prototype.paintDataLabels=function(t,e,i,n){var s=this.scene,r=s.dataLabels.metaData,a=2*i,o=r.availableWidth!==a;if(r.processed+=n,r.processed>=s.seriesWithLabels){r.processed=0;for(var l=s.dataLabels.spots,h=Object.keys(l),u=0,c=h.length;u<c;u++){var p=l[h[u]];if(p)for(var f=0;f<p.length;f++){var g=p[f];if(null!=g){var m=new d.Label(g.style);m.text=this.createContent(g.value,g.timestamp,g.function),m.style.textStyle.font=g.font,e.labelRenderer.paint(t,g.x,g.y,1,m)}}}s.dataLabels.spots={},o&&(r.availableWidth=a)}},t}();t.ValueLabels=f,function(t){var e=function(){function t(t,e,i,n,s){this.series=[],this.seriesId=[],this.min=0,this.max=0,this.renderingType=null,this.needsAfterProcess=!1,this.paddingLeft=0,this.paddingRight=0,this.centers=[],this.radii=[],this.vstack=[],this.countStack=[],this.ystack=[],this.xes=[],this.times=[],this.styles=[],this.previewData=[],this.calculatedDepth=0,this.ystackNegative=null,this.valueLabels=null,this.externalItems=null,this.externalItemsCache=null,this.va=s,this.options=n,this.cluster=i,this.scene=e,this.chart=t,this.va.series++}return t.computeFillPattern=function(t,e,i){var n=i.fillPattern,s=i._currentFillStyleKey,r=i.fillColor,a=r+"|"+n;if(!s||s.pattern!==a){var o,l,h=t.assetsLoader.getAssetImage(i.fillPattern);if(h){var u=i._fillPatternOpacity;if(r||u){var c=document.createElement("canvas");c.width=h.width,c.height=h.height;var d=c.getContext("2d");r&&(d.fillStyle=r,d.fillRect(0,0,h.width,h.height)),d.globalAlpha=i._fillPatternOpacity,d.drawImage(h,0,0),h=c}o=e.createPattern(h,"repeat"),l={pattern:a}}else o=r||null,l=null;i._currentFillStyle=o,i._currentFillStyleKey=l}},t.prototype.addSeries=function(t,e){this.renderingType||(this.renderingType=e.type),this.series.push(e),this.seriesId.push(t);var i=e;this.calculatedDepth=Math.max(this.calculatedDepth,i.style.depth),"columns"===this.renderingType&&(this.paddingLeft=Math.max(this.paddingLeft,i.style.padding[0]),this.paddingRight=Math.max(this.paddingRight,i.style.padding[1]))},t.prototype.afterInit=function(){"line"===this.renderingType?this.renderer=new s.Line(this,this.series):"columns"===this.renderingType?this.renderer=new s.Columns(this.scene,this.series):"candlestick"===this.renderingType&&(this.candleStacks=!0,this.renderer=new s.Candlestick(this.scene,this.series))},t.prototype.process=function(t){this.processData(t),this.computeMinMax(),this.addLeads(t),this.needsAfterProcess=!0},t.prototype.afterProcess=function(){if(this.needsAfterProcess||this.va.axisChanged)return this.needsAfterProcess=!1,this.computeY()},t.prototype.paint=function(t,e){if(0!==this.ystack.length&&!isNaN(this.radii[0])){for(var i=0;i<this.series.length;i++){var n=this.series[i];this.computeFillStyle(e,n.style),this.chart.assetsLoaded&&n.valueLabels&&n.valueLabels.enabled&&(null===this.valueLabels&&(this.valueLabels=new f(this.chart,this.scene,this.va)),this.valueLabels.setSeriesFont(e,t,this.series,this.radii,this.vstack,this.times))}var s=this.styles;if(s)for(var r=0;r<s.length;r++){var a=s[r];if(a)for(var o=0;o<a.length;o++)this.computeFillStyle(e,a[o])}this.ystackNegative&&this.renderer.paintStack(t,this.centers,this.radii,this.ystackNegative,this.styles,this.va.zeroY,this.previewData),this.renderer.paintStack(t,this.centers,this.radii,this.ystack,this.styles,this.va.zeroY,this.previewData),null!==this.valueLabels&&this.valueLabels.scanValueLabels(e,t,this.radii,this.centers,this.series,this.ystack,this.ystackNegative,this.vstack,this.times)}},t.prototype.hitTestStack=function(t,e){var i=d.Helpers.binSearch(this.centers,t),n=this.centers[i]-this.radii[i],s=this.centers[i]+this.radii[i];if(n>t&&i>0){var r=this.centers[i-1]-this.radii[i-1],a=this.centers[i-1]+this.radii[i-1];(a>t||Math.abs(a-t)<Math.abs(n-t))&&(i-=1,n=r,s=a)}return{result:{x0:n,y0:0,x1:s,y1:0,seriesIndex:null,isMarker:!1,stack:this},distance:d.Geometry.distanceToRect(t,0,n,0,s,0)}},t.prototype.hitTest=function(t,e,i){var n=this.renderer.hitTest(this.centers,this.radii,this.ystack,this.styles,this.va.zeroY,t,e,i),s=n.result,r=n.distance;return this.ystackNegative&&(n=this.renderer.hitTest(this.centers,this.radii,this.ystackNegative,this.styles,this.va.zeroY,t,e,i),n.distance<r&&(s=n.result,r=n.distance)),null!==s&&(s.seriesIndex=this.seriesId[s.seriesIndex],s.stack=this),{result:s,distance:r}},t.prototype.computeFillStyle=function(e,i){if(i)if(i.fillPattern)t.computeFillPattern(this.chart,e,i);else{if(i.fillGradient)return void this.computeFillGradient(e,i);i._currentFillStyle=i.fillColor||null,i._currentFillStyleKey=null}},t.prototype.computeFillGradient=function(t,e){var i=e.fillGradient,n=this.va,s=n.zeroY,r=this.scene.y0,a=this.scene.x0,o=this.scene.height,l=e._currentFillStyleKey,h=n.scale+"|"+s+"|"+r+"|"+a+"|"+o+"|"+s;if(!l||!e._currentFillStyle||i!==l.gradient||h!==l.hash){for(var u=[],c=0;c<i.length;c++){var p=i[c],f=s-n.valueToRelativeY(p[0]),g=(f-r)/o;u.push([g,p[1]])}u.sort(function(t,e){return t[0]-e[0]});for(var m=t.createLinearGradient(a,r,a,r+o),v=null,y=0;y<u.length;y++){var S=u[y],b=S[0],C=S[1];if(b>0){if(v&&v[0]<0&&m.addColorStop(0,d.Colors.blend(v[1],C,(0-v[0])/(b-v[0]),!1)),b>1){v&&m.addColorStop(1,d.Colors.blend(v[1],C,(1-v[0])/(b-v[0]),!1));break}m.addColorStop(b,C)}v=S}e._currentFillStyle=m,e._currentFillStyleKey={hash:h,gradient:i}}},t.prototype.processData=function(t){var e=this;this.vstack=[],this.countStack=[],this.styles=[];var i=t[this.seriesId[0]];if(0!==i.times.length){this.xes=i.xes.slice(i.fromIndex,i.toIndex),this.times=i.times.slice(i.fromIndex,i.toIndex),this.centers=new Array(this.xes.length-1),this.radii=new Array(this.xes.length-1),this.cluster.computeStackCenterRadius(this,this.xes,this.centers,this.radii),this.externalItemsCache=null,this.externalItems=function(){var t=e.externalItemsCache;return null===t&&(t=e.externalItemsCache=i.externalItems(i.fromIndex,i.toIndex-1)),
  45. t},this.previewData=[];for(var n=0;n<this.seriesId.length;n++){var s=this.seriesId[n];if(i=t[s],this.vstack.push(i.values.slice(i.fromIndex,i.toIndex-1)),this.countStack.push(i.counts.slice(i.fromIndex,i.toIndex-1)),i.config){for(var r=[],a=[],o=i.fromIndex;o<i.toIndex-1;o++){var l=i.config[o];l&&(r.push(l.style),a.push(l.previewData))}this.styles.push(r),this.previewData.push(a)}else this.styles.push(null)}}},t.prototype.addLeads=function(t){for(var e=0;e<this.seriesId.length;e++){var i=this.seriesId[e],n=t[i];n.leadIn&&this.injectLead(n.leadIn,e),n.leadOut&&this.injectLead(n.leadOut,e)}},t.prototype.injectLead=function(t,e){var i=this.series.length,n=t.values[0],s=t.times[0],r=[0],a=[0];this.cluster.computeStackCenterRadius(this,t.xes,r,a);for(var o=r[0],l=a[0],h=0;h<this.centers.length&&this.centers[h]<o;)h++;if(h===this.centers.length||this.centers[h]>o){this.centers.splice(h,0,o),this.radii.splice(h,0,l),this.times.splice(h,0,s);for(var u=0;u<=i-1;u++)this.vstack[u].splice(h,0,null),this.countStack[u].splice(h,0,null),this.styles[u]&&this.styles[u].splice(h,0,null)}this.vstack[e][h]=n,this.countStack[e][h]=t.counts[0]},t.prototype.getSeparateNegative=function(){var t=this.options.separateNegativeValues;return null===t&&(t="line"!==this.renderingType),t},t.prototype.computeMinMax=function(){var t=1/0,e=-(1/0);if(this.vstack.length>0){for(var i=this.vstack,n=i[0].length,s=i.length,r=this.options.type,a=this.getSeparateNegative(),o=this.scene.x0,l=o+this.scene.width,h=0,u=n-1;h<n&&this.centers[h]+this.radii[h]<o;)h+=1;for(;u>=h&&this.centers[u]-this.radii[u]>l;)u-=1;if("proportional"===r)t=0,e=100;else if(this.candleStacks)for(var c=h;c<=u;c++)for(var p=0;p<=s-1;p++){var f=i[p][c];d.Helpers.isNumber(f)&&(t=Math.min(t,f),e=Math.max(e,f))}else if(1===s)for(var g=i[0],c=h;c<=u;c++){var f=g[c];d.Helpers.isNumber(f)&&(t=Math.min(t,f),e=Math.max(e,f))}else if("based"===r)for(var c=h;c<=u;c++)for(var p=0;p<=s-1;p++){var f=i[p][c];d.Helpers.isNumber(f)&&(t=Math.min(t,f),e=Math.max(e,f))}else if("normal"!==r||a){if("normal"!==r)throw"stack.type unknown value: "+r;for(var c=h;c<=u;c++)for(var m=0,v=0,p=0;p<=s-1;p++){var f=i[p][c];d.Helpers.isNumber(f)&&(f>0?v+=f:f<0&&(m+=f),t=Math.min(t,m),e=Math.max(e,v))}}else for(var c=h;c<=u;c++)for(var y=0,p=0;p<=s-1;p++){var f=i[p][c];d.Helpers.isNumber(f)&&(null!==f&&(y+=f),t=Math.min(t,y),e=Math.max(e,y))}}this.min=t,this.max=e,t<=e?this.va.receiveSeriesGeometry(t,e,this.calculatedDepth):this.va.receiveSeriesGeometry(void 0,void 0,this.calculatedDepth)},t.prototype.computeY=function(){var t=this.vstack,e=t.length;if(0!==e){var i,n=this.options.type,s=this.getSeparateNegative(),r=t[0].length,a=this.va,o=null;if("proportional"===n){i=t.map(function(){return[]});for(var l=0;l<=r-1;l++){for(var h=0,u=0;u<=e-1;u++){var c=t[u][l];null!==c&&(h+=Math.abs(c))}if(h>0){h*=.01;for(var u=0;u<=e-1;u++){var c=t[u][l];null!==c?i[u].push(a.valueToRelativeY(Math.abs(c)/h)):i[u].push(null)}}else for(var u=0;u<=e-1;u++)i[u].push(null)}}else if("based"===n||1===e){i=[];for(var d=t[0].map(function(){return 0}),p=0;p<t.length;p++){for(var f=t[p],g=new Array(r),m=0;m<f.length;m++){var c=f[m];if(null!==c){var v=a.valueToRelativeY(c),y=d[m];c>=0&&v<=y||c<0&&v>=y?g[m]=0:(g[m]=v-y,d[m]=v)}else g[m]=null}i.push(g)}}else if("normal"===n&&s&&this.min<0&&this.max>0){i=t.map(function(){return[]}),o=t.map(function(){return[]});for(var l=0;l<=r-1;l++)for(var u=0;u<=e-1;u++){var c=t[u][l];c>0?(i[u].push(a.valueToRelativeY(c)),o[u].push(null)):c<0?(i[u].push(null),o[u].push(a.valueToRelativeY(c))):(i[u].push(null),o[u].push(null))}}else if("candlestick"===this.renderingType){i=t.map(function(){return[]});for(var l=0;l<=r-1;l++)for(var u=0;u<=e-1;u++){var c=t[u][l];null!==c?i[u].push(a.valueToRelativeY(c)):i[u].push(null)}}else{if("normal"!==n)throw"stack.type unknown value: "+n;var S=0,b=0,C=0;i=t.map(function(){return[]});for(var l=0;l<=r-1;l++)for(var u=0;u<=e-1;u++){var c=t[u][l];if(0===u&&(S=b=C=0),null!==c){b+=c;var x=a.valueToRelativeY(b);i[u].push(x-C),C=x}else i[u].push(null)}}this.ystackNegative=o,this.ystack=i}},t.prototype.exportData=function(t,e){var i;if(this.times&&this.vstack){for(var n=this.times,s=this.centers.length,r=0;r<s&&n[r+1]<=t;)r++;for(var a=r;a<s&&n[a+1]<e;)a++;i=[];for(var o=0;o<this.vstack.length;o++){var l=this.vstack[o],h=this.countStack[o],u=0,c=-(1/0),d=1/0,p=null,f=null;s=0;var g=this.series[o].data.aggregation,m=!1,v=!1;"sum"===g?(m=!1,v=!0):"avg"===g&&(m=!0,v=!0);for(var y=r;y<=a;y++){var S=l[y],b=0|h[y];null==S||isNaN(S)||(u+=m?S*b:S,c=Math.max(c,S),d=Math.min(d,S),null===p&&(p=S),f=S,s+=b)}s>0?i.push({sum:u,max:c,min:d,first:p,last:f,count:s,avg:v?u/s:null,change:f-p}):i.push(null)}}else i=this.series.map(function(){return null});for(var C=[],x=this.series.length-1;x>=0;x--){var w=this.series[x];C.push({name:w.name||"",values:i[x],config:w})}return{name:this.options.name,stack:this,config:this.options,data:C}},t}();t.Stack=e}(i);var g=function(t){function e(){t.apply(this,arguments),this._computedValueAxisList=[],this._computedValueAxis={},this._computedSeries=[],this._computedStacks={},this.area=new N,this.legend=new r,this.valueAxisDefault=new u,this.valueAxis={},this.chartTypes={columns:{type:"columns"},line:{type:"line"},candlestick:{type:"candlestick"}},this.stacks={},this.seriesDefault={type:"columns"},this.series=[],this.info=new M,this.events=new m,this.interaction=new I,this.localization=new k,this.style={columnColors:["#32CD32","#36BEFF","#FBBD30","#EE3431","#894BBC","#0EC9AC","#524BBC"],lineColors:["#32CD32","#36BEFF","#FBBD30","#EE3431","#894BBC","#0EC9AC","#524BBC"]}}return n(e,t),e.addSeparateSeries=function(t,e,i,n,s,r,a){var o=d.Helpers.extendCopy({},t);o.stack=s,o.id="series"+d.Helpers.SeparatorChar+r,o.name=e,o.data={aggregation:n,index:i},o.style=t.style,a.push(o)},e._hasSeriesSettingsChanged=function(t){return t.series||t.chartTypes||t.seriesDefault||t.stacks||t.style},e.prototype.apply=function(i,n){var s=i.valueAxis;if(s){var r=[{from:"style.baseLineColor",to:"style.baseLine.lineColor"},{from:"style.baseLineWidth",to:"style.baseLine.lineWidth"},{from:"style.hgridLineColor",to:"style.hgrid.lineColor"},{from:"style.title.alignment",to:"style.title.align"},{from:"style.title.font",to:"style.title.textStyle.font"},{from:"style.title.fillColor",to:"style.title.textStyle.fillColor"},{from:"style.valueLabel.font",to:"style.valueLabel.textStyle.font"},{from:"style.valueLabel.fillColor",to:"style.valueLabel.textStyle.fillColor"}];for(var a in s)this.applyCompatibility(s[a],r,"valueAxis["+a+"]")}this.applyCompatibility(i,[{from:"valueAxis.default",to:"valueAxisDefault"},{from:"valueAxisDefault.style.baseLineColor",to:"valueAxisDefault.style.baseLine.lineColor"},{from:"valueAxisDefault.style.baseLineWidth",to:"valueAxisDefault.style.baseLine.lineWidth"},{from:"valueAxisDefault.style.hgridLineColor",to:"valueAxisDefault.style.hgrid.lineColor"},{from:"valueAxisDefault.style.title.alignment",to:"valueAxisDefault.style.title.align"},{from:"valueAxisDefault.style.title.font",to:"valueAxisDefault.style.title.textStyle.font"},{from:"valueAxisDefault.style.title.fillColor",to:"valueAxisDefault.style.title.textStyle.fillColor"},{from:"valueAxisDefault.style.valueLabel.font",to:"valueAxisDefault.style.valueLabel.textStyle.font"},{from:"valueAxisDefault.style.valueLabel.fillColor",to:"valueAxisDefault.style.valueLabel.textStyle.fillColor"}]);var o=t.prototype.apply.call(this,i);if(this._initializing||e._hasSeriesSettingsChanged(o)){this._initializing&&!o.series&&(o.series=[]);var l=this.series,h=[],c=null,p=0;this._computedStacks=d.Helpers.clone(this.stacks);for(var f=0;f<l.length;f++){var g=l[f];if(!g.valueAxis||"default"===g.valueAxis||this.valueAxis[g.valueAxis])if(g.data&&0===g.data.index)d.Helpers.error("Value `0` references the timestamp and cannot be used when specifying `series.data.index`.");else if(g.data&&0===g.data.countIndex)d.Helpers.error("Value `0` references the timestamp and cannot be used when specifying `series.data.countIndex`.");else if("candlestick"!==g.type||g.data&&g.data.index)h.push(g);else{if(void 0===g.stack||null===g.stack){c="default"+d.Helpers.SeparatorChar+p++;var m=new v;m.name=g.name,this._computedStacks[c]=m}var y=g.data;if(null==y||null==y.high||null==y.low||null==y.open||null==y.close){d.Helpers.error("Each candlestick series should define four data properties: low, high, open, close");continue}var S=g.localization;S||(S=this.chartTypes.candlestick.localization),S||(S=(new w).localization),e.addSeparateSeries(g,S.high||"high",y.high,"max",c,p++,h),e.addSeparateSeries(g,S.open||"open",y.open,"first",c,p++,h),e.addSeparateSeries(g,S.close||"close",y.close,"last",c,p++,h),e.addSeparateSeries(g,S.low||"low",y.low,"min",c,p++,h)}else d.Helpers.error("The series reference a non-existant value axis `"+g.valueAxis+"`.")}this._computedSeries=d.SettingsHelper.mergeDefaultValues(h,this.seriesDefault,this.chartTypes,n.createInstance,n.getMapping,"series"),this.applySeriesColor(this._computedSeries)}if(this._initializing||o.valueAxis||o.valueAxisDefault||!this._computedValueAxisList.length){this._initializing&&!o.valueAxis&&(o.valueAxis={});for(var b=!1,C=0;C<this._computedSeries.length;C++){var x=this._computedSeries[C];b=b||"default"===x.valueAxis}this._computedValueAxisList=[],this._computedValueAxis={};var L=this.valueAxisDefault;for(var A in this.valueAxis){var T=new u,M=this.valueAxis[A];this.applyCompatibility(M,[{from:"style.baseLineColor",to:"style.baseLine.lineColor"},{from:"style.baseLineWidth",to:"style.baseLine.lineWidth"},{from:"style.hgridLineColor",to:"style.hgrid.lineColor"}]),d.SettingsHelper.updateRecursive(T,L,d.SettingsMapping.LinearChartSettingsValueAxis,{},"valueAxisDefault"),d.SettingsHelper.updateRecursive(T,M,d.SettingsMapping.LinearChartSettingsValueAxis,{},"valueAxis["+A+"]"),T.id=A,this._computedValueAxis[A]=T,this._computedValueAxisList.push(T)}if(b&&!this.valueAxis.default){var k=d.Helpers.realClone(L);k.id="default",this._computedValueAxis[k.id]=k,this._computedValueAxisList.push(k)}this._computedValueAxisList.sort(function(t,e){return t.id.localeCompare(e.id)})}return o},e.prototype.applySeriesColor=function(t){for(var e=0,i=0,n=this.style.columnColors,s=this.style.lineColors,r=0;r<t.length;r++){var a=t[r];"columns"===a.type&&null==a.style.fillColor?(a.style.fillColor=n[e],e=(e+1)%n.length):"line"===a.type&&null==a.style.lineColor&&(a.style.lineColor=s[i],i=(i+1)%s.length)}},e}(d.Settings);t.Settings=g;var m=function(t){function e(){t.apply(this,arguments),this.onAnimationDone=null}return n(e,t),e}(d.SettingsEvents);t.SettingsEvents=m;var v=function(){function t(){this.name="",this.type="normal",this.separateNegativeValues=null}return t}();t.SettingsStack=v;var y=function(){function t(){this.id=null,this.enabled=!0,this.data=new b,this.type="columns",this.valueAxis="default",this.name=null,this.nameLegend=null,this.showInLegend=!0,this.legendGroupId=null,this.stack=null,this.cluster=null,this.style=new S}return t.getMapping=function(t,e){throw new Error("This method is abstract.")},t.createInstance=function(t,e){throw new Error("This method is abstract.")},t}();t.SettingsSeries=y;var S=function(){function t(){this.fillColor=null,this.lineColor=null,this.fillGradient=null,this.fillPattern=null,this._fillPatternOpacity=1,this._currentFillStyleKey=null,this.lineDash=null,this.lineWidth=1,this.shadowOffsetX=1,this.shadowOffsetY=-1,this.shadowColor=null,this.legend={textColor:null,marker:{shape:null}},this.depth=0}return t}();t.SettingsSeriesStyle=S;var b=function(){function t(){this.source="default",this.valueFunction=null,this.aggregation="sum",this.aggregatedValueFunction=null,this.noDataPolicy="join"}return t}();t.SettingsSeriesData=b;var C=function(t){function e(){t.call(this),this.valueLabels={enabled:!1,style:{padding:1,margin:0,aspectRatio:3,align:"center",textStyle:{fillColor:"black",font:"12px Arial"},backgroundStyle:{lineColor:"rgba(255,255,255,0.4)",fillColor:"rgba(255,255,255,0.4)"}},position:"insideTopAuto",minFontSize:7,contentsFunction:null,useStackedValue:null},this.style=new L,this.type="columns"}return n(e,t),e}(y);t.SettingsSeriesColumns=C;var x=function(t){function e(){t.call(this),this.valueLabels={enabled:!1,style:{padding:2,margin:0,aspectRatio:3,align:"center",textStyle:{fillColor:"black",font:"12px Arial"},backgroundStyle:{lineColor:"rgba(255,255,255,0.4)",fillColor:"rgba(255,255,255,0.4)"}},position:"value",minFontSize:7,contentsFunction:null,useStackedValue:null},this.style=new A,this.type="line"}return n(e,t),e}(y);t.SettingsSeriesLines=x;var w=function(t){function e(){t.call(this),this.style=new T,this.localization={high:"high",low:"low",open:"open",close:"close"},this.type="candlestick"}return n(e,t),e}(y);t.SettingsSeriesCandleStick=w;var L=function(t){function e(){t.apply(this,arguments),this.minHeight=4,this.gradient=.8,this.lineColor="",this.padding=[3,3],this.shadowBlur=3,this.depth=0,this.depthBrightness=.5}return n(e,t),e}(S);t.SettingsSeriesColumnsStyle=L;var A=function(t){function e(){t.apply(this,arguments),this.shadowBlur=5,this.smoothing=!1,this.steps=!1,this.marker={shape:null,width:10,fillColor:null,lineColor:null,lineWidth:1},this.markerStyleFunction=null}return n(e,t),e}(S);t.SettingsSeriesLinesStyle=A;var T=function(t){function e(){t.apply(this,arguments),this.pattern="candlestick",this.padding=[1,1],this.increase={bar:{lineColor:"green",shadowColor:null,lineDash:null,lineWidth:1,shadowOffsetX:1,shadowOffsetY:-1,shadowBlur:0},candlestick:{lineColor:"#000",shadowColor:null,lineDash:null,lineWidth:1,shadowOffsetX:1,shadowOffsetY:-1,shadowBlur:0,fillColor:"yellow"}},this.decrease={bar:{lineColor:"red",shadowColor:null,lineDash:null,lineWidth:1,shadowOffsetX:1,shadowOffsetY:-1,shadowBlur:0},candlestick:{lineColor:"#000",shadowColor:null,lineDash:null,lineWidth:1,shadowOffsetX:1,shadowOffsetY:-1,shadowBlur:0,fillColor:"black"}}}return n(e,t),e}(S);t.SettingsSeriesCandleStickStyle=T;var M=function(){function t(){this.enabled=!0,this.showNoData=!0,this.position="inside",this.valueFormatterFunction=null,this.aggregations=null,this.style={highlight:{fillColor:"rgba(30,160,220,0.15)",fadeIn:200,fadeOut:200}},this.advanced={contentsFunction:null,showOnlyHoveredSeries:!1,scope:null,showHeader:!0}}return t}();t.SettingsInfoPopup=M;var k=function(t){function e(){t.apply(this,arguments),this.valueUnits={K:1e3,M:1e6,B:1e9,T:1e12,P:1e15},this.noDataLabel="No data",this.unnamedSeries="Unnamed",this.toolbar=new P}return n(e,t),e}(d.SettingsLocalization);t.SettingsLocalization=k;var P=function(t){function e(){t.apply(this,arguments),this.linButton="Lin",this.logButton="Log",this.linLogTitle="Switch lin/log scale"}return n(e,t),e}(d.SettingsLocalizationToolbar);t.SettingsLocalizationToolbar=P;var I=function(t){function e(){t.apply(this,arguments),this.swipeSensitivity=.6,this.ignoreBottomAxis=!1,this.scrolling=new F,this.zooming=new D}return n(e,t),e}(d.SettingsInteraction);t.SettingsInteraction=I;var D=function(){function t(){this.enabled=!0,this.wheel=!1,this.swipe=!0,this.fingers=!0,this.fingersMaxZoom=10,this.sensitivity=2,this.wheelSensitivity=1.5,this.keyboardFactor=2,this.upDownTreshold=10,this.zoomHighlightThreshold=1.5}return t}();t.SettingsInteractionZooming=D;var F=function(){function t(){this.enabled=!0,this.swipePageFlipping=!0,this.keyboardScrollingFactor=1,this.kineticFriction=1e-6,this.maxAnimationLength=1500}return t}();t.SettingsInteractionScrolling=F;var N=function(t){function e(){t.apply(this,arguments),this.style=new E}return n(e,t),e}(d.SettingsArea);t.SettingsArea=N;var E=function(t){function e(){t.apply(this,arguments),this.noData={fillColor:"#888",image:null},this.zoomHighlight={fillColor:"rgba(30,160,220,0.15)",fadeIn:100,fadeOut:500},this.zoomHighlightInactive={fillColor:"rgba(30,160,220,0.08)"}}return n(e,t),e}(d.SettingsAreaStyle);t.SettingsAreaStyle=E,function(e){var i=function(t){function e(e,i){var n=e.settings.localization.toolbar;i.title=i.title||n.linLogTitle,i.label=i.label||n.linButton,t.call(this,e,i);var s=(i.cssClass||"")+" DVSL-bar-btn DVSL-bar-btn-l";this.linClass=s+"in",this.logClass=s+"og",this.logScale=this.chart.scene.settings.valueAxisDefault.logScale,this.updateElements()}return n(e,t),e.prototype.onClick=function(e){this.chart.setLogScale(!this.chart.scene.settings.valueAxisDefault.logScale,"user"),t.prototype.onClick.call(this,e)},e.prototype.updateElements=function(){var t=this.chart.settings.localization.toolbar,e=this.logScale;this.a.className=e?this.logClass:this.linClass,this.options.showLabel!==!1&&(this.p.innerHTML=e?t.logButton:t.linButton)},e.prototype.onSceneChange=function(t){var e=this.chart.scene.settings.valueAxisDefault.logScale;t.settings&&e!==this.logScale&&(this.logScale=e,this.updateElements())},e}(d.Bar.Button);e.LinLogButton=i,d.Bar.ToolbarItemNames.logScale=function(e,i){return new t.Bar.LinLogButton(e,i)}}(e);var z=function(t){function e(){t.apply(this,arguments),this.enabled=!0,this.export=!0,this.back=!0,this.zoomOut=!0,this.logScale=!0}return n(e,t),e}(d.SettingsToolbar);t.SettingsToolbar=z;var O=function(t){function e(e){t.call(this),this.animationOrder=1e3,this.chart=null,this.scene=null,this.events=null,this.pointer1=null,this.pointer2=null,this.t1=0,this.t2=0,this.x1=0,this.x2=0,this.scaleOrigin=null,this.initialZoom=null,this.dragStartFrom=null,this.dragStartTo=null,this.active=!1,this.lastScrollingY=0,this.scrollingActive=!1,this.scalingActive=0,this.wheelOrigin=null,this.wheelProportion=null,this.highlight=null,this.highlightRemoveWhenDone=!1,this._animationsDone=!0,this.chart=e,this.scene=e.scene,this.events=e.events,this._settings=e.settings.interaction,this.inertiaF=new d.Inertia(1,0,!0),this.inertiaT=new d.Inertia(1,0,!0)}return n(e,t),e.prototype.getVisibleRange=function(){return this._currentTo-this._currentFrom},e.prototype.onZoomOut=function(t,e,i,n){return null==n&&(n=2),{from:i-(i-t)*n,to:i+(e-i)*n,center:i}},e.prototype.onZoomIn=function(t,e,i,n){return void 0===n&&(n=.5),null==n&&(n=.5),{from:i-(i-t)*n,to:i+(e-i)*n,center:i}},e.prototype.onScroll=function(t,e,i){return"<"===i?{from:2*t-e,to:t}:{from:e,to:2*e-t}},e.prototype.onGoHome=function(t,e){return{from:t,to:e,origin:e}},e.prototype.getFrom=function(t){return null==t||t===1/0?this.inertiaF.getTargetValue():this.inertiaF.getValue(t)},e.prototype.getTo=function(t){return null==t||t===1/0?this.inertiaT.getTargetValue():this.inertiaT.getValue(t)},e.prototype.setFrom=function(t,e,i,n){void 0===e&&(e=!1),void 0===n&&(n=!1),e?(this.inertiaF.setTarget(t,i,void 0,n?this._settings.scrolling.maxAnimationLength:null),this._animationsDone=!1):(this._currentFrom=t,this.inertiaF.jump(t))},e.prototype.setTo=function(t,e,i,n){void 0===e&&(e=!1),void 0===n&&(n=!1),e?(this.inertiaT.setTarget(t,i,void 0,n?this._settings.scrolling.maxAnimationLength:null),this._animationsDone=!1):(this._currentTo=t,this.inertiaT.jump(t))},e.prototype.onWheel=function(t){if(null===this.pointer1){var e=this.getFrom(),i=this.getTo();if(!(e>=i)){var n=this._settings;if(n.zooming.wheel&&n.zooming.enabled&&this.xyInArea(t.x,t.y)){this.active=!0;var s=this.wheelOrigin;null===s&&(this.wheelOrigin=this.scaleOrigin=s=this.xyToPosition(t.x,t.y),this.wheelProportion=(s-e)/(i-e),this.x1=t.x);var r=this.wheelProportion,a=Math.pow(Math.max(1.1,n.zooming.wheelSensitivity),.004*t.wheely);e=s-(i-e)*r*a,i=s+(i-e)*(1-r)*a;var o=t.wheely<0?1:-1,l=d.Helpers.performanceNow();this.handleZoomWheel(e,i,s,l,o),t.consumed=!0,this.active=!1}}}},e.prototype.onPointerDown=function(t){this.wheelOrigin=null;var e=this._settings;if(this.xyInArea(t.x,t.y)&&(e.scrolling.enabled||e.zooming.enabled)){var i=this.xyToPosition(t.x,t.y),n=d.Helpers.performanceNow(),s=this.getFrom(n),r=this.getTo(n);if(s>r){var a=r;r=s,s=a}null===this.pointer1?(this.pointer1=t.identifier,this.x1=t.x,this.t1=i,this.scaleOrigin=i,this.onStartDragging(s,r,i),this.lastScrollingY=t.y,this.dragStartFrom=s,this.dragStartTo=r,this.dragCurFrom=s,this.dragCurTo=r,t.consumed=!0,this.inertiaF.finished(n)&&this.inertiaT.finished(n)||(this.setFrom(s),this.setTo(r),this.stopAnimations(),this.scrollingActive=!0),this.chart.cancelChartUpdateNotify(),t.consumed=!0):null===this.pointer2?(this.pointer2=t.identifier,this.x2=t.x,this.t2=i,this.initialZoom=r-s,this.scaleOrigin=(this.t1+this.t2)/2,t.consumed=!0):(this.scalingActive||this.scrollingActive)&&(t.consumed=!0)}},e.prototype.xyToDragPosition=function(t,e){return this.dragCurFrom+(t-this.scene.x0)/this.scene.width*(this.dragCurTo-this.dragCurFrom)},e.prototype.scaleViewRange=function(t,e,i){var n=Math.pow(1+this._settings.zooming.sensitivity,-t.dy/this.scene.height);return e=(e-this.scaleOrigin)*n+this.scaleOrigin,i=(i-this.scaleOrigin)*n+this.scaleOrigin,{from:e,to:i}},e.prototype.onPointerMove=function(t){null!==this.wheelOrigin&&Math.abs(this.x1-t.x)>this._settings.zooming.sensitivity&&(this.wheelOrigin=null)},e.prototype.onPointerDrag=function(t){var e=this.dragCurFrom,i=this.dragCurTo,n=this._settings;if(t.identifier===this.pointer1&&null===this.pointer2){this.scaleOrigin=this.t1,this.x1=t.x;var s=t.y-this.lastScrollingY;if(Math.abs(t.dx)>4*Math.abs(t.dy)&&n.scrolling.enabled&&(this.scrollingActive=!0),n.zooming.enabled&&n.zooming.swipe&&Math.abs(s)>n.zooming.upDownTreshold?this.scalingActive=s>0?1:-1:this.scalingActive=0,this.scalingActive){this.clearZoomHighlight();var r=this.scaleViewRange(t,e,i);e=r.from,i=r.to,t.consumed=!0}if(this.scrollingActive){var a=this.xyToDragPosition(t.x,t.y),o=this.t1-a;e+=o,i+=o}}else if(t.identifier===this.pointer1&&n.scrolling.enabled){this.x1=t.x,this.clearZoomHighlight();var l=this.twoPointerDrag();e=l.from,i=l.to}else{if(t.identifier!==this.pointer2||!n.scrolling.enabled)return void((this.scalingActive||this.scrollingActive)&&(t.consumed=!0));this.x2=t.x,this.clearZoomHighlight();var l=this.twoPointerDrag();e=l.from,i=l.to}this.dragCurFrom=e,this.dragCurTo=i;var h=this.onSnapWhileDragging(e,i,this.scaleOrigin,this.scrollingActive,this.scalingActive);this.goToPositionDragging(h.from,h.to),t.consumed=!0},e.prototype.twoPointerDrag=function(){var t=this._settings,e=t.zooming.fingersMaxZoom;this.scaleOrigin=(this.t1+this.t2)/2;var i=this.t2-this.t1,n=this.dragCurFrom,s=this.dragCurTo,r=this.xyToDragPosition(this.x1,0),a=this.xyToDragPosition(this.x2,0);if(t.scrolling.enabled&&t.zooming.enabled&&t.zooming.fingers&&0!==i){var o=this.initialZoom,l=((r+a)/2-this._currentFrom)/(this._currentTo-this._currentFrom),h=(a-r)/(this._currentTo-this._currentFrom),u=void 0;u=i*h>0?i/h:1/0;var c=o*e,d=o/e;u=Math.max(d,Math.min(c,u)),n=this.scaleOrigin-l*u,s=this.scaleOrigin+(1-l)*u,this.scalingActive=u<o?1:-1,this.scrollingActive=!0}else if(t.scrolling.enabled){var p=(this.t1+this.t2)/2,f=(r+a)/2,g=p-f;n+=g,s+=g,this.scrollingActive=!0}return{from:n,to:s}},e.prototype.onPointerUp=function(t){var e=this._settings,i=d.Helpers.performanceNow(),n=this.scrollingActive,s=this.scalingActive;if(t.identifier===this.pointer2)this.pointer2=null,t.consumed=!0,this.scaleOrigin=this.t1;else if(t.identifier===this.pointer1&&null!==this.pointer2)this.pointer1=this.pointer2,this.pointer2=null,this.t1=this.t2,this.scaleOrigin=this.t1,t.consumed=!0;else if(t.identifier===this.pointer1){this.pointer1=null,this.active=!0;var r=void 0,a=void 0,o=void 0;if(e.scrolling.enabled){o=-t.vx,o=o>0?Math.min(o,.002*this.scene.width):Math.max(o,.002*-this.scene.width);var l=this.getVisibleRange();o=o*l/this.scene.width}else o=0;if(this.updateFriction(i),this.inertiaF.jump(this._currentFrom,o,i),this.inertiaT.jump(this._currentTo,o,i),this._animationsDone=!1,e.scrolling.swipePageFlipping&&t.swipeUp&&this.scalingActive&&t.swipeSpeed>this.scene.height/e.swipeSensitivity){var h=this.onZoomOut(this.dragStartFrom,this.dragStartTo,this.scaleOrigin);r=h.from,a=h.to}else if(e.scrolling.swipePageFlipping&&t.swipeDown&&this.scalingActive&&t.swipeSpeed>this.scene.height/e.swipeSensitivity){var u=this.onZoomIn(this.dragStartFrom,this.dragStartTo,this.scaleOrigin);r=u.from,a=u.to}else if(n||s){if(n&&!s&&e.scrolling.swipePageFlipping&&(t.swipeLeft||t.swipeRight)&&t.swipeSpeed>this.scene.width/e.swipeSensitivity*.7){var c=t.swipeLeft?"<":">",p=this.onScroll(this.dragStartFrom,this.dragStartTo,c);r=p.from,a=p.to}else r=this._currentFrom,a=this._currentTo;this.scaleOrigin=(r+a)/2}if(r||a){var f=this.onSnapAfterDragging(this.inertiaF.getTargetValue(),this.inertiaT.getTargetValue(),this.scaleOrigin,n||0!==s,s);f&&this.goToPosition(f.from,f.to,!0,i,!1),t.consumed=!0,this.scaleOrigin=null}this.active=!1,this.dragStartFrom=null,this.dragStartTo=null,this.scalingActive=0,this.scrollingActive=!1}else(s||n)&&(t.consumed=!0)},e.prototype.onPointerCancel=function(t){t.identifier===this.pointer2?(this.pointer2=null,this.scaleOrigin=this.t1):t.identifier===this.pointer1&&null!==this.pointer2?(this.pointer1=this.pointer2,this.t1=this.t2,this.scaleOrigin=this.t1,this.pointer2=null,this.t2=null):t.identifier===this.pointer1&&(this.active=!0,this.pointer1=null,this.t1=null,this.scaleOrigin=null,this.dragStartFrom=null,this.dragStartTo=null,this.scalingActive=0,this.scrollingActive=!1,this.active=!1)},e.prototype.onKeyDown=function(t){},e.prototype.goToPositionDragging=function(t,e){this.setFrom(t),this.setTo(e),this.clearZoomHighlight(),this.onPositionChanged(t,e)},e.prototype.goToPosition=function(t,e,i,n,s){if(t<e)if(this._currentFrom<this._currentTo||(i=!1),this.stopAnimations(),i){var r=this._settings.zooming.zoomHighlightThreshold,a=this._currentFrom,o=this._currentTo;this.updateFriction(n,t,e),this.setFrom(t,!0,n,s),this.setTo(e,!0,n,s);var l=Math.abs((t-e)/(a-o+1));if(l<1/r)this.setZoomHighlight(t,e,!0);else if(l>r){var h=null!==this.dragStartFrom?this.dragStartFrom:a,u=null!==this.dragStartTo?this.dragStartTo:o;this.setZoomHighlight(h,u,!1)}this.events.notifySceneChanges({requestPaint:!0})}else this.setFrom(t),this.setTo(e),this.clearZoomHighlight(),this.onPositionChanged(t,e),this.onAnimationDone(t,e),this._animationsDone=!0},e.prototype.doAnimations=function(t){if(!this._animationsDone){var e=t.timeStamp,i=this.inertiaF.finished(e),n=this.inertiaT.finished(e);this._animationsDone=i&&n;var s=this._currentFrom=this.getFrom(e),r=this._currentTo=this.getTo(e);this._animationsDone||isNaN(s+r)?(this.stopAnimations(),this.onPositionChanged(s,r,!1),this.onAnimationDone(s,r)):(this.onPositionChanged(s,r,!0),t.animating=!0)}},e.prototype.stopAnimations=function(){this.highlight&&(this.highlightRemoveWhenDone?this.clearZoomHighlight():(this.highlight.style.fillColor=this.scene.settings.area.style.zoomHighlightInactive.fillColor,this.events.notifySceneChanges({highlight:!0})))},e.prototype.abort=function(){this.isActive()&&(this.pointer2&&this.onPointerCancel({identifier:this.pointer2}),this.pointer1&&this.onPointerCancel({identifier:this.pointer1}),this.setFrom(this._currentFrom),this.setTo(this._currentTo),this.clearZoomHighlight(),this._animationsDone=!0)},e.prototype.isActive=function(){return this.active||null!=this.pointer1||!this._animationsDone},e.prototype.clearZoomHighlight=function(){this.highlight&&(this.scene.removeHighlight("zoomTrace"),this.highlight=null,this.events.notifySceneChanges({highlight:!0}))},e.prototype.setZoomHighlight=function(t,e,i){this.highlight=this.scene.setHighlight("zoomTrace",t,e,this.scene.settings.area.style.zoomHighlight),this.highlightRemoveWhenDone=i,this.events.notifySceneChanges({highlight:!0})},e.prototype.updateFriction=function(t,e,i){var n=this.getVisibleRange();if(null!=e&&null!=i){var s=i-e,r=.3,a=n*(1-r)>s,o=n*(1+r)<s;o&&(n=s),(a||o)&&(n*=2)}var l=n*this._settings.scrolling.kineticFriction;this.inertiaF.setAcceleration(l,t),this.inertiaT.setAcceleration(l,t)},e}(d.ChartElement);t.Scrolling=O;var H=function(t){function e(){t.apply(this,arguments),this.highlights={},this.seriesWithLabels=0,this.dataLabels={spots:{},fontWidths:Object.create(null),metaData:{availableWidth:0,processed:0,styles:null}},this.bottomAxisSize=0}return n(e,t),e.prototype.xyInChart=function(t,e){return t>=this.x0&&t<this.x0+this.width&&e>=this.y0&&e<this.y0+this.height},e.prototype.xyInChartOrBottom=function(t,e){var i=this.settings.interaction.ignoreBottomAxis?0:this.bottomAxisSize;return t>=this.x0&&t<this.x0+this.width&&e>=this.y0&&e<this.y0+this.height+i},e.prototype.xyInBottom=function(t,e){return!this.settings.interaction.ignoreBottomAxis&&(t>=this.x0&&t<this.x0+this.width&&e>=this.y0+this.height&&e<this.y0+this.height+this.bottomAxisSize)},e.prototype.timeToX=function(t){throw"Need to implement timeToX"},e.prototype.xToTime=function(t){throw"Need to implement xToTime"},e.prototype.setHighlight=function(t,e,i,n){var s=this.highlights[t];return s?(s.from=e,s.to=i,s.style=n,s.removed=!1):(s={from:e,to:i,style:n,removed:!1},this.highlights[t]=s),s},e.prototype.removeHighlight=function(t){var e=this.highlights[t];e&&(e.removed=!0,delete this.highlights[t])},e}(d.Scene);t.Scene=H;var _=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.paintOrder=45,this.updateOrder=700,this.scene=null,this.customId=0,this.animating=!1,this.highlights={},this.chart=e,this.scene=e.scene}return n(e,t),e.prototype.doAnimations=function(t){if(t.changes.highlight){var e=[];for(var i in this.highlights){var n=this.highlights[i];n.exiting=!0,n.origin.removed&&(delete this.highlights[i],n.animator=null,e.push(n))}for(var s=0;s<e.length;s++){var n=e[s];this.highlights["__"+ ++this.customId]=n}for(var i in this.scene.highlights){var r=this.scene.highlights[i];if(this.highlights[i]){var n=this.highlights[i];n.exiting=!1,n.from=r.from,n.to=r.to,n.style=d.Helpers.clone(r.style)}else{var n={from:r.from,to:r.to,style:d.Helpers.clone(r.style),animator:null,exiting:!1,origin:r};this.highlights[i]=n,r.style.fadeIn>0&&(this.animating=!0,n.animator=new d.ColorAnimator(d.Colors.derive(d.Colors.parse(n.style.fillColor),1,0),n.style.fillColor,n.style.fadeIn,"=",t.timeStamp))}}for(var i in this.highlights){var n=this.highlights[i];if(n.exiting&&!n.animator){var a=n.style;a.fadeOut>0?(this.animating=!0,n.animator=new d.ColorAnimator(a.fillColor,d.Colors.derive(d.Colors.parse(a.fillColor),1,0),a.fadeOut,"=",t.timeStamp)):delete this.highlights[i]}}}if(this.animating){var o=!1,l=t.timeStamp;for(var i in this.highlights){var n=this.highlights[i];n.animator&&(n.style.fillColor=n.animator.get(l),n.animator.finished(l)?(n.animator=null,n.exiting&&delete this.highlights[i]):o=!0)}this.animating=o,t.animating=t.animating||o}},e.prototype.paintScene=function(t){var e=this.scene.x0,i=e+this.scene.width,n=Math.round(this.scene.y0),s=this.scene.height,r=t.context;for(var a in this.highlights){var o=this.highlights[a],l=Math.max(this.scene.timeToX(o.from),e),h=Math.min(this.scene.timeToX(o.to),i);h<e||l>i||(d.Graphics.rectStyle(r,o.style),r.fillRect(l,n,h-l,s))}},e}(d.ChartElement);t.Highlights=_;var R=function(t){function e(e){t.call(this,e),this.rightAxis=null,this.leftAxis=null,this.timeAxisPanel=null}return n(e,t),e.prototype.createDom=function(e){t.prototype.createDom.call(this,e),this.timeAxisPanel=d.Helpers.createDom("div","DVSL-TC-timeAxis",null,this.backgroundContainer),d.DomLayer.setContainerStyle(this.timeAxisPanel),this.leftAxis=d.Helpers.createDom("div","DVSL-valueAxis",null,this.backgroundContainer),d.DomLayer.setContainerStyle(this.leftAxis),this.rightAxis=d.Helpers.createDom("div","DVSL-valueAxis",null,this.backgroundContainer),d.DomLayer.setContainerStyle(this.rightAxis)},e.prototype.doAnimations=function(e){t.prototype.doAnimations.call(this,e),e.changes.bounds&&(this.background.style.left=this.scene.x0+"px",this.background.style.right=this.scene.chartWidth-(this.scene.x0+this.scene.width)+"px",this.leftAxis.style.width=this.scene.leftMargin+"px",this.leftAxis.style.bottom=this.scene.bottomMargin+"px",this.rightAxis.style.width=this.scene.rightMargin+"px",this.rightAxis.style.bottom=this.scene.bottomMargin+"px",this.timeAxisPanel.style.top=this.scene.y0+this.scene.height+"px",this.timeAxisPanel.style.left=this.scene.x0+"px",
  46. this.timeAxisPanel.style.width=this.scene.width+"px",this.outerBorder.style.left=this.scene.x0+"px",this.outerBorder.style.width=this.scene.width+"px")},e}(d.DomLayer);t.DomLayer=R;var B=function(t){function e(e,i,n){t.call(this,e,i,n),this.scrolling=null,this.renderer=null}return n(e,t),e.prototype.createDomLayer=function(){return new R(this)},e.prototype.notifyAnimationDone=function(){var t=this;window.setTimeout(function(){t.removed||t.dispatchEventParams("animationDone",t.createEventArguments(null,"api"),null)},0)},e.prototype.processChangedSettings=function(t){var e=t.settingsChanges;e&&(g._hasSeriesSettingsChanged(e)&&(t.linearChartSeries=!0),(e.valueAxis||e.valueAxisDefault)&&(t.linearChartValueAxis=!0))},e.prototype.updateSettings=function(e,i){t.prototype.updateSettings.call(this,e,i)},e.prototype.setLogScale=function(t,e){var i={};for(var n in this.settings.valueAxis)i[n]={logScale:t};this.updateSettings({valueAxisDefault:{logScale:t},valueAxis:i},e)},e.prototype.finalInitialize=function(){t.prototype.finalInitialize.call(this),this.legend=this.events.addElement(new h(this))},e.prototype.getEnabledSeries=function(){for(var t=[],e=this.settings._computedSeries,i=0,n=e.length;i<n;i++)e[i].enabled&&t.push(e[i]);return t},e}(d.Impl);t.Impl=B;var U=function(t){function e(e){t.call(this),this.animationOrder=10,this.t0=0,this.t1=0,this.object=null,this.activePointer=null,this.pointerX=0,this.pointerY=0,this.chart=e,this.container=e.shell.interactiveContainer,this.scene=e.scene,this.events=e.events,this.popup=new d.InfoPopup(this.chart),this.settings=e.scene.settings.info}return n(e,t),e.prototype.getPopupAreaMouseMoved=function(t,e){return null},e.prototype.buildHeader=function(t,e){return""},e.prototype.show=function(t){this.settings.enabled&&(this.pointerX=t.x,this.pointerY=t.y,this.updatePopup(t))},e.prototype.previewPointerMove=function(t){!this.settings.enabled||null!==this.activePointer&&this.activePointer!==t.identifier||(this.pointerX=t.x,this.pointerY=t.y,this.updatePopup(t))},e.prototype.previewPointerDrag=function(t){!this.settings.enabled||null!==this.activePointer&&this.activePointer!==t.identifier||(this.activePointer=t.identifier,this.pointerX=t.x,this.pointerY=t.y)},e.prototype.previewPointerCancel=function(t){null!==this.activePointer&&this.activePointer===t.identifier&&(this.activePointer=null)},e.prototype.previewPointerUp=function(t){null!==this.activePointer&&this.activePointer===t.identifier&&(this.activePointer=null)},e.prototype.previewPointerOut=function(t){!this.settings.enabled||null!==this.activePointer&&this.activePointer!==t.identifier||t.touch||(this.activePointer=null,this.pointerX=null,this.pointerY=null,d.Helpers.isParentOf(this.popup.popup,t.target)||this.hideInfoPopup(t))},e.prototype.previewRightClick=function(t){this.settings.enabled&&t.touch&&(this.activePointer=t.identifier,this.previewPointerMove(t))},e.prototype.previewPointerDown=function(t){this.settings.enabled&&null===this.activePointer&&(this.activePointer=t.identifier,this.hideInfoPopup(t))},e.prototype.updatePopup=function(t){if(!this.pointerX&&!this.pointerY)return void this.hideInfoPopup(t);var e=this.getPopupMouseMoved(this.pointerX,this.pointerY,this.t0,this.t1,this.object,this.contents);e?this.showInfoPopup(e.t0,e.t1,e.obj,e.contents,t):this.hideInfoPopup(t)},e.prototype.manualShowInfoPopup=function(t,e,i){this.showInfoPopup(t,e,null,i||this.buildContent(t,e,null,null),null)},e.prototype.showInfoPopup=function(t,e,i,n,s){if(!this.popup.visible||t!==this.t0||e!==this.t1||i!==this.object||this.contents!==n){var r=this.scene,a=this.settings;this.t0=t,this.t1=e,this.object=i,this.contents=n,r.setHighlight("infoRange",t,e,a.style.highlight),this.popup.show(r.timeToX(this.t0),r.timeToX(this.t1),r.y0,n,d.InfoPopupPosition[a.position]),this.notifyChanges(s)}},e.prototype.notifyChanges=function(t){t?(t.changes.infoLabel=!0,t.changes.highlight=!0):this.events.notifySceneChanges({infoLabel:!0,highlight:!0})},e.prototype.hideInfoPopup=function(t){this.popup.visible&&(this.popup.hide(),this.t0=0,this.t1=0,this.scene.removeHighlight("infoRange"),this.notifyChanges(t))},e.prototype.paintScene=function(t){this.popup.visible&&this.updateXY()},e.prototype.updateXY=function(){var t=this.scene;this.popup.updateXY(t.timeToX(this.t0),t.timeToX(this.t1),t.y0,d.InfoPopupPosition[t.settings.info.position])},e.prototype.getPopupMouseMoved=function(t,e,i,n,s,r){if(this.scene.displayUnit&&!this.scene.xyInChartOrBottom(t,e))return null;var a=this.getPopupAreaMouseMoved(t,e);if(!a)return null;var o=a.t0,l=a.t1,h=null,u=null,c=this.scene.hoverSeriesItem,d=this.settings.advanced.scope,p=o,f=l;if(c&&(u=c.seriesIndex,("stack"===d||"value"===d||"auto"===d&&void 0!==u&&null!==u)&&(p=this.scene.xToTime(c.x0),f=this.scene.xToTime(c.x1)),h=c.stack),null===p)return null;if(p===i&&f===n&&u===s)return{t0:i,t1:n,obj:s,contents:r};var g=this.buildContent(o,l,u,h);return{t0:p,t1:f,obj:u,contents:g}},e.prototype.getContentsFunctionRange=function(t,e){return[t,e]},e.prototype.buildContent=function(t,e,i,n){var s,r=this.settings.advanced,a=this.chart.renderer.exportData(t,e);if(r.contentsFunction){var o=null;null!==i&&this.scene.settings._computedSeries.length>i&&(o=this.scene.settings._computedSeries[i]),s=r.contentsFunction.call(this.chart.api,a,o,this.getContentsFunctionRange(t,e))}else s=this.buildValues(a,i,n);if(!r.showHeader)return s;var l=this.buildHeader(t,e);return l+s},e.prototype.buildValues=function(t,e,i){for(var n=this.chart.settings,s=n.localization.noDataLabel,r=n.info.valueFormatterFunction,a=n.info.advanced.showOnlyHoveredSeries?n.info.advanced.scope:null,o=i&&("stack"===a||"value"===a)||"auto"===a&&void 0!==e&&null!==e,l="value"===a,h="",u=!1,c=0;c<t.length;c++){var p=t[c];if(o){for(var f=!1,g=0;g<p.data.length;g++){var m=p.data[g];m.config.showInLegend&&(m.values||n.info.showNoData)&&(f=f||null!==e&&m.config===n._computedSeries[e]||i===p.stack)}if(!f)continue}var v=t.length+p.data.length===2?"":n.localization.unnamedSeries;p.name&&(u&&(h+="</table>",u=!1),p.data.length>1?h+="<h3>"+p.name+"</h3>":v=p.name),u||(h+='<table cellspacing="0">',u=!0);for(var g=0;g<p.data.length;g++){var m=p.data[g],y=null!==e&&m.config===this.scene.settings._computedSeries[e];if(m.config.showInLegend&&(m.values||n.info.showNoData)&&(!l||y)){h+="<tr><td";var S=void 0,b=void 0,x=m.config;if(n instanceof C?(S=x.style.fillColor,b=x.style.lineColor):(S=x.style.lineColor,b=x.style.fillColor),S&&"transparent"!==S||(S=b),S&&(h+=' data-color="'+S+'"'),y&&(h+=" data-selected"),h+=">",h+=m.name||v,h+="</td><td>",r)h+=r.call(this.chart.api,m.values,m.config);else if(m.values)if(m.values.count>1&&n.info.aggregations&&n.info.aggregations.length>0)for(var w=0;w<n.info.aggregations.length;w++){var L=n.info.aggregations[w];h+=""+d.Helpers.numberFormat(m.values[L])+("&nbsp;("+L+")")}else h+=x.data.aggregation?d.Helpers.numberFormat(m.values[x.data.aggregation]):d.Helpers.numberFormat(m.values.sum);else h+=s;h+="</td></tr>"}}}return u&&(h+="</table>"),h},e}(d.ChartElement);t.InfoPopup=U;var V=function(){function t(t,e){if(this.axisConfigList=e,this.chart=t,this.axis=Object.create(null),0!==e.length)for(var i=!1,n=0;n<e.length;n++){var s=e[n];this.axis[s.id]=new p(t,s),!i&&s.enabled&&(i=!0,this.axis[s.id].isPrimary=!0)}}return t.prototype.getAxis=function(t){return this.axis[t]},t.prototype.getPanels=function(t){for(var e=[],i=0;i<this.axisConfigList.length;i++){var n=this.axisConfigList[i],s=this.axis[n.id].getPanel();(s||t)&&e.push(s)}return e},t.prototype.setPanels=function(t){for(var e=0;e<this.axisConfigList.length;e++){var i=this.axisConfigList[e];this.axis[i.id].setPanel(t[e])}},t.prototype.updateMinMax=function(t){for(var e in this.axis)this.axis[e].updateMinMax(t)},t.prototype.doAnimations=function(t){for(var e in this.axis)this.axis[e].doAnimations(t)},t.prototype.paintUnder=function(t){for(var e in this.axis)this.axis[e].paintUnder(t)},t.prototype.paint=function(t){for(var e in this.axis)this.axis[e].paint(t)},t}();t.ValueAxisSet=V,function(t){var e=function(){function e(t,e){this.stacks=[],this.idToStack={},this.paddingSum=0,this.scene=e,this.chart=t}return e.prototype.addSeries=function(e,i,n,s){var r;if(i.stack){var a=i.stack+"#"+i.type;r=this.idToStack[a],r||(r=this.idToStack[a]=new t.Stack(this.chart,this.scene,this,n,s),this.stacks.push(r))}else r=new t.Stack(this.chart,this.scene,this,n,s),this.stacks.push(r);r.addSeries(e,i)},e.prototype.afterInit=function(){for(var t=0;t<this.stacks.length;t++){var e=this.stacks[t];e.afterInit()}},e.prototype.process=function(t){for(var e=0;e<this.stacks.length;e++){var i=this.stacks[e];i.process(t)}},e.prototype.afterProcess=function(){for(var t=0;t<this.stacks.length;t++){var e=this.stacks[t];e.afterProcess()}},e.prototype.paint=function(t,e){for(var i=0;i<this.stacks.length;i++){var n=this.stacks[i];n.paint(t,e)}},e.prototype.hitTestStack=function(t,e){for(var i=null,n=1/0,s=0;s<this.stacks.length;s++){var r=this.stacks[s],a=r.hitTestStack(t,e),o=a.result,l=a.distance;l<n&&(n=l,i=o)}return{result:i,distance:n}},e.prototype.hitTest=function(t,e,i){for(var n=null,s=1/0,r=0;r<this.stacks.length;r++){var a=this.stacks[r],o=a.hitTest(t,e,i),l=o.result,h=o.distance;h<s&&(s=h,n=l)}return{result:n,distance:s}},e.prototype.exportData=function(t,e,i){for(var n=0;n<this.stacks.length;n++){var s=this.stacks[n];i.push(s.exportData(t,e))}},e.prototype.computeStackCenterRadius=function(t,e,i,n){if(!(e.length<2)){for(var s=this.stacks.length,r=this.stacks.indexOf(t),a=(r+.5)/s,o=.5/s,l=0,h=0,u=0;u<this.stacks.length;u++){var c=this.stacks[u];l+=c.paddingLeft+c.paddingRight}for(var u=0;u<this.stacks.length;u++){var c=this.stacks[u];if(h+=c.paddingLeft,c===t)break;h+=c.paddingRight}var d=e[1]-e[0];l>d/2&&(l=d/2,h=h/d*(d-l));for(var u=0;u<e.length-1;u++){var p=e[u],f=e[u+1]-p-l;i[u]=p+f*a+h,n[u]=f*o}}},e}();t.Cluster=e}(i);var G=function(){function t(t,e){this.valueAxisSet=e,this.chart=t,this.scene=this.chart.scene,this.clusters=[],this.buildSeries()}return t.prototype.buildSeries=function(){this.clusters=[];for(var t={},e=null,n={},s=new v,r=this.scene.settings,a=0;a<r._computedSeries.length;a++){var o=r._computedSeries[a];if(o.enabled){var l=void 0;o.cluster?(l=t[o.cluster],l||(l=t[o.cluster]=new i.Cluster(this.chart,this.scene),this.clusters.push(l))):"line"===o.type?o.stack?n.hasOwnProperty(o.stack)?l=n[o.stack]:(l=n[o.stack]=new i.Cluster(this.chart,this.scene),this.clusters.push(l)):(l=new i.Cluster(this.chart,this.scene),this.clusters.push(l)):(e||(e=new i.Cluster(this.chart,this.scene),this.clusters.push(e)),l=e);var h=r._computedStacks[o.stack]||s;l.addSeries(a,o,h,this.valueAxisSet.getAxis(o.valueAxis))}}for(var u=0;u<this.clusters.length;u++){var l=this.clusters[u];l.afterInit()}},t.prototype.process=function(t){for(var e=0;e<this.clusters.length;e++){var i=this.clusters[e];i.process(t)}},t.prototype.afterProcess=function(){for(var t=0;t<this.clusters.length;t++){var e=this.clusters[t];e.afterProcess()}},t.prototype.paint=function(t){var e=t.context;this.scene.seriesWithLabels=0;for(var i=0;i<this.clusters.length;i++)for(var n=this.clusters[i],s=0;s<n.stacks.length;s++)for(var r=n.stacks[s].series,a=0;a<r.length;a++){var o=r[a];o.valueLabels&&o.valueLabels.enabled&&this.scene.seriesWithLabels++}for(var l=0;l<this.clusters.length;l++){var h=this.clusters[l];h.paint(t,e)}},t.prototype.hitTest=function(t,e,i){void 0===i&&(i=4);for(var n=null,s=1/0,r=0;r<this.clusters.length;r++){var a=this.clusters[r],o=a.hitTest(t,e,i),l=o.result,h=o.distance;h<s&&(n=l,s=h)}if(s>i){s=1/0,n=null;for(var r=0;r<this.clusters.length;r++){var a=this.clusters[r],u=a.hitTestStack(t,e),l=u.result,h=u.distance;h<s&&(n=l,s=h)}}return n},t.prototype.exportData=function(t,e){for(var i=[],n=0;n<this.clusters.length;n++){var s=this.clusters[n];s.exportData(t,e,i)}return i},t}();t.Renderer=G}(l),function(t){var e=t.Bar||(t.Bar={}),i=864e5,s=function(){function e(t,i,n){this.count=i;var s=e.parsingMap[t];if(!s)throw new Error("Time unit `"+t+"` is not recognized.");this.unit=t,this.name=void 0===n?this.count+" "+this.unit:n}return e.isGoodUnit=function(t){return e.parsingMap.hasOwnProperty(t)},e.parse=function(t,i,n){if(void 0===n&&(n=!0),null==t)return null;if(d.Helpers.isString(t)){var s=1,r=void 0,a=t.split(" ");if(2===a.length){if(s=d.Helpers.tryParseFloat(a[0],null),null===s||(0|s)!==s){if(n)throw new Error("Cannot parse the time unit - the correct format is `1 s`: "+t);return null}r=a[1]}else{if(1!==a.length){if(n)throw new Error("Cannot parse the time unit - the correct format is `1 s`: "+t);return null}s=1,r=a[0]}if(r=e.parsingMap[r],null==r){if(n)throw new Error("Cannot parse the time unit - unrecognized time unit: "+t);return null}return new e(r,s,i||t)}if(t instanceof e)return t;if(n)throw new Error("Cannot parse the unit text because it is not a string: "+t);return null},e.prototype.clone=function(){return new e(this.unit,this.count,this.name)},e.prototype.add=function(t,e){void 0===e&&(e=1);var n=this.unit,s=this.count*e;if("ms"===n)t+=s;else if("s"===n)t+=1e3*s;else if("m"===n)t+=6e4*s;else if("h"===n)t+=36e5*s;else if("d"===n)t+=s*i;else if("w"===n)t+=s*i*7;else{var r=new Date(t);"y"===n?r.setUTCFullYear(r.getUTCFullYear()+s):"M"===n&&r.setUTCMonth(r.getUTCMonth()+s),t=r.getTime()}return t},e.prototype.sub=function(t,e){return void 0===e&&(e=1),this.add(t,-1*e)},e.prototype.numberOfUnits=function(i,n){return Math.round(t.moment(n).utc().diff(t.moment(i).utc(),e.unitsTranslation[this.unit],!0)/this.count)},e.prototype.toShortString=function(){return 1===this.count?this.unit:this.toString()},e.prototype.toString=function(){return this.count+" "+this.unit},e.prototype.approxTime=function(){return e.timeUnitDiffs[this.unit]*this.count},e.prototype.isSmallerOrEqual=function(t){return this.approxTime()<=t.approxTime()},e.prototype.isSmaller=function(t){return this.approxTime()<t.approxTime()},e.prototype.isBigger=function(t){return this.approxTime()>t.approxTime()},e.prototype.isEqual=function(t){return!!t&&this.approxTime()===t.approxTime()},e.prototype.getBigger=function(){return"y"===this.unit?new e(this.unit,10*this.count):new e(e.toBiggerUnit[this.unit],1)},e.prototype.roundTimeDown=function(t,e){if(null==t)return null;t=Math.round(t);var n=this.count,s=this.unit;if("ms"===s)return Math.floor(t/n)*n;if("s"===s)return Math.floor(t/1e3/n)*n*1e3;if("m"===s)return Math.floor(t/6e4/n)*n*6e4;if("h"===s)return Math.floor(t/36e5/n)*n*36e5;if("d"===s){if(n%7!==0)return Math.floor(t/i/n)*n*i;s="w",n/=7}if("w"===s){var r=e.week.dow+3,a=t;return t=(t/i-r)/7+1,t=(Math.floor(t/n)*n*7+r)*i,t>a&&(t-=7*i),t}var o=new Date(Math.floor(t/i)*i);if("y"===s)return o.setUTCFullYear(Math.floor(o.getUTCFullYear()/n)*n,0,1),o.getTime();if("M"===s){var l=12*o.getUTCFullYear()+o.getUTCMonth();return o.setUTCMonth(o.getUTCMonth()+Math.floor(l/n)*n-l,1),o.getTime()}throw new Error("Unrecognized unit: `"+this.unit+"`")},e.prototype.roundTimeUp=function(t,e){return null==t?null:this.roundTimeDown(this.add(t)-1,e)},e.prototype.roundTimeRound=function(t,e){return null==t?null:this.roundTimeDown((this.add(t)+t-1)/2,e)},e.prototype.isMultipleOf=function(t){var e=this.unit,i=t.unit,n=this.approxTime(),s=t.approxTime(),r=n/s;if(r<1||(0|r)!==r)return!1;if(e===i)return!0;if(1===t.count&&"w"!==i)return!0;var a=864e5,o=a/s;return o>=1&&(0|o)===o||("y"===e?"M"===i:"M"!==e&&"w"!==e)},e.parsingMap={milliseconds:"ms",millisecond:"ms",sec:"s",second:"s",seconds:"s",min:"m",minute:"m",minutes:"m",hour:"h",hours:"h",day:"d",days:"d",week:"w",weeks:"w",mon:"M",month:"M",months:"M",year:"y",years:"y",ms:"ms",s:"s",m:"m",h:"h",d:"d",D:"d",w:"w",W:"w",M:"M",y:"y",Y:"y"},e.knownUnits=["ms","s","m","h","d","w","M","y"],e.timeUnitDiffs={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:2592e6,y:31104e6},e.unitsTranslation={s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},e.toBiggerUnit={ms:"s",s:"m",m:"h",h:"d",d:"w",w:"M",M:"y",y:null},e.toSmallerUnit={ms:null,s:"ms",m:"s",h:"m",d:"h",w:"d",M:"d",y:"M"},e}();t.TimeStep=s,function(e){var i=function(t){function e(e,i){i.cssClass=i.cssClass||"DVSL-bar-btn-month",i.title=i.title||e.settings.localization.toolbar.periodDropdownTitle,t.call(this,e,i),this._getItemsCache=null,this.custom={displayAnchor:null,disabled:!1,displayPeriod:null,displayPeriodStr:null,displayUnit:null,displayUnitStr:null,selected:!1,name:e.settings.localization.toolbar.customPeriod},this.updateSelectedItem()}return n(e,t),e.prototype.onSelectionChange=function(t){this.chart.setDisplayPeriod(t.displayPeriodStr,t.displayAnchor,null==t.displayUnit?null:t.displayUnit.toString(),!0,"user")},e.prototype.onSceneChange=function(t){t.settings&&(this._getItemsCache=null),(t.settingsChanges&&(t.settingsChanges.area||t.settingsChanges.toolbar)||t.time)&&this.updateSelectedItem()},e.prototype.updateSelectedItem=function(){var t=this._lastSelectedItem;if(t&&t!==this.custom&&this.chart.isThisDisplayPeriod(t.displayPeriodStr,t.displayAnchor,t.displayUnitStr))return void this.setSelectedItem(t);for(var e=this.getItems(),i=0;i<e.length;i++){var n=e[i];if(n!==t&&this.chart.isThisDisplayPeriod(n.displayPeriodStr,n.displayAnchor,n.displayUnitStr))return void this.setSelectedItem(n)}this.setSelectedItem(this.custom)},e.prototype.setSelectedItem=function(e){this._lastSelectedItem&&(this._lastSelectedItem.selected=!1),e.selected=!0,t.prototype.setSelectedItem.call(this,e),this._lastSelectedItem=e},e.prototype.getItems=function(){if(this._getItemsCache)return this._getItemsCache;for(var t=[],e=this.chart.settings._minUnit,i=this.custom,n=0;n<this.chart.settings.toolbar.periods.length;n++){var s=this.chart.settings.toolbar.periods[n],r=s.parse(),a=r.displayPeriod,o=r.displayUnit;o&&o.isSmaller(e)||a&&a.isSmallerOrEqual(e)||(t.push(r),this.chart.isThisDisplayPeriod(s.displayPeriod,r.displayAnchor,s.displayUnit)&&(i=r))}return this._lastSelectedItem=i,i.selected=!0,this._getItemsCache=t,t},e}(d.Bar.Combobox);e.DisplayPeriodDropdown=i,d.Bar.ToolbarItemNames.displayPeriod=function(e,i){return new t.Bar.DisplayPeriodDropdown(e,i)};var s=function(t){function e(e,i){i||(i={}),i.cssClass=i.cssClass||"DVSL-bar-btn-bars",i.title=i.title||e.settings.localization.toolbar.unitDropdownTitle,t.call(this,e,i),this.updateSelectedItem()}return n(e,t),e.prototype.onSelectionChange=function(t){this.chart.setDisplayUnit(t.value,!0,"user")},e.prototype.onSceneChange=function(t){t.settings&&(this._getItemsCache=null),(t.settingsChanges&&(t.settingsChanges.area||t.settingsChanges.toolbar)||t.time)&&this.updateSelectedItem()},e.prototype.updateSelectedItem=function(){var t=this.chart.displayUnit;if(t){for(var e=this.getItems(),i=0;i<e.length;i++){var n=e[i];if(n.value.isEqual(t))return void this.setSelectedItem(n)}this.setSelectedItem({name:t.name,value:t,disabled:!1,selected:!0})}},e.prototype.getItems=function(){if(this._getItemsCache)return this._getItemsCache;for(var t=this.chart.scene,e=[],i=(t.timeEnd-t.timeStart)/t.width*this.chart.settings.timeAxis.minUnitWidth,n=!1,s=0;s<this.chart.settings._displayUnitsParsed.length;s++){var r=this.chart.settings._displayUnitsParsed[s];r.approxTime()<i?n||(e.push({name:this.chart.settings.localization.toolbar.unavailableUnitTitle,value:r,disabled:!0,selected:!1}),n=!0):e.push({name:r.name,value:r,disabled:!1,selected:r.isEqual(t.displayUnit)})}return e},e}(d.Bar.Combobox);e.DisplayUnitDropdown=s,d.Bar.ToolbarItemNames.displayUnit=function(e,i){return new t.Bar.DisplayUnitDropdown(e,i)}}(e);var r=function(){function t(t,e,i,n){this.name=null,this.displayAnchor=null,this.displayPeriod=null,this.displayUnit=null,void 0===e?this.displayPeriod=t:(this.name=t,this.displayAnchor=e,this.displayPeriod=i,this.displayUnit=n)}return t.prototype.parse=function(){var t=this.displayPeriod,e=this.displayUnit;return{name:this.name,displayAnchor:this.displayAnchor,displayPeriod:"max"===t?null:s.parse(t),displayPeriodStr:t,displayUnit:"auto"===e?null:s.parse(e),displayUnitStr:e,selected:!1,disabled:!1}},t}();t.SettingsAreaDisplayPeriod=r;var a=function(t){function e(){t.apply(this,arguments),this.enabled=!0,this.zoomOut=!0,this.logScale=!0,this.displayUnit=!0,this.displayPeriod=!0,this.zoomOutFunction=null,this.periods=[new r("Last second","now","1 s","25 ms"),new r("Last minute","now","1 m","1 s"),new r("Last hour","now","1 h","1 m"),new r("Last day","now","1 d","1 h"),new r("Last week","now","1 w","6 h"),new r("Last month","now","1 M","1 d"),new r("Last year","now","1 y","1 M"),new r("All data","newestData","max","auto")],this.items=[new d.SettingsToolbarItem("fullscreen","left"),new d.SettingsToolbarItem("back","left"),new d.SettingsToolbarItem("zoomOut","left"),new d.SettingsToolbarItem("logScale","right"),new d.SettingsToolbarItem("displayPeriod","right"),new d.SettingsToolbarItem("displayUnit","right"),new d.SettingsToolbarItem("export","right")]}return n(e,t),e}(d.SettingsToolbar);t.SettingsToolbar=a;var o=function(){function t(t){this.settings=t.settings,this.chart=t,this.scene=t.scene}return t.prototype.toBiggerDisplayUnit=function(t){for(var e=null,i=0;i<this.settings._displayPeriodsParsed.length;i++){var n=this.settings._displayPeriodsParsed[i];n.approxTime()>t.approxTime()&&(null===e||n.approxTime()<e.approxTime())&&(e=n)}return e},t.prototype.getMinRangeForUnit=function(t,e,i,n){var s=i.approxTime(),r=this.scene.settings.timeAxis.minUnitWidth,a=this.scene.settings.timeAxis.maxUnitWidth,o=this.verifyUnitWidth(t,e,i);if(o.min||o.max){d.Helpers.warn("Could not show all data as requested by `navigation.initialDisplayPeriod`. Please adjust either `navigation.initialDisplayPeriod` or `timeAxis.minUnitWidth` and `timeAxis.maxUnitWidth`.");var l=void 0;o.min?l=this.scene.width/r*s:o.max&&(l=this.scene.width/a*s),"oldestData"===n?e=t+l:t=e-l}return{from:t,to:e}},t.prototype.verifyUnitWidth=function(t,e,i){var n=i.approxTime(),s=this.scene.settings.timeAxis.minUnitWidth,r=this.scene.settings.timeAxis.maxUnitWidth,a=(e-t)/this.scene.width;return{min:!(s*a<n),max:!(r*a>n)}},t.prototype.adjustTimeRangeToUnits=function(t,e,i,n){var s,r=i-(i-e)/2,a=n.approxTime(),o=this.getUnitRange(t,[n]),l=i-e;s=l<o.minTime?Math.ceil(o.minTime/a):Math.min((i-e)/a,Math.floor(o.maxTime/a));var h=s*a;return e=r-h/2+1,i=r+h/2-1,{from:e,to:i}},t.prototype.preventUnitWidthViolation=function(t,e){var i=this.scene,n=i.width,s=(t-e)/n,r=s*i.settings.timeAxis.minUnitWidth;return r>i.displayUnit.approxTime()},t.prototype.getBiggerDisplayPeriod=function(t,e){for(var i=Math.abs(e-t),n=0,s=null,r=0;r<this.settings._displayPeriodsParsed.length;r++){var a=this.settings._displayPeriodsParsed[r],o=a.approxTime(),l=i/o;l<.9&&l>n&&(n=l,s=a)}return s},t.prototype.getBiggerDisplayUnit=function(t){for(var e=this.settings._displayUnitsParsed,i=t.approxTime(),n=0;n<e.length;n++){var s=e[n];if(s.approxTime()>i)return s}return t},t.prototype.getSmallerDisplayUnit=function(t){for(var e=this.settings._displayUnitsParsed,i=t.approxTime(),n=e.length-1;n>=0;n--){var s=e[n];if(s.approxTime()<i)return s}return null},t.prototype.getClosestDisplayPeriod=function(t,e,i){for(var n=null,s=0,r=null,a=1/0,o=0;o<this.settings._displayPeriodsParsed.length;o++){var l=this.settings._displayPeriodsParsed[o],h=l.approxTime();h<=t&&(null===n||s<h)&&(n=l,s=h),h>=t&&(null===r||a>h)&&(r=l,a=h)}return i?e&&e.approxTime()<.8*t?e:null!==r&&a<1.2*t||null===n?r:n:null!==n&&(s>.8*t||a>1.2*t)?n:r},t.prototype.isAllowedDisplayUnit=function(t){for(var e=0;e<this.settings._displayUnitsParsed.length;e++){var i=this.settings._displayUnitsParsed[e];if(i.isEqual(t))return!0}return!1},t.prototype.adjustTimeAfterScale=function(t,e,i,n){var s=this.scene,r=(e-t)/s.width,a=s.settings.timeAxis.minUnitWidth,o=s.displayUnit.approxTime();if(!(a*r<=o)){var l=i+(n-i)/2,h=s.width/a|0;t=l-h/2*o,e=l+h/2*o}return{from:t,to:e}},t.prototype.computeDisplayUnit=function(t,e,i,n,s,r,a){var o={from:n,to:s,unit:null};if(null!=n&&null!=s||d.Helpers.error("`computeDisplayUnit` called with invalid arguments."),a&&!a.scale&&a.scroll)return o.unit=i||this.scene.displayUnit,o;if(null!==t&&null!==e&&i&&Math.abs(e-t-(s-n))<.001)return o.unit=i,o;var l=this.scene.displayUnit,h=this.scene.settings,u=Math.max(r.width,10),c=h.timeAxis,p=Math.max(c.minUnitWidth,Math.min(u/3,c.maxUnitWidth)),f=(s-n)/u*c.minUnitWidth,g=(s-n)/u*p,m=null,v=0,y=h._displayUnitsParsed,S=h._minUnit.approxTime(),b="min"===c.unitSizePolicy;if(a&&a.scale){var C=1/0;i&&2!==a.scale&&(a.scale===-1?S=i.approxTime():C=i.approxTime());for(var x=0;x<y.length;x++){var w=y[x],L=w.approxTime();if(!(L<S||L>C)){var A=void 0;A=null===m||(b?L>=f&&L<v||v<f&&L>v:L<=g&&L>v||v>g&&L<v),A&&(m=w,v=L)}}m||(l.approxTime()!==y[y.length-1].approxTime()&&(d.Helpers.warn("`computeDisplayUnit` could not lookup the new unit - no units available matching the `minUnitWidth` and `maxUnitWidth` for the current range.",null,!0),this.scene.disableScaleLimiter=!0),m=this.scene.displayUnit)}else{var T=n,M=s,k=h.navigation.initialDisplayAnchor,P=this.chart.getDisplayLimits(),I=s===P.to&&("now"===k||"newestData"===k),D=n===P.from&&"oldestData"===k;l&&l.unit===h._minUnit.unit&&1===l.count&&(m=l);for(var F=50;--F>0;){for(var N=!1,x=0;x<y.length;x++){var w=y[x],L=w.approxTime();if(!(L<S))if(L<f)N=!0;else{if(!(L<=g))break;var A=void 0;A=null==m||(b?L<v:L>v),A&&(m=w,v=L)}}if(!m&&!N){var E=(T+M)/2,z=u/p*S/2;m=h._minUnit,T=E-z,M=E+z}if(m){var O=this.scene.timeStepSettings;return{from:m.roundTimeDown(T,O),to:m.roundTimeUp(M,O),unit:m}}var H=M-T,_=H-H/4>=S,R=_?H/4:H-S;I?T+=R:D?M-=R:(T+=R/2,M-=R/2),f=(M-T)/u*c.minUnitWidth,g=(M-T)/u*p}0===F&&d.Helpers.warn("`computeDisplayUnit` could not lookup the new unit. It is possible that the chart did not load the data properly.")}if(!m)throw d.Helpers.error("",t,e,i,n,s,u),new Error("Could not calculate displayUnit");return o.unit=m,o},t.prototype.tryComputeDisplayPeriod=function(t,e,i,n,r,a,o){var l="auto"===i?null:s.parse(i),h=null,u=null;if(t&&t.indexOf(">")>-1){var c=t.split(">",2);h=parseInt(c[0],10),u=parseInt(c[1],10);var p=s.timeUnitDiffs,f=!l||p[l.unit]<p.d;h=this.scene.timestampToInternal(h,f),u=this.scene.timestampToInternal(u,f)}else if("max"===t&&null!==n&&null!==r)h=n,u="now"===e?o:r;else if("max"!==t){var g=s.parse(t),m=void 0;m="now"===e?o:"newestData"===e&&null!==r?r:d.Helpers.tryParseFloat(e,null),g&&null!==m&&(h=g.sub(m),u=m)}if(null===h||null===u)return{from:null,to:null,unit:null};var v=this.getUnitRange(a),y=v.minTime,S=v.maxTime,b=v.minUnit,C=v.maxUnit;return u-h>S&&(l=C,h=u-S),u-h<y&&(l=b,h=u-y),{from:h,to:u,unit:l}},t.prototype.resolveFromTo=function(t,e,i){var n,s,r,a=this.scene,o=a.timeStepSettings,l=null,h=a.majorTimeUnit||i;return d.Helpers.isNumber(t)?n=t:(r="oldestDataRounded"===t)||"oldestData"===t?(null===l&&(l=this.chart.getDisplayLimits(i)),n=l.from,r&&(n=h.roundTimeDown(n,o))):(t&&d.Helpers.error("Invalid `interaction.scrolling.limitFrom` value '"+t+"'."),n=null),d.Helpers.isNumber(e)?s=e:(r="newestDataRounded"===e)||"newestData"===e?(null===l&&(l=this.chart.getDisplayLimits(i)),s=l.to,r&&(s=h.roundTimeUp(s,o))):"now"===e?s=a.getCurTime():(e&&d.Helpers.error("Invalid `interaction.scrolling.limitTo` value '"+e+"'."),s=null),{from:i.roundTimeDown(n,o),to:i.roundTimeUp(s,o)}},t.prototype.getUnitRange=function(t,e){void 0===e&&(e=this.settings._displayUnitsParsed);var i=e[e.length-1],n=i.approxTime(),s=e[0],r=s.approxTime(),a=Math.max(10,t.width),o=a/this.settings.timeAxis.minUnitWidth*n,l=a/this.settings.timeAxis.maxUnitWidth*r;return{minTime:l,maxTime:o,minUnit:s,maxUnit:i}},t.prototype.getLimits=function(t,e){var i=this.settings.interaction.scrolling,n=i.limitMode,s=e?null!==n:"block"===n;return s&&t?this.resolveFromTo(i.limitFrom,i.limitTo,t):{from:null,to:null}},t.prototype.preventOverscale=function(t,e,i,n,s,r,a){var o=this.getLimits(r,a),l=o.from,h=o.to,u=this.getUnitRange(t,e),c=u.minTime,p=u.maxTime;if(null!==l&&null!==h&&s-n>h-l){var f=(l+h)/2,g=(h-l)/2;return g=Math.max(g,c/2),this.adjustTimeRangeToUnits(t,f-g,f+g,r)}p*=.99,c*=1.01;var m=s-n;m=Math.min(m,p),m=Math.max(m,c);var v=m===c?m/(s-n):1;return null===i&&(i=(n+s)/2),n===s&&n>0&&d.Helpers.error("From = To, trouble",n,s),{from:i+(n-i)*v,to:i+(s-i)*v}},t.prototype.preventOverscroll=function(t,e,i,n){var s=this.getLimits(t,n),r=s.from,a=s.to,o=this.settings.interaction.scrolling,l=i-e;return null!==r&&null!==a&&(l=Math.min(l,a-r)),l*=o.overscrollProportion,null!==r&&(r-=l),null!==a&&(a+=l),null!==r&&null!==a&&a-r<i-e?(r<e?l=e-r:a>i&&(l=i-a),e-=l,i-=l):null!==a&&a<i?(l=i-a,e-=l,i-=l):null!==r&&r>e&&(l=r-e,e=r,i+=l),{from:e,to:i}},t.prototype.scroll=function(t,e,i,n,r,a){var o;if("displayUnit"===a)o=i.clone();else if("page"===a)o=this.getTimeRangeStep(t,e);else{if(!s.isGoodUnit(a))return void d.Helpers.error("Incorrect scroll unit: "+a);o=s.parse(a)}return o.count*=r,"<"===n?{from:o.sub(t),to:o.sub(e)}:{from:o.add(t),to:o.add(e)}},t.prototype.getTimeRangeStep=function(t,e){t=Math.round(t),e=Math.round(e);for(var i=null,n=this.scene.timeStepSettings,r=0;r<s.knownUnits.length;r++){var a=s.knownUnits[r],o=new s(a,1),l=o.roundTimeRound(t,n),h=o.roundTimeRound(e,n);t===l&&e===h&&(null===i||i.approxTime()<o.approxTime())&&(i=o)}return i.count=Math.max(1,i.numberOfUnits(t,e)),i},t}();t.TimeSetup=o;var h;h="undefined"!=typeof Float64Array?function(t){return Array.isArray(t)||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Int16Array||t instanceof Uint16Array}:function(t){return Array.isArray(t)};var u=function(t){function e(){t.apply(this,arguments),this.units=["ms","s","m","h","d","M","y"],this.url=null,this.urlByUnit=null,this.requestMaxUnits=1e4,this.prefetchRatio=1,this.minimizeRequests=!1,this.cacheSize=5e5,this.timestampInSeconds=!1,this.stringTimestampFormat=null,this.timeZoneOffset=null,this.dataFunction=null,this.preloaded=null,this.suppressWarnings=!1,this.useSmallerUnitCache=!0,this._skipRequestRangeRounding=!1}return n(e,t),e}(d.SettingsData);t.SettingsData=u;var c=function(){function e(t,e){this.chart=null,this.scene=null,this.settings=null,this.noData=!1,this.dataLimitFrom=null,this.dataLimitTo=null,this.dataLimitFromUnit=null,this.dataLimitToUnit=null,this.dataFrom=null,this.dataTo=null,this.error=null,this.cache={},this.requests={},this._pendingAddData=[],this.dataSettings=e,this.scene=t.scene,this.settings=t.settings,this.chart=t,this.dataId="data"+e.id,this._prepareUsableUnits(),this.updateDataLimit(null,null,null,null,new s("ms",1))}return e.binSearch=function(t,e){var i=0;if(!t)throw"no data";for(var n=t.length-1;i<n;){var s=(n+i)/2|0;if(t[s][0]<e)i=s+1;else{if(!(t[s][0]>e)){for(;s>0&&t[s-1][0]===e;)s-=1;return s}n=s}}return i<t.length&&t[i][0]<e?i+1:i},e.linSearchUp=function(t,e,i,n){if(n){for(var s=e+1;s<=t.length-1;s++)if(null!==n(t[s]))return s}else for(var s=e+1;s<=t.length-1;s++)if(null!==t[s][i])return s;return-1},e.linSearchDown=function(t,e,i,n){if(n){for(var s=e-1;s>=0;s--)if(null!==n(t[s]))return s}else for(var s=e-1;s>=0;s--)if(null!==t[s][i])return s;return-1},e.findSubrange=function(t,i,n){var s=e.binSearch(t,i),r=e.binSearch(t,n);return{i0:s,i1:r}},e.prototype.notifyAssetsLoaded=function(){if(t.moment&&t.moment.tz){for(var e=this._pendingAddData,i=0;i<e.length;i++){var n=e[i];this.addDataInt(n.request,n.parsedData,n.append)}this._pendingAddData=[]}},e.prototype.applyPreloadedData=function(){this.dataSettings.preloaded&&this.addData(this.dataSettings.preloaded)},e.prototype.remove=function(){this.scene.setMessage(this.dataId,null);for(var t in this.requests){var e=this.requests[t];e&&(e.callback=null)}},e.prototype._prepareUsableUnits=function(){var t=this.dataSettings.units;if(0===t.length)throw new Error("The `data.units` array must contain at least one value.");for(var e=this._units=new Array(t.length),i=0;i<t.length;i++){var n=t[i],r=s.parse(n,n,!0);r&&(e[i]={size:r.approxTime(),unit:r,key:r.toString()})}e.sort(function(t,e){return e.size-t.size})},e.prototype._findUsableUnit=function(t){for(var e=this._units,i=this.cache,n=0;n<e.length;n++){
  47. var s=e[n];if(null!==i[s.key]&&t.isMultipleOf(s.unit))return s.unit}this.chart.error("Cannot load data - no suitable data unit configured for the requested `"+t+"`.")},e.prototype.determineDataLimits=function(t,e,i,n){var s=this;if(t){if(t=this._findUsableUnit(t),!t)return}else t=this._units[0].unit;var r=null,a=null,o=t.approxTime();if(this.dataLimitFromUnit&&this.dataLimitFromUnit.approxTime()<=o&&(r=this.dataLimitFrom),this.dataLimitToUnit&&this.dataLimitToUnit.approxTime()<=o&&(a=this.dataLimitTo),!(e&&null==r||i&&null==a))return void n(this.dataLimitFrom,this.dataLimitTo,t);this.scene.setMessage(this.dataId,this.settings.localization.determiningDataBounds,999);var l=function(t,i,r,a){if(!a)return void s.scene.setMessage(s.dataId,null);if(null===s.dataLimitFrom&&e){if(t!==i)return void s.scheduleDataLoading(a,null,i,!1,function(t,e,n){return l(i,t,e,n)});s.dataLimitFrom=i}s.scene.setMessage(s.dataId,null),n(s.dataLimitFrom,s.dataLimitTo,a)},h=function(t,e,n,r,a){if(!a)return void s.scene.setMessage(s.dataId,null);if(null===s.dataLimitTo&&i){if(e!==r)return void s.scheduleDataLoading(a,r,null,!1,function(e,i,n){return h(t,r,e,i,n)});s.dataLimitTo=r}l(t+1,t,r,a)};this.scheduleDataLoading(t,null,null,!1,function(t,e,i){return h(t,e,t,e,i)})},e.prototype.getDataForRange=function(t,i,n,s){var r=this.dataSettings,a=null,o=!0,l=t,h=i;null!==this.dataLimitFrom&&(l=Math.max(this.dataLimitFrom,l)),null!==this.dataLimitTo&&(h=Math.min(this.dataLimitTo,h));for(var u=0;u<this._units.length;u++){var c=this._units[u],p=this.cache[c.key];if(p&&n.isMultipleOf(c.unit)&&p.from<i&&p.to>t){(r.useSmallerUnitCache||p.unit.approxTime()===n.approxTime())&&(a=p,o=l<p.from||h>p.to);break}}var f=!1;if(o&&(o=!!r.dataFunction||!!r.url||!!r.urlByUnit,o&&(!r.minimizeRequests||!this.chart.scrolling.isActive()))){var g=this._findUsableUnit(n),m=!1;a&&g.approxTime()===a.unit.approxTime()&&(l>=a.from&&(m=!0,l=Math.max(l,a.to)),(h<=a.to||l<a.from)&&(h=Math.min(h,a.from)));var v=g.numberOfUnits(t,i),y=r.cacheSize;v>y&&(d.Helpers.warn("The chart requires "+v+" values (using data unit `"+g+"`) to display the current time range. `data.cacheSize` limit (currently "+y+") will be automatically increased to allow this."),r.cacheSize=1.2*v|0),f=this.scheduleDataLoading(g,l,h,m,s)}if(a){var S=e.findSubrange(a.values,t,i),b=S.i0,C=S.i1;return{unit:n.unit,count:n.count,from:a.from,to:a.to,values:a.values,startIndex:b,endIndex:C,loading:f}}return f?{unit:n.unit,count:n.count,from:l,to:h,values:[],startIndex:0,endIndex:0,loading:!0}:(d.Helpers.warn("The datasource `"+r.id+"` cannot return data for unit "+n,null,!0),{unit:null,count:null,from:null,to:null,values:[],startIndex:0,endIndex:0,loading:!1})},e.prototype.updateData=function(t,e,i){var n=this._findUsableUnit(t),s=n.toString();if(this.cache[s]&&!this.requests[s]){var r=this.scene.timeStepSettings,a=n.roundTimeUp(e,r),o=n.roundTimeDown(this.cache[s].lastTimestamp,r);o<=a&&this.scheduleDataLoading(t,o,a,!1,i)}},e.prototype.scheduleDataLoading=function(t,e,i,n,r){var a=this;if(!t)throw"No unit";if(e>i)return!1;this.chart.log("Scheduling data loading "+t+","+e+","+i);var o=d.Helpers.performanceNow(),l=t.toString(),h=this.requests[l];if(h){if(!(h.time+this.dataSettings.requestTimeout<o))return this.chart.log("Already loading for selected period"),!0;h.callback=null,delete this.requests[l]}var u=e,c=i,p=this.scene.timeStepSettings;if(this.dataSettings._skipRequestRangeRounding||(null!==u&&(u=t.roundTimeDown(u,p)),null!==c&&(c=t.roundTimeUp(c,p))),null!==u&&null!==c){var g=(c-u)/t.approxTime();g>this.dataSettings.requestMaxUnits&&(n?c=t.add(u,this.dataSettings.requestMaxUnits):u=t.sub(c,this.dataSettings.requestMaxUnits))}var m=this.getDataFunction();if(!m)return this.chart.log("No data function. Cannot load data?"),!1;var v=s.timeUnitDiffs[t.unit]<s.timeUnitDiffs.d,y=v?null:this.settings.timeAxis.timeZone;this.requests[l]=h=new f(t,u,c,r,o,y);var S=function(t){return a.dataReceivedRaw(h,t)},b=function(){return a.dataFailed(h)};u=this.convertTimestampFromInternal(u,v),c=this.convertTimestampFromInternal(c,v),u===c&&null!==c&&c++;var C=m(u,c,t.toShortString(),S,b,y);return this.chart.log("Data requested "+t+", "+u+", "+c),(d.Helpers.isObjectOrArray(C)||d.Helpers.isString(C))&&(this.dataSettings.suppressWarnings||d.Helpers.warn("Data object should not be returned directly from the `dataFunction` delegate - instead call the `success` callback."),this.dataReceivedRaw(h,C)),!0},e.prototype.dataReceivedRaw=function(t,e){if(!this.chart.removed){this.scene.setMessage(this.dataId,null),delete this.requests[t.unitStr],this.chart.log("Data arrived");var i=d.Helpers.parseData(e,this.dataSettings.format);d.Helpers.isObjectOrArray(e)&&(i=this.cloneDataObject(i)),this.addDataInt(t,i,!1)}},e.prototype.cloneDataObject=function(t){t=d.Helpers.clone(t);var e=t.values;if(!t.error&&e)if(Array.isArray(e)){t.values=e=e.slice();for(var i=0;i<e.length;i++){var n=e[i];if(!h(n)){t.error="The `values` in the TimeChart data object must be an array of arrays. The value at index "+i+" is not an array.";break}e[i]=Array.prototype.slice.call(n)}}else t.error="The `values` in the TimeChart data object must be an array or arrays.";return t},e.prototype.addData=function(t){t=this.cloneDataObject(t),this.addDataInt(null,t,!0)},e.prototype.addDataInt=function(e,i,n){if(void 0===n&&(n=!1),null!==i){if(!t.moment||!t.moment.tz)return void this._pendingAddData.push({request:e,parsedData:i,append:n});var s=this.cleanupData(i);if(s.error)return"no-unit"===s.error&&e&&(this.cache[e.unitStr]=null),void this.chart.error(s.error);var r;if(r=e?this.analyzeData(s,e):this.analyzeDataNoRequest(s,n),e&&!e.unit.isMultipleOf(r.unit))this.chart.error("Incorrect data - requested unit `"+e.unit+"`, got `"+r.unit+"`. The requested unit must be a multiple of returned unit."),this.cache[e.unitStr]=null,e.callback&&e.callback(null,null,null);else{var a=r.unitStr;if(e&&a!==e.unitStr){this.cache[e.unitStr]=null;for(var o=!0,l=this._units,h=0;h<l.length;h++)if(l[h].unit.isEqual(r.unit)){o=!1;break}o&&(d.Helpers.warn("The data source returned unit `"+a+"` which was not declared in `data.units`."),this.dataSettings.units.push(a),this._prepareUsableUnits())}if(r.unit&&null!=r.from&&null!=r.to){var u=this.cache[r.unitStr];u?this.cache[r.unitStr].merge(r,this.dataSettings.cacheSize,this.chart,n):this.cache[r.unitStr]=r}e&&e.callback&&e.callback(r.from,r.to,r.unit)}this.chart.events.notifySceneChanges({data:(c={},c[this.dataSettings.id]=!0,c)});var c}},e.prototype.dataFailed=function(t){this.cache[t.unitStr]||(this.cache[t.unitStr]=null),this.scene.setMessage(this.dataId,this.settings.localization.dataRequestFailed,1e3),this.chart.error("Failed data loading request"),t.callback&&t.callback(null,null,null)},e.prototype.updateDataLimit=function(t,e,i,n,s){this.chart.invalidateDataLimits(),void 0!==t&&null!==t&&(null===this.dataFrom||this.dataFrom>t)&&(this.dataFrom=t),void 0!==e&&null!==e&&(null===this.dataTo||this.dataTo<e)&&(this.dataTo=e),null!=i&&(this.dataLimitFrom=i,this.dataLimitFromUnit=s,this.dataFrom=null==this.dataFrom?i:Math.max(this.dataFrom,i)),null!=n&&(this.dataLimitTo=n,this.dataLimitToUnit=s,this.dataTo=null==this.dataTo?n:Math.min(this.dataTo,n))},e.prototype.cleanupData=function(e){if(e.error)return e;"local"===e.timeZone&&(d.Helpers.error("The data source has to specify a timezone that is not `local` so that it works independent of the browser settings."),e.timeZone=t.moment.tz.guess()),e.error="bad-response";var i=!this.dataSettings.suppressWarnings,n="";e.data&&!e.values&&(i&&d.Helpers.warn("Use of property `data` in the TimeChart data object (returned from the URL, dataFunction or preloaded property) is deprecated. Please use `values` instead.",null,!0),e.values=e.data),null==e.unit&&(n+="\nRequired field 'unit' not set in data"),null==e.values&&(n+="\nRequired field 'values' not set in data");var r=s.parse(e.unit,void 0,!1);if(null===r&&(n+="\nData error: unrecognized data unit: "+e.unit),n.length)return e.error=n.substr(1),e;e.error=null;var a=e.timeZone||"UTC",o=s.timeUnitDiffs[r.unit]<s.timeUnitDiffs.d,l=t.moment.defaultZone,h=t.moment.locale();t.moment.locale(this.scene.momentLocale),t.moment.tz.setDefault(a),e.from=this.convertTimestampToInternal(e.from,o),e.to=this.convertTimestampToInternal(e.to,o),e.dataLimitFrom=this.convertTimestampToInternal(e.dataLimitFrom,o),e.dataLimitTo=this.convertTimestampToInternal(e.dataLimitTo,o);var u,c,p=-1e30,f=!1;null!=e.from&&null!=e.to&&e.from>=e.to&&(this.chart.error("Data logic error. from >= to: "+e.from+", "+e.to+". The values will be ignored."),e.from=null,e.to=null),null!=e.dataLimitFrom&&null!=e.dataLimitTo&&e.dataLimitFrom>=e.dataLimitTo&&(this.chart.error("Data logic error. dataLimitFrom >= dataLimitTo: "+e.dataLimitFrom+", "+e.dataLimitTo+". The values will be ignored."),e.dataLimitFrom=null,e.dataLimitTo=null);var g=e.dataLimitFrom,m=e.dataLimitTo;null==g&&(g=-(1/0)),null==m&&(m=1/0);var v=0;if("UTC"===a&&"UTC"===this.settings.timeAxis.timeZone&&(v=this.dataSettings.timestampInSeconds?1e3:1),e.values.length>0){for(var y=[],S=0;S<e.values.length;S++){var b=e.values[S];if(Array.isArray(b)){for(var C=b.length,x=1;x<C;x++){var w=b[x];null!==w&&"number"!=typeof w&&isNaN(b[x]=parseFloat(w))&&(this.chart.error("Data error: the value is not a number: values["+S+"]["+x+"] = "+w),b[x]=null)}var L=C?b[0]:null;if(null!=L){if(b[0]=L=v&&"number"==typeof L?L*v:this.convertTimestampToInternal(L,o),null===L)continue;(L<g||L>m)&&this.chart.error("Data error: value timestamp outside data limits. values["+S+"][0] = "+b[0]+". Limits: "+g+"..."+m),i&&p===L&&d.Helpers.warn("There are multiple values given for the same timestamp "+b[0]+" which might produce invalid results."),p>L&&!f&&(i&&d.Helpers.warn("Data values are not sorted on timestamp in ascending order (timestamp "+b[0]+"). TimeChart will sort the data automatically but to achieve better performance the data source should be sorted."),f=!0),p=b[0],y.push(b)}}else this.chart.error("Data error: the value at index "+S+" is not an array.")}e.values=y,f&&y.sort(function(t,e){return t[0]-e[0]}),u=y[0][0],c=y[y.length-1][0]}return null!=e.from&&u<e.from&&(d.Helpers.warn("Data logic error. Data time "+u+" outside [from, to) range: "+e.from+", "+e.to),e.from=u),null!=e.to&&c>=e.to&&(d.Helpers.warn("Data logic error. Data time "+c+" outside [from, to) range: "+e.from+", "+e.to),e.to=c+1),t.moment.defaultZone=l,t.moment.locale(h),e},e.prototype.analyzeDataNoRequest=function(t,e){var i=this.dataSettings,n=t.from,r=t.to,a=s.parse(t.unit),o=null,l=null;if((null==n||null==r)&&t.values.length>0){var h=this.scene.timeStepSettings;o=t.values[0][0],l=t.values[t.values.length-1][0],o=a.roundTimeDown(o,h),l=a.roundTimeUp(l+1,h),null==n&&(n=o),null==r&&(r=l)}null!=i.dataFunction||null!=i.url||null!=t.dataLimitFrom||null!=t.dataLimitTo||d.Helpers.hasProperties(i.urlByUnit)||(d.Helpers.warn("Using preloaded data without specifying `dataLimitFrom` and `dataLimitTo` is not recommended - these values will be implied from the data and might result in invalid behavior.",null,1e30),null==t.dataLimitFrom&&(t.dataLimitFrom=Math.min((e?this.dataLimitFrom:0)||1e30,t.from||o)),null==t.dataLimitTo&&(t.dataLimitTo=Math.max((e?this.dataLimitTo:0)||-1e30,t.to||l))),this.updateDataLimit(o,l,t.dataLimitFrom,t.dataLimitTo,a);var u=new p(a,n,r,t.values);return null!=t.error&&(u.error=t.error),u},e.prototype.analyzeData=function(t,e){null===e.from&&null==t.from&&null!=t.dataLimitFrom&&(t.from=t.dataLimitFrom,d.Helpers.warn("`from` is not set in the data response - using `dataLimitFrom` instead. This may produce unexpected results.")),null===e.to&&null==t.to&&null!=t.dataLimitTo&&(t.to=t.dataLimitTo,d.Helpers.warn("`to` is not set in the data response - using `dataLimitTo` instead. This may produce unexpected results."));var i=t.from,n=t.to,r=null,a=null;null!=i&&null!=n&&i>=n&&this.chart.error("Data logic error. from >= to: "+i+", "+n);var o=s.parse(t.unit),l=this.scene.timeStepSettings;if(t.values.length>0?(r=t.values[0][0],a=t.values[t.values.length-1][0],r=o.roundTimeDown(r,l),a=o.roundTimeUp(a+1,l),null==i&&(i=null!==e.from?Math.min(e.from,r):r),null==n&&(n=null!==e.to?Math.max(e.to,a):a),e.from&&a<=e.unit.add(e.from)&&(this.dataSettings._skipRequestRangeRounding=!0)):(null==i&&(i=e.from),null==n&&(n=e.to),null!=t.from&&null!=t.to?(r=t.from,a=t.to):(r=e.from,a=e.to,null===e.from&&null===e.to&&null==i&&null==n&&null==t.dataLimitFrom&&null==t.dataLimitTo&&(this.noData=!0))),this.updateDataLimit(r,a,t.dataLimitFrom,t.dataLimitTo,o),null!==e.from&&null!=t.to){var h=o.roundTimeDown(t.to,l);h<=e.from&&this.updateDataLimit(null,null,null,t.to,o)}if(null!==e.to&&null!=t.from){var u=o.roundTimeUp(t.from,l);u>=e.to&&this.updateDataLimit(null,null,t.from,null,o)}null==t.from&&null==t.dataLimitFrom&&(null!==this.dataLimitFrom&&(null===e.from||e.from<=this.dataLimitFrom&&r>this.dataLimitFrom)||null===this.dataLimitFrom&&(void 0===e.from||null===e.from))&&(this.updateDataLimit(null,null,r,null,o),i=r),null==t.to&&null==t.dataLimitTo&&(null!==this.dataLimitTo&&(null===e.to||e.to>=this.dataLimitTo&&a<this.dataLimitTo)||null===this.dataLimitTo&&(void 0===e.to||null===e.to))&&(this.updateDataLimit(null,null,null,a,o),n=a);var c=new p(o,i,n,t.values);return t.error&&(c.error=t.error),c},e.prototype.getDataFunction=function(){var t=this,e=this.dataSettings;if(e.dataFunction)return e.dataFunction;var i=d.Helpers.hasProperties(e.urlByUnit);return e.url||i?function(n,s,r,a,o,l){var h;if(i){if(h=e.urlByUnit[r],!h)return'{"error":"no-unit", "errormessage":"no data url for this time unit: '+r+'"}'}else h=e.url;var u=[];null!==n&&u.push(["from",n.toString(10)]),null!==s&&u.push(["to",s.toString(10)]),u.push(["unit",r]),null!==l&&u.push(["timeZone",l]),d.Data.doRequest(h,t.dataSettings,u,a,o)}:null},e.prototype.hasPendingRequests=function(){return d.Helpers.hasProperties(this.requests)},e.prototype.convertTimestampToInternal=function(e,i){if(null==e)return null;var n=this.dataSettings,s=this.settings.timeAxis,r=d.Helpers.isNumber(e);r&&n.timestampInSeconds&&(e=1e3*e);var a=t.moment(e,r?null:n.stringTimestampFormat);if(!a.isValid()){var o=parseFloat(e);return r||isNaN(o)?(d.Helpers.error("Could not parse timestamp value `"+e+"`. The value will be ignored."),null):(d.Helpers.warn("Numeric timestamp value `"+e+"` was passed as string. This has been deprecated starting from version 1.12."),this.convertTimestampToInternal(o,i))}i&&(a=a.tz(s.timeZone));var l=a.utcOffset?a.utcOffset():a.zone();return e=+a+6e4*l,e+6e4*(s.timeZoneOffset-n.timeZoneOffset)},e.prototype.convertTimestampFromInternal=function(t,e){if(null==t)return null;var i=this.dataSettings;return t=this.scene.timestampFromInternal(t,e),t+=6e4*i.timeZoneOffset,i.timestampInSeconds&&(t/=1e3),t},e}();t.Data=c;var p=function(){function t(t,e,i,n){this.values=null,this.error=null,this.values=n,this.to=i,this.from=e,this.unit=t,this.unitStr=t.toString(),this.updateLastTimestamp()}return t.prototype.updateLastTimestamp=function(){this.values.length>0?this.lastTimestamp=this.values[this.values.length-1][0]:this.lastTimestamp=0},t.prototype.merge=function(t,e,i,n){if(t.unit.approxTime()!==this.unit.approxTime())throw new Error("merge unit mismatch");if(!n&&(this.from>t.to||this.to<t.from))return this.values=t.values,this.from=t.from,void(this.to=t.to);t.values.length>0&&t.from>t.values[0][0]&&i.error("Data merge - oldest data before from"),t.values.length>0&&t.to<t.values[t.values.length-1][0]&&i.error("Data merge - newest data after to");for(var s=0;s<this.values.length&&this.values[s][0]<t.from;)s+=1;for(var r=this.values.length;r>0&&this.values[r-1][0]>=t.to;)r-=1;var a=t.values;if(this.from=Math.min(this.from,t.from),this.to=Math.max(this.to,t.to),s>0){var o=Math.max(0,a.length+s-e);a=this.values.slice(o,s-1+1).concat(a),o>0&&(this.from=this.values[o-1][0]+1)}if(r<this.values.length){var l=this.values.length-r;l=Math.min(l,e-a.length),a=a.concat(this.values.slice(r,r+l+1)),l<this.values.length-r&&(this.to=this.values[r+l][0])}this.values=a,this.updateLastTimestamp()},t}();t.TimeData=p;var f=function(){function t(t,e,i,n,s,r){this.time=s,this.callback=n,this.to=i,this.from=e,this.unit=t,this.unitStr=t.toString(),this.timeZone=r}return t}(),g=function(t){function e(){t.apply(this,arguments),this.limitMode="snapBack",this.limitFrom="oldestData",this.limitTo="newestData",this.overscrollProportion=0}return n(e,t),e}(l.SettingsInteractionScrolling);t.SettingsInteractionScrolling=g;var m=function(t){function e(e){t.call(this,e),this.animationOrder=600,this.paintOrder=10,this.updateOrder=1400,this.animationUnit=null,this.targetUnit=null,this.dragStartBar0=null,this.dragStartBar1=null,this.dragStartUnit=null,this.timeSetup=new o(e)}return n(e,t),e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=this.scene,n=this.scene.displayUnit;!this.scalingActive&&i.timeScale&&i.lastUnit===n||!n||this.timeSetup.preventUnitWidthViolation(this.chart.timeEnd,this.chart.timeStart)||(i.timeScale=(i.timeEnd-i.timeStart)/i.width),i.lastUnit!==n&&(i.lastUnit=n)},e.prototype.scaleViewRange=function(e,i,n){var s=t.prototype.scaleViewRange.call(this,e,i,n),r=this.scene,a=r.settings.timeAxis,o=(s.to-s.from)/r.width*a.minUnitWidth/1.5;return r.disableScaleLimiter||o<=r.displayUnit.approxTime()?s:{from:i,to:n}},e.prototype.setTimeRangeSnap=function(t,e,i,n,s,r,a,o){var l=this.snap(t,e,i,n,a,o);t=l.from,e=l.to;var h=l.unit,u=l.period,c=l.anchor;this.setTimeRange(t,e,h,s,r,c,u)},e.prototype.computeDisplayPeriod=function(t,e,i,n,s){var r=this.timeSetup.tryComputeDisplayPeriod(t,e,i,n,s,this.scene,this.scene.getCurTime()),a=r.from,o=r.to,l=r.unit;return null===a||null===o?{from:null,to:null,unit:null}:this.computeTimeRangeExtend(a,o,l)},e.prototype.computeTimeRangeExtend=function(t,e,i){var n=this.scene;if(!i){var s=this.timeSetup.computeDisplayUnit(n.timeStart,n.timeEnd,n.displayUnit,t,e,n);t=s.from,e=s.to,i=s.unit}var r=n.timeStepSettings;t=i.roundTimeDown(t,r),e=i.roundTimeUp(e,r),e===t&&(e=i.add(e,1));var a=this._preventOverscroll(t,e,i,!0);return t=a.from,e=a.to,{from:t,to:e,unit:i}},e.prototype.computeDisplayUnit=function(t,e,i){var n=null!==this.dragStartFrom?this.dragStartFrom:this.scene.timeStart,s=null!==this.dragStartTo?this.dragStartTo:this.scene.timeEnd,r=this.dragStartUnit?this.dragStartUnit:this.scene.displayUnit,a=this.chart.scrolling,o={scroll:a.scrollingActive,scale:a.scalingActive,animate:i};return this.timeSetup.computeDisplayUnit(n,s,r,t,e,this.scene,o)},e.prototype.setTimeRange=function(t,e,i,n,s,r,a){if(void 0===r&&(r=null),void 0===a&&(a=null),t=Math.round(t),e=Math.round(e),!(t>e)){if(!i){var o=this.computeDisplayUnit(t,e);t=o.from,e=o.to,i=o.unit}if("init"===s){var o=this.timeSetup.getMinRangeForUnit(t,e,i,r);t=o.from,e=o.to}t===this.getFrom()&&e===this.getTo()&&i.isEqual(this.scene.displayUnit)||(n&&this.abort(),this.scene.anchor=r,this.scene.period=a,this.targetUnit=i,this.animationUnit=!i||this.scene.displayUnit&&i.toString()!==this.scene.displayUnit.toString()?null:i,this.goToPosition(t,e,n,d.Helpers.performanceNow(),!0),this.events.notifySceneChanges({time:!0}),s&&this.chart.notifyTimeChanged(t,e,i,s))}},e.prototype.zoomOut=function(t,e,i,n,s){if(this.scene.displayUnit){var r=this.computeZoomOut(e,i);this.scene.displayUnit=r.unit,this.setTimeRangeSnap(r.from,r.to,r.center,r.unit,n,s,!1,!0)}},e.prototype.zoomIn=function(t,e,i,n,s,r){if(this.scene.displayUnit){null===e&&(e=(i+n)/2);var a=this.onZoomIn(i,n,e,.5);this.setTimeRangeSnap(a.from,a.to,a.center,t,s,r,!1,!0)}},e.prototype.handleZoomWheel=function(t,e,i,n,s){var r=this.onSnapWhileDragging(t,e,i,this.scrollingActive,s);t=r.from,e=r.to;var a=r.unit;if(this.scene.displayUnit=a,null===this.pointer1){var o=this.onSnapAfterDragging(t,e,i,this.scrollingActive,s);t=o.from,e=o.to,a=o.unit,this.scene.displayUnit=a}this.goToPosition(t,e,!0,n,!0)},e.prototype.xyInArea=function(t,e){return this.scene.xyInChart(t,e)},e.prototype.xyToPosition=function(t,e){return this.scene.xToTime(t)},e.prototype.onZoomOut=function(e,i,n,s){return void 0===s&&(s=null),s?t.prototype.onZoomOut.call(this,e,i,n,s):this.computeZoomOut(e,i)},e.prototype.onZoomIn=function(e,i,n,s){if(void 0===s&&(s=null),s)return t.prototype.onZoomIn.call(this,e,i,n,s);if(this.dragStartBar0&&(e=this.dragStartBar0,i=this.dragStartBar1,i-e>this.scene.timeEnd-this.scene.timeStart)){var r=this.scene.getClickBar(n);e=r.time0,i=r.time1}return{from:e,to:i,center:(e+i)/2}},e.prototype.onScroll=function(t,e,i){return this.timeSetup.scroll(t,e,this.scene.displayUnit,i,1,"page")},e.prototype.onGoHome=function(t,e){var i=this.chart.getDisplayLimits().to;if(null===i)return{from:t,to:e,origin:null};this.scene.anchor="newestData";var n=e-t;return{from:i-n,to:i,origin:i}},e.prototype.onStartDragging=function(t,e,i){this.scene.anchor=null,this.animationUnit=null,this.dragStartUnit=this.scene.displayUnit;var n=this.scene.getClickBar(i);this.dragStartBar0=n.time0,this.dragStartBar1=n.time1},e.prototype.onSnapWhileDragging=function(t,e,i,n,s){var r=this._preventOverscale(t,e,null,i,!1);t=r.from,e=r.to;var a=this.computeDisplayUnit(t,e).unit,o=this._preventOverscroll(t,e,a,!1);return t=o.from,e=o.to,this.events.notifySceneChanges({time:!0}),{from:t,to:e,unit:a}},e.prototype.onSnapAfterDragging=function(t,e,i,n,s){if(s){var r=this.timeSetup.adjustTimeAfterScale(t,e,this.dragStartBar0,this.dragStartBar1);t=r.from,e=r.to}var a=this.snap(t,e,i,null,n,!1),o=a.unit,l=a.period,h=a.anchor;return this.targetUnit=o,this.animationUnit=this.scene.displayUnit,this.scene.period=l,this.scene.anchor=h,this.dragStartBar0=null,this.dragStartBar1=null,this.dragStartFrom=null,this.dragStartTo=null,this.dragStartUnit=null,this.events.notifySceneChanges({time:!0}),this.chart.notifyTimeChanged(t,e,o,"user"),{from:a.from,to:a.to,unit:o}},e.prototype.onPositionChanged=function(t,e,i){if(!isNaN(t)||!isNaN(e)){var n;n=this.animationUnit?this.animationUnit:this.computeDisplayUnit(t,e).unit,this.scene.setTimeRange(t,e,n),this.chart.timeStart=t,this.chart.timeEnd=e,this.chart.displayUnit=n,this.events.notifySceneChanges({position:!0,time:!0})}},e.prototype.onAnimationDone=function(t,e){if(this.targetUnit){var i=this.targetUnit?this.targetUnit:this.computeDisplayUnit(t,e).unit;this.chart.displayUnit=i,this.scene.setTimeRange(t,e,i)}this.targetUnit=null,this.animationUnit=null,this.chart.notifyAnimationDone()},e.prototype.onPointerDrag=function(e){this.scene.displayUnit&&t.prototype.onPointerDrag.call(this,e)},e.prototype.computeZoomOut=function(t,e){var i,n=this.scene.settings.toolbar.zoomOutFunction,r=this.scene.displayUnit,a=null,o=null,l=e-t,h=e-l/2;n&&(o=n(r.unit,r.count,t,e)),null!=o&&o.unit&&(a=new s(o.unit,o.count||1)),a||(a=this.timeSetup.getBiggerDisplayUnit(r));var u=a.approxTime(),c=this.timeSetup.getUnitRange(this.scene,[a]),d=null!=o&&(null!=o.from||null!=o.to);if(d){i=Math.min(c.maxTime,o.to-o.from);var p=this.timeSetup.verifyUnitWidth(o.from,o.to,a);if(p.min||p.max){var f=this.timeSetup.adjustTimeRangeToUnits(this.chart.scene,o.from,o.to,a);t=f.from,e=f.to}}else{var g=Math.min(30*l/u,Math.floor(c.maxTime/u));i=u*g}return(!o||o&&!o.from)&&(t=h-i/2,e=h+i/2),{from:t,to:e,center:h,unit:a}},e.prototype.snap=function(t,e,i,n,s,r){if((r||s)&&this.scene.settings.interaction.scrolling.limitMode){var a=this._preventOverscale(t,e,n,i,!0);t=a.from,e=a.to}var o,l;if(n?o=n:!r||!r&&s?o=this.scene.displayUnit:(l=this.computeDisplayUnit(t,e),o=l.unit,t=l.from,e=l.to),s||r){var h=e-t,u=this._preventOverscroll(t,e,o,!1);t=u.from,e=u.to,u=this._preventOverscroll(t,e,o,!0),t=u.from,e=u.to,r=r||e-t!==h}if(!n&&r)return l=this.computeDisplayUnit(t,e),t=l.from,e=l.to,this.snap(t,e,i,o,s,r);var c=r?null:this.scene.period,d=this.scene.anchor,p=this.scene.settings.interaction.snapMode;if(p){var f=this.scene.majorTimeUnit&&"y"===this.scene.majorTimeUnit.unit,g=void 0;if("displayUnit"===p)g=o;else if("multiperiod"===p||"period"===p){var m=e-t,v=this.chart.getDisplayLimits(),y=v.from,S=v.to;null!==y&&(m=Math.min(m,S-y));var b=this.timeSetup.getClosestDisplayPeriod(m,this.scene.majorTimeUnit,"multiperiod"===p||f);g=b,c=b.toString()}var C=this.scene.timeStepSettings;if("period"!==p||f)if(r)t=g.roundTimeRound(t,C),e=g.roundTimeRound(e,C);else{var x=Math.max(g.numberOfUnits(t,e),1),w=Math.abs(g.roundTimeRound(t,C)-t),L=Math.abs(g.roundTimeRound(e,C)-e);w<L?(t=g.roundTimeRound(t,C),e=g.add(t,x)):(e=g.roundTimeRound(e,C),t=g.sub(e,x))}else t=g.roundTimeDown(i,C),e=g.add(t,1)}else t=Math.round(t),e=Math.round(e);return{from:t,to:e,unit:o,period:c,anchor:d}},e.prototype._preventOverscroll=function(t,e,i,n){return this.timeSetup.preventOverscroll(i,t,e,n)},e.prototype._preventOverscale=function(t,e,i,n,s){var r;return i?r=[i]:(i=this.scene.displayUnit,r=this.scene.settings._displayUnitsParsed),this.timeSetup.preventOverscale(this.scene,r,n,t,e,i,s)},e}(l.Scrolling);t.Scrolling=m;var v=function(){function t(){this.enabled=!0,this.tolerance=6,this.moveByDragging=!1,this.resizeSensitivity=2,this.resizeTolerance=20}return t}();t.SettingsInteractionSelection=v;var y=function(){function t(){this.lineColor="rgba(0,0,0,0.5)",this.lineWidth=2,this.fillColor="rgba(30,160,220,0.15)",this.behindSeries=!1}return t}();t.SettingsAreaStyleSelection=y;var S=function(e){function i(t){e.call(this),this.selectStart=null,this.selectingPointer=null,this.isSelecting=!1,this.isHoveringEdge=!1,this.lastX=0,this.lastY=0,this.roundAround=!1,this.selectionRemoved=!1,this.animationOrder=500,this.updateOrder=1300,this.isMoving=!1,this.moveStartX=0,this.moveStartY=0,this.moveSelectionStart=null,this.moveSelectionEnd=null,this.chart=t,this.scene=t.scene;var i=t.settings;this.settings=i.interaction.selection,this.styleSettings=i.area.style.selection,this.labelStyle=i.area.style.selectionLabel,this.paintOrder=this.styleSettings.behindSeries?3:15}return n(i,e),i.prototype.onSceneChange=function(t){if((t.changes.time||t.changes.bounds)&&null!==this.selectStart&&this.dragPointer(null,this.lastX,this.lastY,t.changes),t.changes.settings){var e=this.styleSettings.behindSeries?3:15;this.paintOrder!==e&&(this.paintOrder=e,this.chart.events.refreshElementOrder())}},i.prototype.getLineCoordinates=function(){var t=this.scene,e=this.styleSettings,i=Math.round(t.timeToX(t.selectionStart)),n=Math.round(t.timeToX(t.selectionEnd)),s=e.lineWidth,r=Math.round(t.x0),a=Math.round(r+t.width);return i-s<r&&i>r-4*s&&(i=r+s),n+s>a&&n<a+4*s&&(n-=s),{start:i,end:n}},i.prototype.paintScene=function(e){var i=this.scene,n=this.styleSettings;if(null!=i.selectionStart&&null!=i.selectionEnd&&this.chart.assetsLoaded){var s=Math.round(i.x0),r=Math.round(s+i.width),a=Math.round(i.y0),o=Math.round(a+i.height+i.bottomAxisSize),l=this.getLineCoordinates(),h=l.start,u=l.end,c=i.height+i.bottomAxisSize,p=t.moment(i.selectionStart).locale(this.scene.momentLocale).utc().format(i.minorTimeFormat),f=t.moment(Math.max(i.selectionStart,i.selectionEnd-1)).locale(this.scene.momentLocale).utc().format(i.minorTimeFormat),g=e.context;d.Graphics.pushClip(e,s,a,this.scene.width,c),d.Graphics.rectStyle(g,n);var m=h+n.lineWidth%2/2,v=u+n.lineWidth%2/2;g.fillRect(m+n.lineWidth/2,a,u-h-n.lineWidth,c),g.beginPath(),g.moveTo(m,a),g.lineTo(m,o),g.moveTo(v,a),g.lineTo(v,o),d.Graphics.stroke(g,n);var y=e.labelRenderer,S=this.labelStyle,b=d.Graphics.getTextWidth(g,S,p),C=d.Graphics.getTextWidth(g,S,f),x=new d.Label({text:p,textStyle:S},!0),w=new d.Label({text:f,textStyle:S},!0),L=10,A=5;h<s&&(h=s),u>r&&(u=r),b+C+20<u-h?(h+=A,u=u-C-A):(h=h-b-A,u+=A);var T=this.chart.shell.getChartInnerArea(),M=T.findTopPosition(h,h+b),k=T.findTopPosition(u,u+C);y.paint(g,h+b/2,M+L,1,x),y.paint(g,u+C/2,k+L,1,w),d.Graphics.popClip(e)}},i.prototype.onPointerMove=function(t){var e=this.scene,i=this.settings;if(i.enabled){e.xyInBottom(t.x,t.y)&&(t.cursor="text");var n=!1;if(null!=e.selectionStart&&null!=e.selectionEnd&&e.xyInChartOrBottom(t.x,t.y)&&e.timeStart<e.timeEnd){var s=this.getLineCoordinates();Math.abs(s.start-t.x)<=i.tolerance?(t.cursor="e-resize",t.consumed=!0,n=!0):Math.abs(s.end-t.x)<=i.tolerance?(t.cursor="w-resize",t.consumed=!0,n=!0):i.moveByDragging&&s.start<t.x&&s.end>t.x&&(t.cursor="move",t.consumed=!0)}this.isHoveringEdge=n}},i.prototype.onPointerDown=function(t){var e=this.scene,i=this.settings;if(e.xyInChartOrBottom(t.x,t.y)&&null===this.selectingPointer&&i.enabled){this.selectionRemoved=!1,this.lastX=t.x;var n=null,s=null;if(null!==e.selectionStart||null!==e.selectionEnd){var r=this.getLineCoordinates(),a=Math.abs(r.start-t.x),o=Math.abs(r.end-t.x),l=!1;if(a<i.tolerance&&a<=o?(this.selectStart=e.selectionEnd,l=!0):o<i.tolerance&&o<=a?(this.selectStart=e.selectionStart,l=!0):i.moveByDragging&&r.start<t.x&&r.end>t.x&&(this.isMoving=!0,this.moveStartX=t.x,this.moveStartY=t.y,this.moveSelectionStart=e.selectionStart,this.moveSelectionEnd=e.selectionEnd,this.selectStart=e.xToTime(t.x),l=!0),l)return this.selectingPointer=t.identifier,t.consumed=!0,this.roundAround=!0,void(this.isSelecting=!0)}e.xyInBottom(t.x,t.y)&&(this.selectingPointer=t.identifier,this.selectStart=e.xToTime(t.x),t.capture=!0,this.roundAround=!0,this.isSelecting=!0,t.x>=n&&t.x<=s||null!==e.selectionStart&&(this.selectionRemoved=!0,e.selectionStart=null,e.selectionEnd=null,t.changes.selection=!0))}},i.prototype.onPointerDrag=function(t){this.scene.displayUnit&&this.selectingPointer===t.identifier&&(this.dragPointer(t,t.x,t.y,t.changes),t.consumed=!0)},i.prototype.dragPointer=function(t,e,i,n){var s,r,a=this.scene;if(this.isMoving){var o=a.dxToDtime(e-this.moveStartX);s=this.moveSelectionStart+o,r=this.moveSelectionEnd+o;var l=i-this.moveStartY,h=this.settings.resizeTolerance;if(Math.abs(l)>h){l=l<0?l+h:l-h;var u=this.moveSelectionEnd-this.moveSelectionStart,c=Math.min(u,a.dxToDtime(l*this.settings.resizeSensitivity)),p=0===u?.5:(this.selectStart-this.moveSelectionStart)/u;s+=c*p,r-=c*(1-p)}}else{var f=this.selectStart,g=this.scene.xToTime(e),m=Math.abs(f-g),v=a.snapTimeRound(f),o=v-f,y=d.Helpers.sign(o);v=f+Math.min(o*y,.9*m)*y,v<g?(s=v,r=g):(s=g,r=v)}this.lastX=e,this.lastY=i,a.selectionStart=s,a.selectionEnd=r,n.selection=!0,a.settings.events.selectionChangeDuringInteraction&&this.chart.notifySelectionChanged(this.chart.createEventArguments(t,"user"))},i.prototype.onPointerUp=function(t){if(this.selectingPointer===t.identifier){if(this.isSelecting){var e=this.snapSelection(),i=e.st,n=e.en;i===n&&(i=null,n=null);var s=this.scene;s.selectionStart=i,s.selectionEnd=n,null!=i&&(s.hoverFrom=i,s.hoverTo=n),this.chart.notifySelectionChanged(this.chart.createEventArguments(t,"user")),t.changes.selection=!0}(this.isSelecting||this.selectionRemoved)&&(t.consumed=!0),this.isSelecting=!1,this.isMoving=!1,this.selectStart=null,this.selectingPointer=null}},i.prototype.onPointerCancel=function(t){this.onPointerUp(t)},i.prototype.snapSelection=function(){var t,e,i=this.scene;return null!=i.selectionStart?this.roundAround?(t=i.snapTimeRound(i.selectionStart),e=i.snapTimeRound(i.selectionEnd)):(t=i.snapTimeDown(i.selectionStart),e=i.snapTimeUp(i.selectionEnd)):(t=null,e=null),{st:t,en:e}},i}(d.ChartElement);t.Selection=S;var b=function(e){function i(){e.apply(this,arguments),this.timeStart=0,this.timeEnd=0,this.anchor=null,this.period=null,this.displayUnit=null,this.data={},this.markers=[],this.mainData=null,this.selectionStart=null,this.selectionEnd=null,this.minorTimeFormat=null,this.minorTimeUnit=null,this.majorTimeUnit=null,this.majorTimeFormat=null,this.hoverFrom=null,this.hoverTo=null,this.timeScale=0,this.lastUnit=null,this.disableScaleLimiter=!1,this.momentLocale="zc"+(i._momentLocaleCounter++).toFixed(0)}return n(i,e),i.prototype.setTimeRange=function(t,e,i){i||d.Helpers.error("Scene.setTimeRange: no display unit"),this.timeStart=t,this.timeEnd=e,this.displayUnit=i},i.prototype.pixelsPerTime=function(){return this.width/(this.timeEnd-this.timeStart)},i.prototype.getScale=function(){return(this.timeEnd-this.timeStart)/this.width},i.prototype.timeToX=function(t){
  48. return this.x0+this.width*(t-this.timeStart)/(this.timeEnd-this.timeStart)},i.prototype.timeToXCoefs=function(){return{tadd:this.x0-this.timeStart*this.width/(this.timeEnd-this.timeStart),tmul:this.width/(this.timeEnd-this.timeStart)}},i.prototype.xToTime=function(t){return this.timeStart+(this.timeEnd-this.timeStart)*(t-this.x0)/this.width},i.prototype.xToFraction=function(t){return(t-this.x0)/this.width},i.prototype.dTimeToDx=function(t){return this.width*t/(this.timeEnd-this.timeStart)},i.prototype.dxToDtime=function(t){return t/this.width*(this.timeEnd-this.timeStart)},i.prototype.snapTimeDown=function(t){return this.displayUnit.roundTimeDown(t,this.timeStepSettings)},i.prototype.snapTimeUp=function(t){return this.displayUnit.roundTimeUp(t,this.timeStepSettings)},i.prototype.snapTimeRound=function(t){return this.displayUnit.roundTimeRound(t,this.timeStepSettings)},i.prototype.getClickBar=function(t){var e=this.displayUnit;return e?{time0:e.roundTimeDown(t,this.timeStepSettings),time1:e.roundTimeUp(t+1,this.timeStepSettings)}:{time0:null,time1:null}},i.prototype.getCurTime=function(){var t,e=this.settings.currentTime;return t=null!=e.time?e.time:(new Date).getTime(),this.timestampToInternal(t,!0)},i.prototype.timestampToInternal=function(e,i){if(null==e)return null;e=+e;var n=this.settings.timeAxis;if(i){if(!t.moment||!t.moment.tz)return null;var s=t.moment.utc(e).tz(n.timeZone),r=s.utcOffset?s.utcOffset():s.zone();e=+s+6e4*r}return e+6e4*n.timeZoneOffset},i.prototype.timestampFromInternal=function(e,i){if(null==e)return null;var n=this.settings.timeAxis;if(i){if(!t.moment||!t.moment.tz)return null;var s=t.moment.utc(e).tz(n.timeZone),r=s.utcOffset?s.utcOffset():s.zone();e=+s-6e4*r}return e-=6e4*n.timeZoneOffset},i._momentLocaleCounter=0,i}(l.Scene);t.Scene=b;var C=function(){function e(t,e,i,n,s,r,a){void 0===i&&(i=[]),void 0===n&&(n=null),void 0===s&&(s=null),void 0===r&&(r=!0),void 0===a&&(a=2),this.scene=null,this.step=null,this.uniform=!1,this.currentFrom=0,this.currentTo=0,this.fromBar=null,this.toBar=null,this.fromIndex=0,this.toIndex=0,this.times=[],this.xes=[],this.oldMul=0,this.oldAdd=0,this.values=[],this.counts=[],this.arrays=[],this.extraArrays=[],this.bufExpandSize=100,this.extraSteps=2,this.uniformTolerance=0,this.approxExtraTime=0,this.extraSteps=a,this.uniform=r,this.step=e,this.scene=t,n=n||this.scene.timeStart,s=s||this.scene.timeEnd,this.extraArrays=i.slice(0),this.arrays=i.slice(0),this.arrays.push("xes"),this.arrays.push("times"),this.uniformTolerance=Math.min(1,this.step.count-2),this.approxExtraTime=this.extraSteps*e.approxTime(),this.init(n-this.approxExtraTime,s+this.approxExtraTime)}return e.prototype.getArray=function(t){switch(t){case"xes":return this.xes;case"times":return this.times;case"values":return this.values;case"counts":return this.counts;default:return d.Helpers.error("TimeSlicer: Invalid get array: '"+t+"'"),null}},e.prototype.setArray=function(t,e){switch(t){case"xes":return void(this.xes=e);case"times":return void(this.times=e);case"values":return void(this.values=e);case"counts":return void(this.counts=e);default:return void d.Helpers.error("TimeSlicer: Invalid set array: '"+t+"'")}},e.prototype._getOrigin=function(t){var e=this.scene.timeStepSettings;if(1===this.step.count||this.uniform)return this.step.roundTimeDown(t,e);var i=this.step.getBigger().roundTimeDown(t,e),n=this.step.numberOfUnits(i,t);return this.step.add(i,n)},e.prototype._add=function(t){if(this.uniform||1===this.step.count||"d"!==this.step.unit)return t.add(this.step.count,this.step.unit);var e=t.daysInMonth(),i=t.date();return i+2*this.step.count>e+1+this.uniformTolerance?t.add(e-i+1,"d"):t.add(this.step.count,this.step.unit)},e.prototype._sub=function(t){if(this.uniform||1===this.step.count||"d"!==this.step.unit)return t.subtract(this.step.count,this.step.unit);var e=t.date();if(e<=this.step.count){t.subtract(1,"M");var i=t.daysInMonth()-1,n=i+1-this.step.count+this.uniformTolerance;return t.date(1+n-(n%this.step.count|0))}return t.subtract(this.step.count,this.step.unit)},e.prototype.init=function(e,i){for(var n=this,s=0;s<this.arrays.length;s++){var r=this.arrays[s];this.setArray(r,[])}if(e>=i)return this.fromIndex=0,this.toIndex=0,this.fromBar=null,void(this.toBar=null);this.fromBar=t.moment(this._getOrigin(e)).utc(),this.fromIndex=0;var a=t.moment(this.fromBar).utc();for(this.times.push(a.valueOf());a.valueOf()<i;)this._add(a),this.times.push(a.valueOf());this.toIndex=this.times.length,this.toBar=a,this.currentFrom=e,this.currentTo=i,this.xes=this.times.map(function(t){return n.scene.timeToX(t)});for(var o=0;o<this.extraArrays.length;o++){var l=this.extraArrays[o],h=[];h.length=this.times.length,this.setArray(l,h)}},e.prototype.makeMiniSlice=function(e){var i=this.scene.timeToXCoefs(),n=i.tadd,s=i.tmul,r=t.moment(this._getOrigin(e)).utc(),a=r.valueOf(),o=n+a*s;this._add(r);var l=r.valueOf(),h=n+l*s;return{t0:a,x0:o,t1:l,x1:h}},e.prototype.update=function(t,e){if(void 0===t&&(t=this.scene.timeStart),void 0===e&&(e=this.scene.timeEnd),null==e&&(e=this.scene.timeEnd),null==t&&(t=this.scene.timeStart),t-=this.approxExtraTime,e+=this.approxExtraTime,t===this.currentFrom&&e===this.currentTo)return this.updateXes(this.fromIndex,this.toIndex),{offset:0,newBefore:this.fromIndex,newAfter:this.toIndex};if(null===this.fromBar||t>this.toBar.valueOf()||e<this.fromBar.valueOf())return this.init(t,e),{offset:0,newBefore:this.toIndex,newAfter:this.toIndex};var i=0,n=this.fromIndex,s=this.toIndex,r=this.scene.timeToXCoefs(),a=r.tadd,o=r.tmul,l=this.fromBar.valueOf()-t;if(l>0){var h=(l/this.step.approxTime()|0)+2;if(this.fromIndex<h){var u=[];u.length=h+this.bufExpandSize;for(var c=0;c<this.arrays.length;c++){var d=this.arrays[c];this.setArray(d,u.concat(this.getArray(d)))}i+=u.length,n+=u.length,s+=u.length,this.fromIndex+=u.length,this.toIndex+=u.length}for(var p=this.fromBar.valueOf();p>t;)this._sub(this.fromBar),this.fromIndex-=1,p=this.fromBar.valueOf(),this.times[this.fromIndex]=p,this.xes[this.fromIndex]=a+p*o}var f=e-this.toBar.valueOf();if(f>0){var h=(f/this.step.approxTime()|0)+2;if(this.times.length<this.toIndex+h)for(var g=this.toIndex+h+this.bufExpandSize,c=0;c<this.arrays.length;c++){var d=this.arrays[c];this.getArray(d).length=g}for(var p=this.toBar.valueOf();p<e;)this._add(this.toBar),p=this.toBar.valueOf(),this.times[this.toIndex]=p,this.xes[this.toIndex]=a+p*o,this.toIndex+=1}for(this._add(this.fromBar);this.fromBar.valueOf()<t;)this.fromIndex+=1,this._add(this.fromBar);for(this._sub(this.fromBar),this._sub(this.toBar);this.toBar.valueOf()>=e;)this.toIndex-=1,this._sub(this.toBar);this._add(this.toBar);var m=this.toIndex-this.fromIndex+this.bufExpandSize;if(this.fromIndex>m){for(var v=this.fromIndex-this.bufExpandSize,c=0;c<this.arrays.length;c++){var d=this.arrays[c];this.getArray(d).splice(0,v)}i-=v,n-=v,s-=v,this.fromIndex-=v,this.toIndex-=v}if(this.toIndex<this.times.length-m)for(var c=0;c<this.arrays.length;c++){var d=this.arrays[c];this.getArray(d).length=this.toIndex+this.bufExpandSize}return this.updateXes(n,s),this.currentFrom=t,this.currentTo=e,{offset:i,newBefore:n,newAfter:s}},e.prototype.updateXes=function(t,e){var i=this.scene.timeToXCoefs(),n=i.tadd,s=i.tmul;if(this.oldAdd!==n||this.oldMul!==s){this.oldAdd=n,this.oldMul=s;for(var r=t;r<=e-1;r++)this.xes[r]=n+this.times[r]*s}},e}();t.TimeSlicer=C;var x=function(){function t(){this.enabled=!0,this.vgrid=!0,this.minUnitWidth=1,this.maxUnitWidth=200,this.showHolidays=!0,this.miniTimeRuler=!0,this.unitSizePolicy="auto",this.timeZoneOffset=null,this.timeZone="UTC",this.style={showMinorTimeBalloons:!1,showMajorTimeBalloons:!0,minorTimeBalloonStyle:{fillColor:"#FFF"},majorTimeBalloonStyle:{fillColor:null},minorTimeLabel:{fillColor:"#000000",font:"12px Arial"},majorTimeLabel:{fillColor:"#FFF",font:"11px Arial"},dateLighten:{fillColor:"rgba(255,255,255,0.2)"},dateHolidays:{fillColor:"rgba(230,230,230,0.2)"},minorTimeRuler:{lineColor:"rgba(0,0,0,0.2)"},vgrid:{lineColor:"rgba(0,0,0,0.1)"}}}return t}();t.SettingsTimeAxis=x;var w=function(e){function i(t){var i=this;e.call(this),this.curSceneScale=0,this.minorFormat=null,this.majorFormat=null,this.minorTimeUnit=null,this.majorTimeUnit=null,this.minorLabelHeight=null,this.majorLabelHeight=null,this.minorLabelWidths=null,this.minorLabelBallonWidths=null,this.majorLabelWidths=null,this.fullLabelWidths=null,this.multiYearWidth=0,this.majorSlices=null,this.minorSlices=null,this.animationOrder=610,this.paintOrder=30,this.updateOrder=1e3,this.multiples={ms:[1,10,100],s:[1,2,5,15,30],m:[1,2,5,15,30],h:[1,3,6,12,24],d:[1,2,5,10],w:[1,5,10,20],M:[1,3,6],y:[1,10,100,1e3]},this.chart=t,this.scene=this.chart.scene,this.tt=new o(t),this.options=this.scene.settings.timeAxis,this.panel=new d.ChartPanel,this.panel.side="bottom",this.panel.packingOrder=100,this.panel.computeSize=function(t,e,n,s){return i.computeSize(t,e,n,s)}}return n(i,e),i.prototype.computeSize=function(e,i,n,r){if(!this.options.enabled)return this.scene.bottomAxisSize=0,{width:e,height:0};var a=t.moment(0xc694d6e77ef8).utc(),o=this.scene.settings.localization.timeAxisDates,l=this.options.style.minorTimeLabel;this.minorLabelHeight=.8*d.Graphics.getTextHeight(n,this.options.style.minorTimeLabel.font),this.minorLabelWidths={},this.minorLabelBallonWidths={};var h;for(h=0;h<s.knownUnits.length;h++){var u=s.knownUnits[h],c=d.Graphics.getTextWidth(n,l,a.format(o.minorLabelTimeFormats[u]));this.minorLabelWidths[u]=c,this.minorLabelBallonWidths[u]=c+this.minorLabelHeight}for(l=this.options.style.majorTimeLabel,this.majorLabelHeight=.8*d.Graphics.getTextHeight(n,this.options.style.majorTimeLabel.font),this.majorLabelWidths={},this.fullLabelWidths={},h=0;h<s.knownUnits.length;h++){var u=s.knownUnits[h];this.majorLabelWidths[u]=this.majorLabelHeight+d.Graphics.getTextWidth(n,l,a.format(o.majorLabelTimeFormats[u])),this.fullLabelWidths[u]=this.majorLabelHeight+d.Graphics.getTextWidth(n,l,a.format(o.majorLabelFullTimeFormats[u]))}this.multiYearWidth=d.Graphics.getTextWidth(n,l,"8888 - 8888")+this.majorLabelHeight;var p=Math.round(Math.min(2.3913043*(this.minorLabelHeight+this.majorLabelHeight),i));return this.scene.bottomAxisSize=p,{width:e,height:p}},i.prototype.onSceneChange=function(t){var e=t.changes.settingsChanges;e&&e.timeAxis&&(t.changes.bounds=!0)},i.prototype.getPanels=function(){return[this.panel]},i.prototype.getMajorLabelWidth=function(t,e){return"y"===t.unit&&t.count>1?this.multiYearWidth:e?this.majorLabelWidths[t.unit]:null!==this.fullLabelWidths?this.fullLabelWidths[t.unit]||null:null},i.prototype.computeLabels=function(t){var e,i,n=new o(this.chart),r=this.scene.timeEnd-this.scene.timeStart,a=n.toBiggerDisplayUnit(t);if(a){var l=new s("s",1);for(e=a.isSmaller(l)?l:a,i=this.computeMinorUnit(e),a=n.toBiggerDisplayUnit(e);a&&(a.approxTime()<=.5*r||e.approxTime()<this.scene.dxToDtime(this.getMajorLabelWidth(e,null!=i)));)e=a,i=this.computeMinorUnit(e),a=n.toBiggerDisplayUnit(a)}if(!a){e="y"===t.unit?t:new s("y",1);for(var h=0;h<this.multiples.y.length;h++){var u=this.multiples.y[h];if(e=new s("y",u),i=this.computeMinorUnit(e),e.approxTime()>this.scene.dxToDtime(this.getMajorLabelWidth(e,null!=i)))break}}return{minorUnit:i,majorUnit:e}},i.prototype.computeMinorUnit=function(t){var e=this.scene.displayUnit.clone(),i=new s(s.toSmallerUnit[t.unit],1);i.unit&&i.isBigger(e)&&(e=i);var n=e.approxTime(),r=null;if(null===this.minorLabelWidths)return null;for(var a=1.5*this.scene.dxToDtime(this.minorLabelWidths[e.unit]),o=0;o<this.multiples[e.unit].length;o++){var l=this.multiples[e.unit][o];if(l<e.count&&(l=e.count),e.count=l,n=e.approxTime(),a<=n){r=e;break}}return r&&r.isEqual(t)&&(r=null),r},i.prototype.doAnimations=function(t){if(this.scene.displayUnit&&this.scene.timeStart<this.scene.timeEnd){var e=this.scene.getScale();if(!(Math.abs(1-this.curSceneScale/e)<.001)){this.curSceneScale=e;var i=this.computeLabels(this.scene.displayUnit),n=i.minorUnit,s=i.majorUnit;n?(this.minorFormat=this.scene.settings.localization.timeAxisDates.minorLabelTimeFormats[n.unit],this.majorFormat=this.scene.settings.localization.timeAxisDates.majorLabelTimeFormats[s.unit]):(this.minorFormat=null,this.majorFormat=this.scene.settings.localization.timeAxisDates.majorLabelFullTimeFormats[s.unit]),this.minorTimeUnit=n,this.majorTimeUnit=s,null!==this.majorSlices&&s.approxTime()===this.majorSlices.step.approxTime()||(this.majorSlices=new C(this.scene,s)),!n||null!==this.minorSlices&&n.approxTime()===this.minorSlices.step.approxTime()?null===n&&(this.minorSlices=null):this.minorSlices=new C(this.scene,n,[],null,null,!1)}this.majorSlices.update(),this.minorSlices&&this.minorSlices.update(),this.minorTimeUnit?(this.scene.minorTimeFormat=this.minorFormat,this.scene.minorTimeUnit=this.minorTimeUnit):this.scene.displayUnit&&(this.scene.minorTimeUnit=this.scene.displayUnit,this.scene.minorTimeFormat=this.scene.settings.localization.timeAxisDates.minorLabelTimeFormats[this.scene.displayUnit.unit]),this.scene.majorTimeFormat=this.majorFormat,this.scene.majorTimeUnit=this.majorTimeUnit}},i.prototype.paintScene=function(e){if(this.scene.displayUnit&&this.options.enabled&&this.scene.timeStart<this.scene.timeEnd){var i=this.scene.settings.timeAxis.style,n=e.context,s=e.labelRenderer,r=this.scene.x0,a=r+this.scene.width,o=this.panel.top+1,l=this.panel.bottom,h=l-o,u=this.scene.y0,c=this.scene.height,p=l-1.8*this.majorLabelHeight;d.Graphics.pushClip(e,r,u,this.scene.width,h+c);var f=this.majorSlices.xes,g=this.majorSlices.times,m=this.majorSlices.fromIndex,v=this.majorSlices.toIndex,y=i.dateLighten;if(y&&y.fillColor){var S=this.majorSlices.step.numberOfUnits(0,g[m]);n.beginPath();for(var b=m+(0|S)%2;b<=v-2;b+=2){var C=(0|Math.max(f[b],r))+1,x=0|Math.min(f[b+1],a);n.rect(C,o-1,x-C,h)}d.Graphics.fill(n,y)}if(this.options.showHolidays&&this.minorSlices&&("w"===this.minorSlices.step.unit||"d"===this.minorSlices.step.unit||"h"===this.minorSlices.step.unit)){var w=this.scene.timeToXCoefs(),L=w.tadd,A=w.tmul,T=864e5,M=this.scene.timeStart;M=Math.round(M-M%T);for(var k=t.moment(M).utc().isoWeekday(),P=this.scene.settings.localization.holidayWeekdays,I=i.dateHolidays,D=d.Graphics.beginStrokeAndFill(n,I),C=M*A+L;C<=a;){var x=C+A*T;P.indexOf(k)>-1&&D.rect(C,u,x-C,Math.min(5,h)+c),k=k%7+1,C=x}d.Graphics.endStrokeAndFill(n,D,I)}if(this.options.vgrid){for(var F=d.Graphics.beginStrokeAndFill(n,this.options.style.vgrid),b=m+1;b<=v-2;b++){var N=(0|f[b])+.5;if(N>=a)break;F.moveTo(N,u),F.lineTo(N,l)}d.Graphics.endStrokeAndFill(n,F,this.options.style.vgrid)}var E="y"===this.majorSlices.step.unit&&this.majorSlices.step.count>1,z=this.getMajorLabelWidth(this.majorSlices.step,null!=this.minorFormat),O=this.scene.momentLocale;if(!this.minorSlices||this.majorSlices.step.unit!==this.minorSlices.step.unit){if(i.showMajorTimeBalloons){n.beginPath();for(var b=m;b<=v-2;b++){var H=f[b],_=f[b+1];if(!(H>=a||_<=r)){var R=(H+_)/2;H<r&&(H=r,R=Math.min((H+_)/2,_-z)),_>a&&(_=a,R=Math.max((H+_)/2,H+z)),d.Graphics.strokeBalloon2(n,R,p+1,z,this.majorLabelHeight)}}d.Graphics.paint(n,i.majorTimeBalloonStyle)}for(var b=m;b<=v-2;b++){var H=f[b],_=f[b+1];if(!(H>=a||_<=r)){var M=g[b],B=void 0;if(E){var U=g[b+1]-1;B=t.moment.utc(M).locale(O).format(this.majorFormat)+" - "+t.moment(U).locale(O).utc().format(this.majorFormat)}else B=t.moment.utc(M).locale(O).format(this.majorFormat);var R=(H+_)/2;H<r&&(H=r,R=Math.min((H+_)/2,_-z)),_>a&&(_=a,R=Math.max((H+_)/2,H+z));var V=new d.Label({text:B,textStyle:i.majorTimeLabel},!0);s.paint(n,R,p,1,V)}}}var G=this.scene.settings.timeAxis,W=G.style.minorTimeRuler;if(this.minorSlices){g=this.minorSlices.times,f=this.minorSlices.xes,m=this.minorSlices.fromIndex,v=this.minorSlices.toIndex,z=this.minorLabelWidths[this.minorSlices.step.unit];var j=o+.4*this.minorLabelHeight|0,Y=o-1,q=j+1.6*this.minorLabelHeight|0;if(i.showMinorTimeBalloons){n.beginPath();for(var b=m;b<=v-1;b++){var N=f[b];d.Graphics.strokeBalloon(n,N,o-5,z,this.minorLabelHeight)}d.Graphics.paint(n,i.minorTimeBalloonStyle)}else{var Z=this.majorSlices.fromIndex,X=this.majorSlices.xes;n.beginPath();for(var Q=Z,b=m;b<=v-1;b++){for(var N=f[b];N>X[Q];)Q+=1;if(X[Q]!==N){if(N>=a)break;N=(0|N)-.5,n.moveTo(N,Y),n.lineTo(N,q)}}d.Graphics.stroke(n,W)}for(var K=i.showMinorTimeBalloons?"center":"left",J=i.showMinorTimeBalloons?0:3,b=m;b<=v-1;b++){var N=f[b],M=g[b],B=t.moment(M).locale(O).utc().format(this.minorFormat),V=new d.Label({text:B,aspectRatio:1e9,align:K,textStyle:i.minorTimeLabel});s.measure(n,V);var $=N+J+V.hwidth;s.paint(n,$,j+V.hheight,1,V)}}var tt=this.chart.dataWarehouse.getDisplayUnitsSlicer();if(G.miniTimeRuler&&W&&tt&&tt.xes[tt.fromIndex+1]-tt.xes[tt.fromIndex]>4){var et=o-1,it=o+3;f=tt.xes;var nt=this.majorSlices.fromIndex,st=this.minorSlices?this.minorSlices.fromIndex:nt,rt=this.majorSlices.xes,at=this.minorSlices?this.minorSlices.xes:rt;n.beginPath();for(var ot=nt,lt=st,ht=0,b=tt.fromIndex;b<=tt.toIndex-2;b++){for(var N=f[b];N>rt[ot];)ot+=1;if(rt[ot]!==N){for(;N>at[lt];)lt+=1;if(at[lt]!==N){if(N>=a)break;N=(0|N)-.5,n.moveTo(N,et),n.lineTo(N,it),ht++}}}if(ht&&d.Graphics.stroke(n,W),this.scene.settings.advanced.themeCSSClass.indexOf("gradient")!==-1){var ut=d.Colors.colorTone(W.lineColor,2,2);ht=0,n.beginPath(),ot=nt,lt=st;for(var b=tt.fromIndex;b<=tt.toIndex-2;b++){for(var N=f[b];N>rt[ot];)ot+=1;if(rt[ot]!==N){for(;N>at[lt];)lt+=1;if(at[lt]!==N){if(N>=a)break;N=(0|N)+.5,n.moveTo(N,et),n.lineTo(N,it),ht++}}}ht&&d.Graphics.stroke(n,{lineColor:ut.color})}}d.Graphics.popClip(e)}},i}(d.ChartElement);t.TimeAxis=w;var L=function(){function t(){this.enabled=!0,this.label={padding:3,margin:3,aspectRatio:3,align:"center",textStyle:{fillColor:"white",font:"12px Arial"},backgroundStyle:{lineColor:"#0099cc",fillColor:"#0099cc"}},this.align="left",this.side="top",this.style={lineColor:"#0099cc"},this.time=null,this.overrideLimits=!1,this.showTime=!1}return t}();t.SettingsMarker=L;var A=function(){function t(t,e,i){if(this.labelCacheUnit=null,this.labelCacheTime=null,this.initialText=null,this.isMilestone=!0,this.settings=e,this.label=new d.Label(e.label),i){var n=d.Helpers.clone(i);d.Helpers.extendStyleTo(this.label.style.textStyle,n),n.fillColor||(n.fillColor=e.style.lineColor),this.label.style.textStyle=n}null!=e.time?this.time=t.timestampToInternal(e.time,!0):this.time=null,this.initialText=this.label.text||null}return t}();t.Marker=A;var T=function(e){function i(t){e.call(this),this.animationOrder=2e3,this.paintOrder=40,this.updateOrder=800,this.scene=null,this._initialized=!1,this.chart=t,this.scene=this.chart.scene}return n(i,e),i.prototype.onSceneChange=function(t){if(this.chart.assetsLoaded){var e=t.changes,i=e.settingsChanges,n=i&&i.milestones;(!this._initialized||n||e.assets)&&(this.createMarkers(),this._initialized=!0),(e.time||n)&&this.scene.markers.sort(function(t,e){return t.time-e.time})}},i.prototype.paintScene=function(t){var e=this.scene,i=e.markers,n=t.labelRenderer,s=t.context;if(0!==i.length&&e.displayUnit){var r=Math.round(e.y0);s.textBaseline="middle",d.Graphics.pushClip(t,e.x0,Math.round(e.y0),e.width,e.height+e.bottomAxisSize);for(var a=this.getRenderingParts(t,i),o=a.lines,l=0;l<o.length;l++){var h=o[l],u=d.Graphics.beginStrokeAndFill(s,h.style),c="bottom"===h.side?this.getTopPos(h.x,0):r+e.height;c=Math.round(c),u.moveTo(h.x,c),u.lineTo(h.x,h.y),d.Graphics.endStrokeAndFill(s,u,h.style)}for(var p=a.labels,f=0;f<p.length;f++){var g=p[f];n.paint(s,g.x,g.y,1,g.label)}d.Graphics.popClip(t)}},i.prototype.getRenderingParts=function(e,i){for(var n=e.context,s=this.scene,r=e.labelRenderer,a=s.displayUnit.unit,o=s.settings.localization.markerDates.timeFormats[a],l=s.x0,h=l+s.width,u=Math.round(s.y0),c=Math.round(u+s.height),d=[],p=[],f=[],g=[],m=[],v=[],y=[],S=[],b=this.scene.momentLocale,C=0;C<i.length;C++){var x=i[C],w=s.timeToX(x.time);w=Math.floor(w)+.5,x.labelCacheUnit===a&&x.labelCacheTime===x.time||(null!==x.initialText?(x.label.text=x.initialText,x.settings.showTime&&(x.label.text+=" "+t.moment(x.time).locale(b).utc().format(o).replace(/ /g,"聽"))):x.settings.showTime&&(x.label.text=t.moment(x.time).locale(b).utc().format(o).replace(/ /g,"聽")),r.measure(n,x.label),x.labelCacheUnit=a,x.labelCacheTime=x.time);var L=x.label.style.margin||0,A=x.label.hwidth+L,T=x.label.hheight+L,M=2*A,k=2*T;if(w+A>=l-1&&w-A<=h+1){var P=x.settings.align,I="center"===P?A:M;w+I>=h?(P="left",w-=2):w-I<=l&&(P="right",w+=2);var D=w-A,F=w+A,N=w;"left"===P?(N=w-A+L,F=w,D=w-M):"right"===P&&(N=w+A-L,F=w+M,D=w);var E=[],z=-1,O=D<l?Math.max(l,D):D>h?Math.min(h,D):D,H=this.getTopPos(O,I),_="top"===x.settings.side?H:Math.round(s.height+.5*s.bottomAxisSize);if(0!==d.length)for(;;){var R=z!==-1?f[z]+m[z]:_,B=R+k;z=-1;for(var U=0;U<d.length;U++)if(E.indexOf(U)===-1){var V=p[U],G=d[U],W=f[U],j=g[U],Y=D>=G&&D<=V||F>=G&&F<=V||D<=G&&F>=V,q=R>=W&&R<=j||B>=W&&B<=j||R<=W&&B>=j;if(Y&&q){E.push(U),_=f[U]+m[U],z=U;break}}if(z===-1)break}var Z=void 0;"top"===x.settings.side?Z=_+T:(c=u+s.height-T+L,Z=Math.min(_,s.height+.5*s.bottomAxisSize)),Z=(0|Z)+.5,m.push(k),v.push(M),f.push(_),g.push(_+k),d.push(D),p.push(D+M);var X={value:c,changes:!1};null!=x.animator&&(X=x.animator.updateAndGet(Z,e.timeStamp)),y.push({x:w,y:X.value+T-L,style:x.settings.style,side:x.settings.side}),S.push({x:N,y:X.value,label:x.label}),X.changes&&(e.animating=!0)}}return{lines:y,labels:S}},i.prototype.getTopPos=function(t,e){var i=this.scene.x0+this.scene.width,n=this.chart.shell.getChartInnerArea();return n.findTopPosition(t,Math.min(t+e,i))},i.prototype.createMarkers=function(){var t=this.scene,e=t.markers.filter(function(t){return!t.isMilestone}),i=t.settings,n=i.milestones;for(var s in n){var r=n[s];if(r.enabled){var a=new A(t,r,i.area.style.markerText);a.animator=new d.Animator(0,0,200),e.push(a)}}t.markers=e},i}(d.ChartElement);t.Markers=T;var M=function(t){function e(){t.apply(this,arguments),this.showTime=!0,this.align="left",this.side="bottom",this.label={margin:4,padding:3,textStyle:{font:"12px Arial",fillColor:"red"}},this.style={lineColor:"red"}}return n(e,t),e}(L);t.SettingsCurrentTime=M;var k=function(t){function e(e){t.call(this),this.animationOrder=100,this.paintOrder=35,this.updateOrder=900,this.marker=null,this.timeTimerUnit=null,this.timeTimer=null,this.timeTimerTarget=-(1/0),this.timeTickerEnabled=!1,this.timeTimerCheckAlways=!1,this._lastAnchor=null,this.chart=e,this.settings=this.chart.settings,this.scene=this.chart.scene,this.events=this.chart.events,this.createMarker(),this.updateTimers()}return n(e,t),e.prototype.updateTimers=function(){var t=this,e=this.settings.advanced;this.timeTickerEnabled=e.timeUpdateInterval&&(this.settings.currentTime.enabled||"now"===this.scene.anchor),this.timeTickerEnabled?this.updateCurTime():this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=null),e.dataUpdateInterval?this.dataTimer=setInterval(function(){return t.dataTick()},e.dataUpdateInterval):this.dataTimer&&(clearInterval(this.dataTimer),this.dataTimer=null)},e.prototype.createMarker=function(){var t=this.settings.currentTime,e=this.marker,i=this.scene.markers;e&&(i.splice(i.indexOf(e),1),this.marker=null),t.enabled&&(e=this.marker=new A(this.scene,t,null),e.isMilestone=!1,i.push(e))},e.prototype.onSceneChange=function(t){var e=!1,i=t.changes.settingsChanges;i&&((i.advanced||i.currentTime)&&(this.updateTimers(),e=!0),i.currentTime&&this.createMarker()),this._lastAnchor!==this.scene.anchor&&(e||this.updateTimers(),this._lastAnchor=this.scene.anchor),this.timeTickerEnabled&&(t.changes.timeMarker||t.changes.time&&(this.timeTimerCheckAlways||!this.timeTimer||this.scene.getScale()<this.timeTimerUnit))&&(this.updateCurTime(),this.updateVisiblePeriod())},e.prototype.timerTick=function(){this.timeTimer=null,this.chart.removed||(this.updateCurTime(),this.updateVisiblePeriod())},e.prototype.dataTick=function(){var t=this;if(this.dataTimer=null,!this.chart.removed&&this.scene.displayUnit){var e=this.scene.getCurTime(),i=function(){t.updateVisiblePeriod()};for(var n in this.chart.data){var s=this.chart.data[n];s.updateData(this.scene.displayUnit,e,i)}}},e.prototype.doAnimations=function(t){t.changes.data&&this.updateVisiblePeriod()},e.prototype.updateCurTime=function(t){var e=this,i=this.scene;this.timeTimerUnit=i.getScale();var n=i.getCurTime();this.marker&&(this.marker.time=n);var s=i.timeToX(n);if(!isNaN(s)){var r=s+200>i.x0&&s-200<i.x0+i.width,a=this.settings.advanced.timeUpdateInterval,o=0;if(r)this.timeTimerCheckAlways=!1,void 0===t&&this.events.notifySceneChanges({requestPaint:!0}),i.displayUnit.approxTime()>=36e5&&(o=(i.xToTime(s+1|0)-n)/2,a=Math.max(a,o),o/=4);else{if(s>0)return;a=Math.max(a,i.dxToDtime(-s-200)/2),this.timeTimerCheckAlways=!0}var l=+new Date;if(this.timeTimer){var h=this.timeTimerTarget-l;if(h<a+o)return;window.clearTimeout(this.timeTimer)}r&&i.dTimeToDx(a)>1?this.events.notifySceneChanges({timeMarker:!0}):(this.timeTimerTarget=l+a,this.timeTimer=setTimeout(function(){return e.timerTick()},a))}},e.prototype.updateVisiblePeriod=function(){var t=this.scene,e=t.displayUnit;if(e&&this.settings.navigation.followAnchor){var i=null;if("now"===t.anchor){var n=t.getCurTime();i=n}else if("newestData"===t.anchor){var s=this.chart.getDataLimits().to;i=s}if(null!==i){var r=this.chart.scrolling,a=r.getTo();if(a<i){var o=r.getFrom(),l=e.roundTimeUp(i,t.timeStepSettings)-a;this.chart.scrolling.setTimeRangeSnap(o+l,a+l,a+l,t.displayUnit,!0,"timer",!0,!1)}}}},e}(d.ChartElement);t.TimeUpdater=k;var P=function(t){function e(i){t.call(this,d.SettingsMapping.TimeChartSettings),this._minUnit=null,this._displayUnitsParsed=[],this._displayPeriodsParsed=[],this._computedDataMap={},this.theme=e.FlatTheme,this.navigation={initialDisplayAnchor:"newestData",initialDisplayPeriod:"max",initialDisplayUnit:"auto",followAnchor:!1},this.area=new G,this.chartTypes={columns:{type:"columns"},line:{type:"line"},candlestick:{type:"candlestick"}},this.currentTime=new M,this.milestones=[],this.timeAxis=new x,this.data=[],this.toolbar=new a,this.localization=new R,this.interaction=new U,this.advanced=new _,this.events=new H,this.advanced.assets.push({url:"assets://moment.js",required:function(){return!window.moment}}),this.advanced.assets.push({url:"assets://moment-tz.js",required:function(){return!window.moment||!window.moment.tz}}),this.apply(i),this._initializing=!1}return n(e,t),e.prototype.timeZoneCompatibility=function(){var t=this.timeAxis;null==t.timeZone&&(t.timeZone="UTC",d.Helpers.warn("`null` is not a valid value for `timeAxis.timeZone`, using `UTC`")),"local"===t.timeZoneOffset&&(t.timeZoneOffset=-(new Date).getTimezoneOffset());for(var e=this.data,i=0;i<e.length;i++){var n=e[i];null!=n.timeZoneOffset&&(d.Helpers.error("Setting `data.timeZoneOffset` has been deprecated. Please use `timeZone` in the data response instead."),"local"===n.timeZoneOffset&&(n.timeZoneOffset=-(new Date).getTimezoneOffset()))}},e.prototype.apply=function(e){this.applyCompatibility(e,[{from:"toolbars",to:"toolbar"},{from:"toolbar.periodSelection",to:"toolbar.displayPeriod"},{from:"toolbar.zoomOutButton",to:"toolbar.zoomOut"},{from:"toolbar.backButton",to:"toolbar.back"},{from:"interaction.scrolling.noData",to:"interaction.scrolling.limitMode"},{from:"interaction.scrolling.noDataSnapBackProportion",to:"interaction.scrolling.overscrollProportion",transform:function(t){return 1-t}},{from:"area.initialDisplayPeriod",to:"navigation.initialDisplayPeriod"},{from:"area.initialDisplayAnchor",to:"navigation.initialDisplayAnchor"},{from:"area.initialDisplayUnit",to:"navigation.initialDisplayUnit"},{from:"area.followAnchor",to:"navigation.followAnchor"},{from:"timeAxis.timeZoneOffset",alternative:"timeAxis.timeZone"},{from:"timeAxis.style.vgrid",to:"timeAxis.style.vgrid.lineColor",filter:function(t){return"string"==typeof t}},{from:"currentTime.overrideCurTime",to:"currentTime.time"},{from:"advanced.maxUnitsToDisplay",alternative:"timeAxis.minUnitWidth"}]);var i=t.prototype.apply.call(this,e,I);return this.timeZoneCompatibility(),this._calcMinUnit(),this._displayUnitsParsed=this._parseUnits(this.area.displayUnits),this._displayPeriodsParsed=this._parsePeriods(this.area.displayPeriods),i},e.prototype._parseUnits=function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],r=s.parse(n.unit,n.name);this._minUnit.isSmallerOrEqual(r)&&e.push(r)}return e.sort(function(t,e){return t.approxTime()-e.approxTime()})},e.prototype._parsePeriods=function(t){for(var e=[],i=0;i<t.length;i++){var n=s.parse(t[i].unit);n&&this._minUnit.isSmallerOrEqual(n)&&e.push(n)}return e.sort(function(t,e){return t.approxTime()-e.approxTime()})},e.prototype._calcMinUnit=function(){for(var t=new s("y",1e6),e=t,i=0;i<this.area.displayUnits.length;i++){var n=this.area.displayUnits[i],r=s.parse(n.unit,n.name);r.isSmaller(t)&&(t=r)}for(var i=0;i<this._computedSeries.length;i++){var a=this._computedSeries[i],o=this._computedDataMap[a.data.source];if(!o)throw new Error("Data source `"+a.data.source+"` for series not found!");for(var l=0;l<o.units.length;l++){var h=o.units[l],u=s.parse(h);u.isSmaller(e)&&(e=u)}}e.isBigger(t)&&(t=e),this._minUnit=t},e.StaticChart={interaction:{zooming:{enabled:!1,click:!1},selection:{enabled:!1},scrolling:{enabled:!1},resizing:{enabled:!1}},toolbar:{items:["export"]}},e.DarkTheme={advanced:{themeCSSClass:"DVSL-flat DVSL-dark",style:{loadingArcStyle:{lineColor:"#EEE"},messageTextStyle:{fillColor:"#EEE"}}},area:{style:{fillColor:"rgba(28,26,28,1)",noData:{fillColor:"#DDD",image:"builtin://linearchart-no-data-light"},selection:{lineColor:"#838283"},selectionLabel:{fillColor:"#BFBBB9"},zoomHighlight:{fillColor:"rgba(142,142,142,0.15)"},zoomHighlightInactive:{fillColor:"rgba(142,142,142,0.15)"}}},title:{margin:15,style:{fillColor:"#A8A7A8"}},chartTypes:{columns:{style:{gradient:1,depth:0}}},valueAxisDefault:{style:{valueLabel:{textStyle:{fillColor:"#A8A7A8"}},title:{textStyle:{fillColor:"#A8A7A8"}}}},timeAxis:{style:{majorTimeLabel:{fillColor:"#A8A7A8",shadowColor:null},minorTimeLabel:{fillColor:"#A8A7A8",shadowColor:null},minorTimeRuler:{lineColor:"#838283"},dateLighten:{fillColor:"rgba(142,142,142,0.15)"},dateHolidays:{fillColor:"rgba(139,139,139,0.11)"}}},info:{style:{highlight:{fillColor:"rgba(142,142,142,0.15)"}}},currentTime:{style:{lineColor:"#D12E2B"}},legend:{text:{fillColor:"#A8A7A8"},advanced:{disabledSeries:{textColor:"rgba(168,167,168,0.5)",lineColor:"rgba(117,117,117,0.8)"}}}},e.FlatTheme={advanced:{themeCSSClass:"DVSL-flat"},area:{style:{noData:{fillColor:"#DDD",image:"builtin://linearchart-no-data-light"}}},chartTypes:{columns:{style:{gradient:1,depth:0}}},timeAxis:{style:{showMajorTimeBalloons:!1,showMinorTimeBalloons:!1,majorTimeLabel:{fillColor:"#000",shadowColor:null},minorTimeLabel:{fillColor:"#000",shadowColor:null},dateLighten:{fillColor:"rgba(0,0,0,0.05)"}}}},e.RoundTheme={advanced:{themeCSSClass:"DVSL-round"},valueAxisDefault:{style:{valueLabel:{textStyle:{fillColor:"#000000",font:"11px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:0,shadowColor:"rgba(255,255,255,0.5)"}}}},timeAxis:{style:{showMinorTimeBalloons:!1,showMajorTimeBalloons:!0,minorTimeBalloonStyle:{fillColor:"#FFF",shadowOffsetX:0,shadowOffsetY:2,shadowBlur:2,shadowColor:"#888"},majorTimeBalloonStyle:{fillColor:"#AAA",shadowOffsetX:0,shadowOffsetY:-1,shadowBlur:0,shadowColor:"rgba(0,0,0,0.3)"},minorTimeLabel:{fillColor:"#000000",font:"12px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:0,shadowColor:"rgba(255,255,255,0.5)"},majorTimeLabel:{fillColor:"#FFF",font:"11px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:1,shadowColor:"#7c7c7c"},minorTimeRuler:{lineColor:"rgba(0,0,0,0.2)"},dateLighten:{fillColor:"rgba(0,0,0,0.05)"}}},chartTypes:{columns:{style:{gradient:.8,depth:3}}},area:{style:{noData:{image:"builtin://linearchart-no-data-dark"}}}},e.GradientTheme={advanced:{themeCSSClass:"DVSL-gradient"},valueAxisDefault:{style:{valueLabel:{textStyle:{fillColor:"#000000",font:"11px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:0,shadowColor:"rgba(255,255,255,0.5)"}}}},timeAxis:{style:{showMinorTimeBalloons:!1,showMajorTimeBalloons:!0,
  49. minorTimeBalloonStyle:{fillColor:"#FFF",shadowOffsetX:0,shadowOffsetY:2,shadowBlur:2,shadowColor:"#888"},majorTimeBalloonStyle:{fillColor:"AAA",shadowOffsetX:0,shadowOffsetY:-1,shadowBlur:0,shadowColor:"rgba(0,0,0,0.3)"},minorTimeLabel:{fillColor:"#000000",font:"12px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:0,shadowColor:"rgba(255,255,255,0.5)"},majorTimeLabel:{fillColor:"#FFF",font:"11px Arial",shadowOffsetX:0,shadowOffsetY:1,shadowBlur:1,shadowColor:"#7c7c7c"},minorTimeRuler:{lineColor:"rgba(0,0,0,0.2)"},dateLighten:{fillColor:"rgba(255,255,255,0.2)"}}},chartTypes:{columns:{style:{gradient:.8,depth:3}}},area:{style:{noData:{image:"builtin://linearchart-no-data-dark"}}}},e}(l.Settings);t.Settings=P;var I=function(t){function e(){t.apply(this,arguments),this.data=new D}return n(e,t),e.getMapping=function(t,e){if(t&&e.type&&t.type!==e.type)throw new Error("It is not possible to change the value of `type` property for an existing layer.");switch(t?t.type:e.type){case"columns":case void 0:return d.SettingsMapping.TimeChartSettingsSeriesColumns;case"candlestick":return d.SettingsMapping.TimeChartSettingsSeriesCandleStick;case"line":return d.SettingsMapping.TimeChartSettingsSeriesLines;default:throw new Error("The value '"+e.type+"' is not valid for the `type` property of a series. Valid values are: columns, candlestick, line.")}},e.createInstance=function(t,e){switch(e||t.type){case"columns":case void 0:return new F;case"candlestick":return new O;case"line":return new N;default:throw new Error("The value '"+(e||t.type)+"' is not valid for the `type` property of a series. Valid values are: columns, candlestick, line.")}},e}(l.SettingsSeries);t.SettingsSeries=I;var D=function(t){function e(){t.apply(this,arguments),this.index=1,this.countIndex=null}return n(e,t),e}(l.SettingsSeriesData);t.SettingsSeriesData=D;var F=function(t){function e(){t.apply(this,arguments),this.data=new D}return n(e,t),e}(l.SettingsSeriesColumns);t.SettingsSeriesColumns=F;var N=function(t){function e(){t.apply(this,arguments),this.data=new D,this.style=new E}return n(e,t),e}(l.SettingsSeriesLines);t.SettingsSeriesLines=N;var E=function(t){function e(){t.apply(this,arguments),this.markerStyleFunction=null}return n(e,t),e}(l.SettingsSeriesLinesStyle);t.SettingsSeriesLinesStyle=E;var z=function(t){function e(){t.apply(this,arguments),this.high=null,this.open=null,this.close=null,this.low=null}return n(e,t),e}(D);t.SettingsSeriesCandleStickData=z;var O=function(t){function e(){t.apply(this,arguments),this.data=new z}return n(e,t),e}(l.SettingsSeriesCandleStick);t.SettingsSeriesCandleStick=O;var H=function(t){function e(){t.call(this),this.selectionChangeDuringInteraction=!1,this.onTimeChange=null,this.chartUpdateDelay=400}return n(e,t),e}(l.SettingsEvents);t.SettingsEvents=H;var _=function(t){function e(){t.apply(this,arguments),this.timeUpdateInterval=900,this.dataUpdateInterval=null,this.maxUnitsToDisplay=2e4}return n(e,t),e}(d.SettingsAdvanced);t.SettingsAdvanced=_;var R=function(t){function e(){t.apply(this,arguments),this.calendar={parentLocale:null},this.holidayWeekdays=[6,7],this.toolbar=new B,this.timeUnitsNames={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},this.timeUnitsNamesPlural={ms:"milliseconds",s:"seconds",m:"minutes",h:"hours",d:"days",w:"weeks",M:"months",y:"years"},this.markerDates={timeFormats:{ms:"HH:mm:ss",s:"HH:mm:ss",m:"HH:mm:ss",h:"HH:mm",d:"D, HH:mm",w:"MMM D",M:"MMM D",y:"YYYY, MMM D"}},this.infoDates={majorTimeFormats:{y:null,M:"YYYY",w:"GGGG",d:"YYYY",h:"MMM D, YYYY",m:"MMM D, YYYY",s:"MMM D, YYYY",ms:"MMM D, YYYY"},minorTimeFormats:{y:"YYYY",M:"MMM",w:"[Week] W",d:"MMM D",h:"HH:mm",m:"HH:mm",s:"HH:mm:ss",ms:"ss.SSS"},fullTimeFormats:{ms:"MMM D, YYYY HH:mm:ss",s:"MMM D, YYYY HH:mm:ss",m:"MMM D, YYYY, HH:mm",h:"MMM D, YYYY HH:00",d:"MMM D, YYYY",w:"[Week] W, GGGG",M:"MMM YYYY",y:"YYYY"}},this.timeAxisDates={minorLabelTimeFormats:{ms:"ss.SSS",s:"HH:mm:ss",m:"HH:mm",h:"HH:00",d:"MMM D",w:"MMM D",M:"MMM",y:"YYYY"},majorLabelTimeFormats:{ms:"MMM D, YYYY HH:mm:ss",s:"MMM D, YYYY HH:mm:ss",m:"MMM D, YYYY",h:"MMM D, YYYY HH:00",d:"MMM D, YYYY",w:"[Week] W, GGGG",M:"MMM YYYY",y:"YYYY"},majorLabelFullTimeFormats:{ms:"MMM D, YYYY HH:mm:ss",s:"MMM D, YYYY HH:mm:ss",m:"MMM D, YYYY",h:"MMM D, YYYY HH:00",d:"MMM D, YYYY",w:"[Week] W, GGGG",M:"MMM YYYY",y:"YYYY"}},this.determiningDataBounds="Determining data bounds",this.loadingLabel="Loading..."}return n(e,t),e}(l.SettingsLocalization);t.SettingsLocalization=R;var B=function(t){function e(){t.apply(this,arguments),this.customPeriod="Custom",this.periodDropdownTitle="Select units in which to show the data",this.unitDropdownTitle="Select units in which to show the data",this.zoomoutButton="Zoom-out",this.zoomoutTitle="Zoom out",this.unavailableUnitTitle="zoom in for more"}return n(e,t),e}(l.SettingsLocalizationToolbar);t.SettingsLocalizationToolbar=B;var U=function(t){function e(){t.apply(this,arguments),this.snapMode="displayUnit",this.selection=new v,this.scrolling=new g,this.zooming=new V}return n(e,t),e}(l.SettingsInteraction);t.SettingsInteraction=U;var V=function(t){function e(){t.apply(this,arguments),this.enabled=!0,this.click=!0}return n(e,t),e}(l.SettingsInteractionZooming);t.SettingsInteractionZooming=V;var G=function(t){function e(){t.apply(this,arguments),this.displayUnits=[{unit:"1 ms",name:"millisecond"},{unit:"1 s",name:"second"},{unit:"5 s",name:"5 seconds"},{unit:"1 m",name:"minute"},{unit:"5 m",name:"5 minutes"},{unit:"1 h",name:"hour"},{unit:"6 h",name:"6 hours"},{unit:"1 d",name:"day"},{unit:"1 M",name:"month"},{unit:"1 y",name:"year"}],this.displayPeriods=[{unit:"10 ms"},{unit:"100 ms"},{unit:"s"},{unit:"m"},{unit:"h"},{unit:"d"},{unit:"M"},{unit:"y"},{unit:"10 y"},{unit:"100 y"}],this.style=new W}return n(e,t),e}(l.SettingsArea);t.SettingsArea=G;var W=function(t){function e(){t.apply(this,arguments),this.markerText={font:"12px Arial"},this.selection=new y,this.selectionLabel={fillColor:"#000000",font:"12px Arial"}}return n(e,t),e}(l.SettingsAreaStyle);t.SettingsAreaStyle=W;var j=function(e){function i(t){e.call(this,t),this.animationOrder=700,this.paintOrder=25,this.updateOrder=1100}return n(i,e),i.prototype.doAnimations=function(t){var e=this.scene;if(null!=e.selectionStart&&this.chart.selection.isSelecting&&e.settings.info.enabled){var i=e.selectionStart,n=e.selectionEnd;this.showInfoPopup(i,n,null,this.buildContent(i,n,null,null),t)}},i.prototype.getPopupAreaMouseMoved=function(t,e){var i=this.scene;if(!i.displayUnit||!i.xyInChartOrBottom(t,e))return null;var n=i.hoverFrom,s=i.hoverTo;return{t0:n,t1:s}},i.prototype.getContentsFunctionRange=function(t,e){var i=s.timeUnitDiffs,n=this.scene,r=!n.displayUnit||i[n.displayUnit.unit]<i.d;return[n.timestampFromInternal(t,r),n.timestampFromInternal(e,r)]},i.prototype.buildHeader=function(e,i){var n=this.scene.displayUnit;if(!n)return"";var s,r=this.scene.settings.localization,a=r.infoDates,o=Math.ceil(n.numberOfUnits(e,i)),l=o*n.count|0,h=l%10===1&&l%100!==11?r.timeUnitsNames[n.unit]:r.timeUnitsNamesPlural[n.unit],u=this.scene.momentLocale;if(1===o){var c=t.moment(e).locale(u).utc(),d=c.format(a.fullTimeFormats[n.unit]);s=""+d}else{"d"!==n.unit&&"M"!==n.unit&&"y"!==n.unit&&"ms"!==n.unit||(i-=1);var c=t.moment.utc(e).locale(u),p=t.moment.utc(i).locale(u),f=n.getBigger()||n,g=this.scene.timeStepSettings;if("y"!==n.unit&&f.roundTimeDown(e,g)===f.roundTimeDown(i,g)){var m=c.format(a.majorTimeFormats[n.unit]),v=c.format(a.minorTimeFormats[n.unit]),y=p.format(a.minorTimeFormats[n.unit]);s=v+" - "+y+" "+m}else{var v=c.format(a.fullTimeFormats[n.unit]),y=p.format(a.fullTimeFormats[n.unit]);s=v+" - "+y}}return"<em></em><strong>"+s+("<small>("+l+" "+h+")</small></strong>")},i}(l.InfoPopup);t.InfoPopup=j;var Y=function(t){function e(e){t.call(this),this.animationOrder=600,this.paintOrder=20,this.updateOrder=1200,this.chart=null,this.scene=null,this.pointer=null,this.chart=e,this.scene=e.scene}return n(e,t),e.prototype.previewPointerMove=function(t){this.pointer=null,this.updateHover(t)},e.prototype.onPointerOut=function(t){var e=this.scene;e.hoverFrom=null,e.hoverTo=null,e.hoverSeriesItem=null,t.changes.hover=!0,this.chart.notifyHoverChanged(t,this.chart.createEventArguments(t,"user"))},e.prototype.previewPointerDown=function(t){this.pointer=t.identifier,this.updateHover(t)},e.prototype.updateHover=function(t){var e=this.chart,i=e.scene,n=this.getClickRange(t.x,t.y),s=null,r=null,a=null;if(n&&(s=n.t0,r=n.t1,a=e.renderer.hitTest(t.x,t.y)),e.legend)if(a)e.legend.notifyHoveredSeries(i.settings._computedSeries[a.seriesIndex]);else{e.legend.notifyHoveredSeries(null);var o=e.legend.getLastHoveredSeries();o&&(a={x0:null,y0:null,x1:null,y1:null,isMarker:!1,seriesIndex:i.settings._computedSeries.indexOf(o)})}(s!==i.hoverFrom||r!==i.hoverTo||!a!=!i.hoverSeriesItem||a&&(a.seriesIndex!==i.hoverSeriesItem.seriesIndex||a.x0!==i.hoverSeriesItem.x0))&&(i.hoverFrom=s,i.hoverTo=r,i.hoverSeriesItem=a,t.changes.hover=!0,e.notifyHoverChanged(t,e.createEventArguments(t,"user")))},e.prototype.onClick=function(t){t.identifier===this.pointer&&this.chart.notifyClick(t,this.chart.createEventArguments(t,"user"))},e.prototype.defaultClick=function(t,e){var i=this.scene,n=this.chart,s=i.settings.interaction;if(s.zooming.click){var r=i.xToTime(t.x);if(null!==i.selectionStart&&(i.selectionStart>r||i.selectionEnd<r))this.clearSelection(t,"user");else if(null!==i.hoverFrom&&!n.selection.isHoveringEdge){var a=i.displayUnit,o=n.scrolling,l=i.hoverFrom,h=i.hoverTo,u=o.timeSetup.getLimits(a,!0);null!=u.from&&(l=Math.max(l,u.from)),null!=u.to&&(h=Math.min(h,u.to)),o.setTimeRangeSnap(l,h,null,null,!0,"user",!1,!0);var c=o.targetUnit||i.displayUnit;c===a&&(c=o.timeSetup.getSmallerDisplayUnit(c),c&&o.setTimeRangeSnap(l,h,null,c,!0,"user",!1,!0)),null!==i.selectionStart&&this.clearSelection(t,"user"),t.consumed=!0}}},e.prototype.onRightClick=function(t){null!==this.scene.selectionStart&&this.clearSelection(t,"user"),null!==this.scene.hoverFrom&&(this.chart.notifyRightClick(t,this.chart.createEventArguments(t,"user")),t.defaultPrevented&&(t.consumed=!0))},e.prototype.onDoubleClick=function(t){null!==this.scene.hoverFrom&&(this.chart.notifyDoubleClick(t,this.chart.createEventArguments(t,"user")),t.consumed=!0)},e.prototype.clearSelection=function(t,e){this.scene.selectionStart=null,this.scene.selectionEnd=null,this.chart.notifySelectionChanged(this.chart.createEventArguments(t,e)),t.changes.selection=!0,t.consumed=!0},e.prototype.onTripleClick=function(t){void 0!==this.scene.hoverFrom&&null!==this.scene.hoverFrom&&(this.chart.notifyTripleClick(t,this.chart.createEventArguments(t,"user")),t.consumed=!0)},e.prototype.getClickRange=function(t,e){var i=this.scene;if(!i.xyInChartOrBottom(t,e))return null;var n,s,r,a=this.scene.xToTime(t);if(null!==i.selectionStart&&a>=i.selectionStart&&a<i.selectionEnd)n=i.selectionStart,s=i.selectionEnd,r=Math.max(2,i.displayUnit.numberOfUnits(n,s));else if(i.displayUnit){var o=!0,l=i.timeStepSettings;if(i.majorTimeUnit){var h=i.majorTimeUnit.roundTimeDown(a,l),u=i.majorTimeUnit.roundTimeUp(a+1,l);e>i.y0+i.height&&(h>i.timeStart||u<i.timeEnd)&&(n=h,s=u,n=i.displayUnit.roundTimeDown(n,l),s=i.displayUnit.roundTimeUp(s,l),r=i.displayUnit.numberOfUnits(n,s),o=!1)}o&&(n=i.displayUnit.roundTimeDown(a,l),s=i.displayUnit.roundTimeUp(a+1,l),r=1)}else n=null,s=null,r=null;return{t0:n,t1:s,numBars:r}},e}(d.ChartElement);t.ClickNotifier=Y;var q=function(){function t(t){this.requests={},this.results={},this.dataSlicesCache={},this.nextRequestId=0,this.hasNewRequests=!1,this.lastSlicer=null,this.chart=t,this.scene=this.chart.scene}return t.prototype.registerDataProcessingRequest=function(t){this.requests[this.nextRequestId]=t;var e=this.chart;return this.results[this.nextRequestId]={leadIn:null,leadOut:null,times:[],xes:[],values:[],counts:[],fromIndex:0,toIndex:0,data:[],from:0,to:0,slicer:null,dataExistsFrom:null,dataExistsTo:null,externalItems:function(t,i){for(var n=this,r=s.timeUnitDiffs,a=!e.displayUnit||r[e.displayUnit.unit]<r.d,o=new Array(i-t),l=t;l<i;l++)o[l-t]=e.scene.timestampFromInternal(n.times[l],a);return o}},this.hasNewRequests=!0,this.nextRequestId++},t.prototype.removeDataProcessingRequest=function(t){delete this.requests[t],delete this.results[t]},t.prototype.getDisplayUnitsSlicer=function(){return this.lastSlicer},t.prototype.getData=function(t){return this.results[t]},t.prototype.clear=function(){this.requests={},this.results={}},t.prototype.process=function(t){var e=t.changes;if(e.time||e.data||e.displayUnit||e.bounds||e.settings||this.hasNewRequests)if(this.scene.timeStart>=this.scene.timeEnd)for(var i in this.requests){var n=this.results[i];n.dataExistsFrom=null,n.dataExistsTo=null}else{this.hasNewRequests=!1,this.loading=!1,this.hasSomeData=!1;var s=!!e.data||e.time;for(var i in this.requests){var r=this.requests[i],n=this.results[i],a=this.updateData(s,r,n);this.updateSlices(a,i,r,n)}this.scene.loading=this.loading,this.loading?this.scene.setMessage("noData",this.scene.settings.localization.loadingLabel,10):this.hasSomeData?this.scene.setMessage("noData",null):this.scene.setMessage("noData",this.scene.settings.localization.noDataLabel,999)}},t.prototype.exportData=function(t,e,i,n){for(var s=new C(this.scene,i,[],t,e,!0,0),r=s.times,a=[],o=0;o<n.length;o++){var l=n[o],h=l.data,u=this.chart.getData(h.source),c=u.getDataForRange(t,e,i,null),d=new Array(r.length-1);this.fillValues(c.values,s.times,d,s.counts,s.fromIndex,s.toIndex,h,i),a.push(d)}return{timestamps:s.times.slice(s.fromIndex,s.toIndex-1),values:a}},t.prototype.updateData=function(t,e,i){var n=this,s=e.source,r=this.chart.getData(s),a=this.getUnitToUse(e),o=(this.scene.timeEnd-this.scene.timeStart)*r.dataSettings.prefetchRatio;if(t||!i.from&&this.scene.timeStart||!i.to&&this.scene.timeEnd||i.from>=i.to||this.scene.timeStart-o<i.from||this.scene.timeEnd+o>i.to||null!==i.dataExistsFrom&&i.dataExistsFrom>this.scene.timeEnd||null!==i.dataExistsTo&&i.dataExistsTo<this.scene.timeStart){t=!0;var l=this.scene.timeStart-2*o,h=this.scene.timeEnd+2*o,u=r.getDataForRange(l,h,a,function(){return n._newDataArrived(s)});r.noData||(this.hasSomeData=!0),u.from>this.scene.timeEnd||u.to<this.scene.timeStart?(i.data=[],i.from=0,i.to=0,i.dataExistsFrom=null,i.dataExistsTo=null,this.loading=this.loading||u.loading):(this.loading=this.loading||u.loading&&(u.from>this.scene.timeStart||u.to<this.scene.timeEnd),i.data=u.values,i.from=l,i.to=h,i.dataExistsFrom=u.from,i.dataExistsTo=u.to)}return t},t.prototype.updateSlices=function(t,e,i,n){var s=this.getUnitToUse(i),r=i.index,a=i.valueFunction,o=n.data,l=n.slicer=this.getSlice(e,i,s),h=l.update(this.scene.timeStart,this.scene.timeEnd),u=h.newBefore,c=h.newAfter,d=n.times=l.times,p=n.counts=l.counts;n.xes=l.xes;var f=n.values=l.values;if(o=n.data,n.fromIndex=l.fromIndex,n.toIndex=l.toIndex,o)o.length>0&&!a&&r>=o[0].length?this.chart.error("No data for this DataIndex: "+r+", only "+(o[0].length-1)+" values present"):(t?this.fillValues(o,d,f,p,l.fromIndex,l.toIndex,i,s):(this.fillValues(o,d,f,p,l.fromIndex,u+1,i,s),this.fillValues(o,d,f,p,c-1,l.toIndex,i,s)),this.setLeads(i,n,s));else{f=n.values=new Array(d.length);for(var g=0;g<f.length;g++)f[g]=null;n.leadIn=null,n.leadOut=null}},t.prototype.getSlice=function(t,e,i){var n,s=t+"-"+i.toString();return n=this.dataSlicesCache.hasOwnProperty(s)?this.dataSlicesCache[s]:this.dataSlicesCache[s]=new C(this.scene,i,["values","counts"]),this.lastSlicer=n,n},t.prototype.getUnitToUse=function(t){return this.scene.displayUnit},t.prototype.setLeads=function(t,e,i){var n=t.noDataPolicy,s=t.index,r=t.valueFunction,a=e.data,o=e.values,l=e.times,h=null,u=null;if("join"===n&&a){var d=e.fromIndex;if(null===o[d]){var p=c.binSearch(a,l[d]);if(p=c.linSearchDown(a,p,s,r),p!==-1){var f=a[p][0],g=e.slicer.makeMiniSlice(f),m=[g.t0,g.t1],v=[g.x0,g.x1],y=[null,null],S=[null,null];this.fillValues(a,m,y,S,0,2,t,i),h={times:m,xes:v,values:y,counts:S,fromIndex:0,toIndex:2}}}var b=e.toIndex;if(null===o[b-2]){var p=c.binSearch(a,l[b-1]);if(p=c.linSearchUp(a,p,s,r),p!==-1){var f=a[p][0],g=e.slicer.makeMiniSlice(f),m=[g.t0,g.t1],v=[g.x0,g.x1],y=[null,null],S=[null,null];this.fillValues(a,m,y,S,0,2,t,i),u={times:m,xes:v,values:y,counts:S,fromIndex:0,toIndex:2}}}}e.leadIn=h,e.leadOut=u},t.prototype.fillValues=function(t,e,i,n,s,r,a,o){var l=a.aggregation,h=0|a.index,u=0|a.countIndex,c=a.valueFunction,d=a.aggregatedValueFunction;if(!(s+1>=r)&&("sum"===l?this.fillValueSum(t,e,i,n,s,r,h,u,c):"min"===l?this.fillValueMin(t,e,i,n,s,r,h,u,c):"max"===l?this.fillValueMax(t,e,i,n,s,r,h,u,c):"avg"===l?this.fillValueAvg(t,e,i,n,s,r,h,u,c):"count"===l?this.fillValueCount(t,e,i,n,s,r,h,u,c):"first"===l?this.fillValueFirst(t,e,i,n,s,r,h,u,c):"last"===l?this.fillValueLast(t,e,i,n,s,r,h,u,c):this.chart.error("Unrecognized aggregation function: "+l),d))for(var p=s;p<=r-2;p++)i[p]=d(i[p],e[p],o?o.toString():null)},t.prototype.fillValueSum=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=0,g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(f+=m,g+=0===o?1:t[u][o]),u+=1;n[d]=g,i[d]=0===g?null:f}},t.prototype.fillValueMin=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=1/0,g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(f=Math.min(f,m),g+=0===o?1:t[u][o]),u+=1;n[d]=g,i[d]=0===g?null:f}},t.prototype.fillValueMax=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=-(1/0),g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(f=Math.max(f,m),g+=0===o?1:t[u][o]),u+=1;n[d]=g,i[d]=0===g?null:f}},t.prototype.fillValueCount=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=0,g=void 0;u<h&&t[u][0]<p;)g=l?l(t[u]):t[u][a],null!=g&&(f+=o?t[u][o]:1),u+=1;n[d]=f,i[d]=f}},t.prototype.fillValueAvg=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=0,g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(f+=m,g+=o?t[u][o]:1),u+=1;n[d]=g,i[d]=0===g?null:f/g}},t.prototype.fillValueFirst=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=null,g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(null===f&&(f=m),g+=o?t[u][o]:1),u+=1;n[d]=g,i[d]=f}},t.prototype.fillValueLast=function(t,e,i,n,s,r,a,o,l){for(var h=t.length,u=c.binSearch(t,e[s]),d=s;d<=r-2;d++){for(var p=e[d+1],f=null,g=0,m=void 0;u<h&&t[u][0]<p;)m=l?l(t[u]):t[u][a],null!=m&&(f=m,g+=o?t[u][o]:1),u+=1;n[d]=g,i[d]=f}},t.prototype._newDataArrived=function(t){var e={};e[t]=!0,this.chart.events.notifySceneChanges({data:e})},t}();t.DataWarehouse=q;var Z=function(t){function e(e,i){t.call(this),this.animationOrder=400,this.paintOrder=5,this.updateOrder=1500,this.dataWarehouse=i,this.chart=e,this.scene=this.chart.scene,this.events=this.chart.events,this.buildSeries()}return n(e,t),e.prototype.buildSeries=function(){this.valueAxis=new l.ValueAxisSet(this.chart,this.scene.settings._computedValueAxisList),this.r=new l.Renderer(this.chart,this.valueAxis),this.dataWarehouse.clear(),this.requestIds=[];for(var t=0;t<this.scene.settings._computedSeries.length;t++){var e=this.scene.settings._computedSeries[t];this.requestIds.push(this.dataWarehouse.registerDataProcessingRequest(e.data))}},e.prototype.onSceneChange=function(t){var e=t.changes;(e.linearChartSeries||e.linearChartValueAxis)&&this.buildSeries(),e.linearChartValueAxis&&(e.bounds=!0),(e.bounds||e.settings)&&(e.time=!0),e.data&&d.Helpers.hasProperties(e.data)&&this.chart.notifyChartUpdate("data",!0)},e.prototype.getPanels=function(){return this.valueAxis.getPanels(!1)},e.prototype.doAnimations=function(t){var e=t.changes;if(this.dataWarehouse.process(t),this.scene.displayUnit){if(this.displayUnit!==this.scene.displayUnit&&(this.displayUnit=this.scene.displayUnit,e.displayUnit=!0),e.time||e.data||e.displayUnit||e.bounds){for(var i=[],n=0;n<this.requestIds.length;n++)i.push(this.dataWarehouse.getData(this.requestIds[n]));this.r.process(i)}this.valueAxis.updateMinMax(t),this.r.afterProcess(),this.valueAxis.doAnimations(t)}},e.prototype.paintScene=function(t){this.valueAxis.paintUnder(t),d.Graphics.pushClip(t,this.scene.x0,this.scene.y0,this.scene.width,this.scene.height),this.r.paint(t),d.Graphics.popClip(t),this.valueAxis.paint(t)},e.prototype.hitTest=function(t,e){return this.scene.xyInChart(t,e)?this.r.hitTest(t,e,this.scene.settings.interaction.selection.tolerance):null},e.prototype.exportData=function(t,e){return this.r.exportData(t,e)},e}(d.ChartElement);t.Renderer=Z;var X=function(t){function e(e){t.call(this),this.chart=e,this.scene=e.scene,this.settings=e.settings,this.reinitializePeriod=!0}return n(e,t),e.prototype.onSceneChange=function(t){var e=t.changes.settingsChanges;e&&e.navigation&&(this.reinitializePeriod=!0),this.reinitializePeriod&&this.chart.assetsLoaded&&this.setupInitialDisplayPeriod()},e.prototype.onNewDataObject=function(){},e.prototype.setupInitialDisplayPeriod=function(){var t=this;if(this.scene.width){this.reinitializePeriod=!1;var e=this.settings.navigation.initialDisplayAnchor,i=this.settings.navigation.initialDisplayPeriod,n=this.settings.navigation.initialDisplayUnit;this.computeDisplayPeriod(i,e,n,function(n,s,r){if(t.scene.setMessage("impl",null,0),t.scene.loading=!1,t.scene.displayUnit&&(r=t.scene.displayUnit),!t.scene.timeStart&&!t.scene.timeEnd){var a=t.chart.scrolling.timeSetup,o=a.getLimits(r,!0);null!==o.from&&(n=Math.round(Math.max(n,o.from))),null!==o.to&&(s=Math.round(Math.min(s,o.to))),t.chart.scrolling.setTimeRange(n,s,r,!1,"init",e,i)}})}},e.prototype.computeDisplayPeriod=function(t,e,i,n){var s=this,r=this.chart.scrolling.computeDisplayPeriod(t,e,i,this.scene.mainData.dataFrom,this.scene.mainData.dataTo),a=r.from,o=r.to,l=r.unit;if(null!==a&&null!==o&&l)return n(a,o,l);if(!(this.scene.mainData.dataSettings.dataFunction||this.scene.mainData.dataSettings.url||this.scene.mainData.dataSettings.urlByUnit||this.scene.mainData.dataSettings.preloaded))return void this.chart.error("Cannot compute data dependant display period, no data given. DisplayPeriod = "+t+", DisplayAnchor = "+e);var h=function(l,u,c,d,p,f){if(!s.chart.removed){if(null===l||null===u||0===l&&0===u&&s.scene.mainData.noData)return void n(d,p,f);r=s.chart.scrolling.computeDisplayPeriod(t,e,i,l,u),a=r.from,o=r.to;var g=r.unit;return null===a||null===o?void s.chart.error("Could not setup display time interval. Check your configuration."):void(g.isMultipleOf(c)?n(a,o,g):s.scene.mainData.determineDataLimits(g,!0,!0,function(t,e,i){return h(t,e,i,l,u,g)}))}};this.scene.mainData.determineDataLimits(null,!0,!0,function(t,e,i){return h(t,e,i,0,0,null)})},e}(d.Navigator);t.Navigator=X,t.moment=null;var Q=!1,K=function(e){function i(i,n){e.call(this,new P(i),new b,n),this.timeAxis=null,this.timeStart=0,this.timeEnd=0,this.displayUnit=null,this.selectionStart=0,this.selectionEnd=0,this._cachedDataLimits=null,this.dataWarehouse=new q(this),this.renderer=this.events.addElement(new Z(this,this.dataWarehouse)),this.scrolling=this.events.addElement(new m(this)),this.selection=this.events.addElement(new S(this)),this.navigator=this.events.addElement(new X(this)),this.clickNotifier=this.events.addElement(new Y(this)),this.infoPopup=this.events.addElement(new j(this)),this.events.addElement(new k(this)),this.events.addElement(new t.Markers(this)),this.events.addElement(new l.Highlights(this)),this.finalInitialize()}return n(i,e),i.prototype.notifyAssetsLoaded=function(){if(!this.removed){if(!t.moment){if(t.moment=window.moment,!t.moment)return void this.error("Unable to load moment library. Please check that the assets are configured properly.");d.Helpers.compareVersions(t.moment.version,[2,9])||this.error("ZoomCharts requires moment version 2.9.0 or newer. The loaded version is "+t.moment.version)}!Q&&t.moment.tz&&(d.Helpers.compareVersions(t.moment.tz.version,[0,5])||this.error("ZoomCharts requires moment-timezone version 0.5.0 or newer. The loaded version is "+t.moment.tz.version),Q=!0),this.setMomentLocale();var i=this.settings.timeAxis;t.moment.tz&&"local"===i.timeZone&&(i.timeZone=t.moment.tz.guess(),d.Helpers.warn("Instead of using `local` for `timeAxis.timeZone` it is recommended to specify the exact timezone since the local timezone detection is error prone. The timezone was detected as `"+i.timeZone+"`.")),this.timeAxis||(this.timeAxis=this.events.addElement(new w(this)));for(var n=Object.keys(this.data),s=0;s<n.length;s++)this.data[n[s]].notifyAssetsLoaded();e.prototype.notifyAssetsLoaded.call(this),this.api._notifyAssetsLoaded()}},i.prototype.createDataObj=function(t){return new c(this,t)},i.prototype.getData=function(t){return e.prototype.getData.call(this,t)},i.prototype.setMomentLocale=function(){var e=this.scene.momentLocale,i=t.moment.locale(),n=this.settings.localization.calendar;n.parentLocale&&!d.Helpers.compareVersions(t.moment.version,[2,12])&&this.error("Using `parentLocale` requires moment.js 2.12.0 or newer. The loaded version is "+t.moment.version),t.moment.locale(e,null),t.moment.locale(e,n),this.scene.timeStepSettings={week:{dow:t.moment.localeData().firstDayOfWeek()}},t.moment.locale(i)},i.prototype.remove=function(){t.moment&&t.moment.locale(this.scene.momentLocale,null),e.prototype.remove.call(this)},i.prototype.onSettingsChanged=function(t){if(t.data&&(t.toolbar=!0),t.area&&t.area.displayUnits){var e=this.scene,i=new o(this);if(e.displayUnit&&!i.isAllowedDisplayUnit(e.displayUnit)){var n=i.computeDisplayUnit(e.timeStart,e.timeEnd,e.displayUnit,e.timeStart,e.timeEnd,e);this.scrolling.setTimeRangeSnap(e.timeStart,e.timeEnd,null,n.unit,!0,"api",!0,!0)}}t.localization&&t.localization.calendar&&this.setMomentLocale(),this.events.notifySceneChanges({time:!0})},i.prototype.save=function(){var t=this.scene;return JSON.stringify({from:this.timeStart,to:this.timeEnd,unit:this.displayUnit.toString(),selFrom:t.selectionStart,selTo:t.selectionEnd,anchor:t.anchor,period:t.period})},i.prototype.restore=function(t,e){if(t){var i=JSON.parse(t),n=s.parse(i.unit);n&&(this.scrolling.setTimeRange(i.from,i.to,n,e,"api",i.anchor,i.period),this.setSelection(i.selFrom,i.selTo))}},i.prototype.warnInvisibleChart=function(t){this.scene.width||d.Helpers.warn("`"+t+"()` method has been called on a hidden chart. This might produce invalid results since the chart width impacts the calculations.")},i.prototype.setSelection=function(t,e,i){void 0===i&&(i="api");var n=this.scene;n.selectionStart===t&&n.selectionEnd===e||(n.selectionStart=t,n.selectionEnd=e,this.events.notifySceneChanges({selection:!0}),this.notifySelectionChanged(this.createEventArguments(null,i)))},i.prototype.setTimeRange=function(t,e,i,n){void 0===n&&(n="api"),this.warnInvisibleChart("time"),this.setSelection(null,null,n);var r=this.displayUnit;if(!r){var a=this.settings.navigation.initialDisplayUnit;a&&"auto"!==a&&(r=s.parse(a))}if(this.scene.displayUnit=r,this.scene.width){var o=this.scrolling.onSnapWhileDragging(t,e,null,!0,2);o.unit&&(this.scene.displayUnit=o.unit,o=this.scrolling.onSnapAfterDragging(o.from,o.to,null,!0,2)),t=o.from,e=o.to,r=o.unit}this.scrolling.setTimeRange(t,e,r,i,n)},i.prototype.setDisplayPeriod=function(t,e,i,n,s){var r=this;return void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=!0),void 0===s&&(s="api"),this.warnInvisibleChart("setDisplayPeriod"),null===e&&(e=this.scene.anchor),this.setSelection(null,null),"string"==typeof e&&(e=e.trim()),"string"==typeof t&&(t=t.trim()),this.navigator.computeDisplayPeriod(t,e,i,function(i,a,o){return r.scrolling.setTimeRange(i,a,o,n,s,e,t)})},i.prototype.scroll=function(t,e){var i=t.trim().split(" ");if(3!==i.length)return void this.error("Incorrect scroll format: "+t);var n=i[0],s=parseInt(i[1],10),r=i[2];if("<"!==n&&">"!==n||"number"!=typeof s)return void this.error("Scroll:Incorrect scroll format: "+t);var a=new o(this),l=a.scroll(this.timeStart,this.timeEnd,this.displayUnit,n,s,r),h=l.from,u=l.to;this.scrolling.setTimeRange(h,u,this.displayUnit,e,"api",null,this.scene.period)},i.prototype.zoomOut=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e="api"),void 0===i&&(i=null),this.setSelection(null,null),this.scrolling.zoomOut(i,this.scene.timeStart,this.scene.timeEnd,t,e),this.scene.period=null},i.prototype.zoomOutPossible=function(){return!!this.scene.displayUnit},i.prototype.zoomIn=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=!0),void 0===n&&(n="api"),this.setSelection(null,null),this.scrolling.zoomIn(t,e,this.scene.timeStart,this.scene.timeEnd,i,n),this.scene.period=null},i.prototype.setDisplayUnit=function(t,e,i,n){void 0===i&&(i="api"),void 0===n&&(n=!1),this.warnInvisibleChart("displayUnit");var r,a,o;if("auto"===t){var l=this.scrolling.timeSetup.computeDisplayUnit(null,null,null,this.timeStart,this.timeEnd,this.scene);r=l.unit,a=l.from,o=l.to}else{if(r=s.parse(t),!r)return;if(n){for(var h=r.toString(),u=this.scene.settings._displayUnitsParsed,c=!1,p=0;p<u.length;p++)if(u[p].toString()===h){c=!0;break}c||d.Helpers.warn("The display unit `"+h+"` does not match a display unit configured in `area.displayUnits`.")}var f=this.scene.timeStepSettings;a=r.roundTimeDown(this.timeStart,f),o=r.roundTimeUp(this.timeEnd,f)}var g=this.scrolling.snap(a,o,null,r,!1,!0);this.scrolling.setTimeRange(g.from,g.to,r,e,i,g.anchor,g.period)},i.prototype.invalidateDataLimits=function(){this._cachedDataLimits=null},i.prototype.getDataLimits=function(t){void 0===t&&(t=this.displayUnit);var e=this._cachedDataLimits;if(e&&e.unit===t)return e;for(var i=this.settings._computedSeries,n=Object.create(null),s=0;s<i.length;s++){var r=i[s];r.enabled&&(n[r.data.source]=!0)}var a=1/0,o=-(1/0);for(var l in n){var h=this.data[l];h&&(h.dataLimitFrom||h.dataLimitTo)&&(a=Math.min(a,h.dataLimitFrom),o=Math.max(o,h.dataLimitTo))}return a>o?(a=null,o=null):t&&(a=t.roundTimeDown(a,this.scene.timeStepSettings),o=t.roundTimeUp(o,this.scene.timeStepSettings)),this._cachedDataLimits={from:a,to:o,unit:t}},i.prototype.getDisplayLimits=function(t){var e=this.getDataLimits(t),i=e.from,n=e.to;if(null===i)return e;for(var s=0;s<this.scene.markers.length;s++){var r=this.scene.markers[s];r.settings.overrideLimits&&(i=Math.min(i,r.time),n=Math.max(n,r.time))}return{from:i,to:n}},i.prototype.exportVisibleData=function(){if(!this.displayUnit)return[];for(var e=this.settings._computedSeries,i=this.dataWarehouse.exportData(this.timeStart,this.timeEnd,this.displayUnit,e),n=this.settings.localization.infoDates.fullTimeFormats[this.displayUnit.unit],s=i.timestamps,r=i.values,a=["timestamp","time"],o=0;o<e.length;o++){var l=e[o];a.push(l.name||l.id||"")}for(var h=[a],u=this.scene.momentLocale,c=0;c<s.length;c++){for(var d=s[c],p=[d,t.moment.utc(d).locale(u).format(n)],f=0;f<e.length;f++)p.push(r[f][c]);h.push(p)}return h},i.prototype.isThisDisplayPeriod=function(t,e,i){if(!this.displayUnit)return!1;var n=this.scene.mainData.dataFrom,s=this.scene.mainData.dataTo,r=this.scrolling.computeDisplayPeriod(t,e,i,n,s);n=r.from,s=r.to;var a=this.scrolling.getFrom(),o=this.scrolling.getTo(),l=o-a,h=Math.abs(a-n)/l;if(h>.1)return!1;var u=Math.abs(o-s)/l;return!(u>.1)},i.prototype.notifyTimeChanged=function(t,e,i,n){this.timeStart=t,this.timeEnd=e,this.displayUnit=i,this.notifyChartUpdate(n)},i.prototype.saveNavigation=function(){return this.displayUnit?{timeStart:this.timeStart,timeEnd:this.timeEnd,displayUnit:this.displayUnit,anchor:this.scene.anchor,period:this.scene.period}:null},i.prototype.restoreNavigation=function(t,e,i){this.timeStart=t.timeStart,this.timeEnd=t.timeEnd,this.displayUnit=t.displayUnit,this.scrolling.setTimeRange(this.timeStart,this.timeEnd,this.displayUnit,e,i,t.anchor,t.period)},i.prototype.doChartUpdateNotify=function(t){e.prototype.doChartUpdateNotify.call(this,t),this.dispatchEventParams("timeChange",this.createEventArguments(null,t),null)},i.prototype.createEventArguments=function(t,e){
  50. var i=this.scene,n=i.hoverSeriesItem,r=n&&null!=n.seriesIndex?i.settings._computedSeries[n.seriesIndex]:null,a=!!n&&n.isMarker,o=s.timeUnitDiffs,l=!this.displayUnit||o[this.displayUnit.unit]<o.d,h=i.timestampFromInternal(i.hoverFrom,l),u=i.timestampFromInternal(i.hoverTo,l);return{chart:this.api,origin:e,timeStart:i.timestampFromInternal(this.timeStart,l),timeEnd:i.timestampFromInternal(this.timeEnd,l),displayUnit:this.displayUnit?this.displayUnit.toString():null,selectionStart:i.timestampFromInternal(i.selectionStart,l),selectionEnd:i.timestampFromInternal(i.selectionEnd,l),hoverStart:h,hoverEnd:u,hoverSeries:r,hoverMarker:a,clickStart:h,clickEnd:u,clickSeries:r,clickMarker:a}},i.prototype.defaultClick=function(t,i){e.prototype.defaultClick.call(this,t,i),this.clickNotifier.defaultClick(t,i)},i.prototype.defaultRightClick=function(t){this.infoPopup.show(t),t.preventDefault()},i.prototype.getBottomHeight=function(){return this.scene.height-this.scene.bottomAxisSize},i.prototype.showInfoPopup=function(t,e,i){if(null==t)return void this.infoPopup.hideInfoPopup(null);if(null==e||t===e)e=t+1;else if(t>e){var n=t;t=e,e=n}var s=this.displayUnit,r=this.scene.timeStepSettings;t=s.roundTimeDown(t,r),e=s.roundTimeUp(e,r),e<this.scene.timeStart||t>this.scene.timeEnd||this.infoPopup.manualShowInfoPopup(t,e,i)},i}(l.Impl);t.Impl=K}(o),function(t){var e=t.Renderers||(t.Renderers={}),i=function(t){function e(){t.apply(this,arguments),this.itemsToLoad=50,this.partialLoad=!0,this.autoCategories=null,this.sortField=null,this.dataFunction=null,this.preloaded=null}return n(e,t),e}(d.SettingsData);t.SettingsData=i;var s={values:1,id:1,offset:1,limit:1,afterSum:1,beforeSum:1,subvalues:1,sum:1,extra:1,name:1,totalCount:1,total:1,valuesSum:1,done:1,afterFraction:1,beforeFraction:1},r=function(){function t(){this.name=null,this.values=[],this.offset=0,this.totalCount=null,this.total=0,this.valuesSum=0,this.beforeSum=0,this.afterSum=0,this.done=!1,this.extra=null}return t}();t.PieData=r;var a=function(t){function e(e,i,n){t.call(this,e,i),this.pies={},this.pendingPies={},this.requestedPies={},this.nextId=0,this._isFacetChart=n}return n(e,t),e.exportValues=function(t){var e=["id","name","value"],i={id:0,name:1,value:2},n=3,s=t.values,r=new Array(s.length+1);r[0]=e;for(var a=0;a<s.length;a++){var o=s[a],l=new Array(n);r[a+1]=l;for(var h=Object.keys(o),u=0;u<h.length;u++){var c=h[u];if("_"!==c.charAt(0)&&"fraction"!==c){var p=o[c];if(Array.isArray(p))p=p.length;else if(d.Helpers.isObjectOrArray(p))continue;var f=i[c];void 0===f&&(i[c]=f=n++,e.push(c)),l[f]=p}}}return r},e.prototype.hasDataFunc=function(){return!!this.dataSettings.dataFunction||!!this.dataSettings.url},e.prototype.applyPreloadedData=function(){if(t.prototype.applyPreloadedData.call(this),!this.hasDataFunc()){for(var e=Object.keys(this.pies),i=0;i<e.length;i++){var n=this.pies[e[i]];n.done||(n.done=!0,n.afterSum=0,n.totalCount=n.offset+n.values.length)}this.chart.scene.loading=!1}},e.prototype.getRootId=function(){return this.settings.navigation.initialDrilldown&&this.settings.navigation.initialDrilldown.length>0?this.settings.navigation.initialDrilldown[0]:""},e.prototype.canExpand=function(t){return!!d.Helpers.hasProperty(this.pies,t)||!(!this.hasDataFunc()||this.dataSettings.autoCategories)&&!(!t||t[0]===d.Helpers.SeparatorChar)},e.prototype.getPieData=function(t){if(!d.Helpers.hasProperty(this.pies,t))return null;var e=this.pies[t];return this.needPostprocessing()&&(e=this.filterAndSortData(e)),e},e.prototype.requestMorePieData=function(t,e){return void 0===e&&(e=this.dataSettings.itemsToLoad),null==e&&(e=this.dataSettings.itemsToLoad),!(!d.Helpers.hasProperty(this.pies,t)||this.pies[t].done)&&(this.requestPieData(t,this.pies[t].offset+this.pies[t].values.length,e),!0)},e.prototype.requestLessPieData=function(t,e){if(void 0===e&&(e=this.dataSettings.itemsToLoad),!d.Helpers.hasProperty(this.pies,t))return!1;var i=this.pies[t];return(0!==i.offset||!(i.done||i.values.length>1))&&(this.requestPieData(t,Math.max(i.offset-this.dataSettings.itemsToLoad,0),e),!0)},e.prototype.requestPieData=function(t,e,i){if(void 0===i&&(i=this.dataSettings.itemsToLoad),this.dataSettings.autoCategories){if(d.Helpers.hasProperties(this.pies))throw new Error("Cannot request additional data when autoCategories is in use!");t=""}if(t[0]===d.Helpers.SeparatorChar)throw new Error("Invalid Id: "+t);if(d.Helpers.hasProperty(this.pies,t)){var n=this.pies[t],s=n.offset,r=s+n.values.length;if(e<s)i=s-e;else{if(!(e+i>r))return;i=e+i-r,e=r}}else(this.needPostprocessing()||!this.dataSettings.partialLoad||this.dataSettings.autoCategories)&&(i=2147483647,e=0);if(!d.Helpers.hasProperty(this.requestedPies,t))if(d.Helpers.hasProperty(this.pendingPies,t)){var a=this.pendingPies[t],o=Math.min(a.offset,e),l=Math.max(a.offset+a.limit,e+i);a.offset=o,a.limit=l-o}else this.dataFunc&&(this.pendingPies[t]={id:t,offset:e,limit:i},this.scheduleRequests())},e.prototype.autoCategorize=function(t,e){if(0===e.length)return t;for(var i=d.Helpers.clone(t),n=[i],s=0;s<e.length;s++){for(var r=e[s],a=[],o=0;o<n.length;o++){for(var l=n[o],h=[],u={},c=0;c<l.subvalues.length;c++){var p=l.subvalues[c],f=void 0;f=d.Helpers.isFunction(r)?r(p):p[r],f=void 0===f||null===f?"None":f.toString();var g=void 0;d.Helpers.hasProperty(u,f)?g=u[f]:(g={id:l.id+d.Helpers.SeparatorChar+f,__id:l.id+d.Helpers.SeparatorChar+f,value:0,subvalues:[],name:f,__category:r},u[f]=g,h.push(g),a.push(g)),g.subvalues.push(p),g.value+=d.Helpers.tryParseFloat(p.value,0)}l.subvalues=h}n=a}return i},e.prototype.valueSum=function(t){if(this._isFacetChart)return 0;for(var e=0,i=0;i<t.length;i++)e+=t[i].value;return e},e.prototype.addDataInt=function(t,e,i,n,a,o,l,h,u){var c;c=d.Helpers.hasProperty(this.pies,t)?this.pies[t]:this.pies[t]=new r;var p=c.offset+c.values.length,f=i+e.length;if(0===c.values.length||f<c.offset||p<i)c.offset=i,c.done=n>e.length,c.values=e.slice(),c.valuesSum=this.valueSum(e),c.totalCount=c.done?c.values.length+c.offset:null,c.afterSum=c.done?0:a,c.beforeSum=0===c.offset?0:o,c.total=c.done&&0===c.offset?c.valuesSum:l;else{var g=null,m=null,v=0,y=0;c.offset<i&&(i===p?(g=c.values,v=c.valuesSum):(g=c.values.slice(0,i-c.offset),v=this.valueSum(g))),p>f&&e.length>=n&&(c.offset===f?(m=c.values,y=c.valuesSum):(m=c.values.slice(f-c.offset),y=this.valueSum(m))),m?c.values=g?g.concat(e,m):e.concat(m):c.values=g?g.concat(e):e.slice(),c.offset=Math.min(c.offset,i),c.valuesSum=this.valueSum(e)+v+y,e.length<n&&(c.done=!0),g||(c.beforeSum=o),m||(c.afterSum=a),c.total=l,c.done&&(c.afterSum=0),0===c.offset&&(c.beforeSum=0),c.done&&0===c.offset&&(c.total=c.valuesSum)}if(c.extra=h.extra,c.name=h.name,h)for(var S in h)d.Helpers.hasProperty(s,S)||(c[S]=h[S]);for(var b=0;b<e.length;b++){var C=e[b];C.subvalues&&(u[C.__id]=!0,this.addDataInt(C.__id,C.subvalues,0,1/0,null,null,null,C,u))}},e.prototype.needPostprocessing=function(){var t=this.chart.settings.filters;return!!t.sliceFilter||!t.allowZeroValues||!!this.dataSettings.sortField},e.prototype.filterAndSortData=function(t){var e=this.chart.settings.filters,i=e.allowZeroValues,n=e.sliceFilter;if(!i||n){for(var s=t.total||0,a=[],o=0;o<t.values.length;o++){var l=t.values[o];n&&!e.sliceFilter(l)||!i&&0===l.value?s-=l.value:a.push(l)}var h=new r;h.values=a,h.done=t.done,h.beforeSum=t.beforeSum,h.afterSum=t.afterSum,h.total=t.total||null,h.totalCount=t.totalCount||null,h.extra=t.extra,t=h}return this.dataSettings.sortField&&this.sortData(t),t},e.prototype.sortData=function(t){var e=this.dataSettings.sortField;if(d.Helpers.isFunction(e))return void t.values.sort(e);var i;i=Array.isArray(e)?e.slice():[e];for(var n=new Array(i.length),s=0;s<i.length;s++){var r=i[s];"-"===r.charAt(0)?(i[s]=r.substr(1),n[s]=-1):n[s]=1}var a=function(t,e){for(var s=0;s<i.length;s++){var r=t[i[s]],a=e[i[s]],o=void 0;if(null==r?o=null==a?0:a<0?-1:1:null==a?o=r<0?1:-1:(o=a-r,isNaN(o)&&(o=(""+a).localeCompare(r))),0!==o)return n[s]*o}return 0};t.values.sort(a)},e.prototype.buildRequest=function(){if(!d.Helpers.hasProperties(this.pendingPies))return null;var t=d.Helpers.removePropertyValue(this.pendingPies),e=t.key,i=t.value;return this.requestedPies[e]=i,i},e.prototype.dataFunc=function(t,e,i){var n=this.dataSettings;if(n.dataFunction)n.dataFunction(t.id,t.limit,t.offset,e,i);else if(n.url){var s=[];t.id&&s.push(["id",t.id]),s.push(["limit",t.limit.toString(10)]),s.push(["offset",t.offset.toString(10)]),d.Data.doRequest(n.url,n,s,e,i)}else i({error:"Chart configuration does not define data retrieval function"})},e.prototype.verifySlices=function(t,e,i){for(var n=!0,s=0;s<t.length;s++){var r=t[s],a=r.id?" Slice id: `"+r.id+"`":"";if(d.Helpers.isObjectOrArray(r)){if(!this._isFacetChart)if(r.value=d.Helpers.tryParseFloat(r.value,null),null===r.value){if(!i){d.Helpers.warn("Slices must have a numeric `value` property!"+a),t.splice(s,1),s--;continue}this.chart.error("Slices must have a numeric `value` property!"+a),n=!1}else if(r.value<0){if(!i){d.Helpers.warn("Slice values cannot be negative."+a),t.splice(s,1),s--;continue}this.chart.error("Slice values cannot be negative."+a),n=!1}d.Helpers.hasProperty(r,"id")?(r.__id=""+r.id,d.Helpers.hasProperty(e,r.__id)&&(this.chart.error("Multiple slices with the same ID."+a),n=!1),e[r.__id]=!0):(r.__id=d.Helpers.SeparatorChar+this.nextId,this.nextId++),d.Helpers.hasProperty(r,"subvalues")&&(Array.isArray(r.subvalues)?this.verifySlices(r.subvalues,e,i)||(n=!1):(this.chart.error("Field `subvalues` is not an array!"+a),n=!1))}else this.chart.error("Slices must be objects!"),n=!1}return n},e.prototype.verifyData=function(t,e){if(d.Helpers.hasProperty(e,"id")||(e.id=t?t.id:this.getRootId()),t&&e.id&&e.id!==t.id)return this.chart.error("Requested data for ID `"+t.id+"` but got data with ID `"+e.id+"`. Consider specifying `navigation.initialDrilldown`."),!1;if(delete this.requestedPies[e.id],e.limit=d.Helpers.tryParseInt(e.limit,1/0),e.offset=d.Helpers.tryParseInt(e.offset,0),e.beforeSum=d.Helpers.tryParseFloat(e.beforeSum,null),e.afterSum=d.Helpers.tryParseFloat(e.afterSum,null),e.sum=d.Helpers.tryParseFloat(e.sum,null),!d.Helpers.hasProperty(e,"subvalues")){if(!d.Helpers.hasProperty(e,"values"))return this.chart.error("Field `subvalues` not set in root data object"),!1;d.Helpers.warn("Use of property `values` within PieChart data object is being deprecated. Please use `subvalues` instead.",null,!0),e.subvalues=e.values}if(!Array.isArray(e.subvalues))return this.chart.error("Field `subvalues` is not an array!"),!1;var i=!0;e.offset<0&&(this.chart.error("Data `offset` must be greater or equal to 0."),i=!1),e.limit<1&&(this.chart.error("Data `limit` must be greater than 0."),i=!1);var n=e.offset>0||e.limit<=e.subvalues.length;if(!this.verifySlices(e.subvalues,{},n))return!1;var s=e.limit>e.subvalues.length,r=e.offset+e.subvalues.length;if(t&&(e.offset>=t.offset+t.limit||t.offset>=r&&!s)&&(this.chart.error("Response and request do not overlap. Requested "+t.limit+" items starting at "+t.offset+". Received "+e.subvalues.length+" items starting at "+e.offset),i=!1),d.Helpers.hasProperty(this.pies,e.id)){var a=this.pies[e.id];if(a.values.length>0){var o=a.offset+a.values.length;(o<e.offset||r<a.offset&&!s)&&(this.chart.error("Data cannot be merged - there is a gap between old data and new data! Old data spans slices from "+a.offset+" to "+(o-1)+"; new data spans slices from "+e.offset+" to "+(r-1)+"."),i=!1)}}if(n&&this.dataSettings.autoCategories&&(this.chart.error("Cannot auto categorize partial data"),i=!1),!this._isFacetChart&&n){var l=(null==e.beforeSum?0:1)+(null==e.afterSum?0:1)+(null==e.sum?0:1);l<2?(this.chart.error("For partial loading, at least 2 of the following need to be set: beforeSum, afterSum, sum."),i=!1):(e.__valuesSum=this.valueSum(e.subvalues),null==e.beforeSum?e.beforeSum=e.sum-e.afterSum-e.__valuesSum:null==e.afterSum?e.afterSum=e.sum-e.beforeSum-e.__valuesSum:null==e.sum&&(e.sum=e.beforeSum+e.afterSum+e.__valuesSum),e.sum!==e.beforeSum+e.afterSum+e.__valuesSum&&(this.chart.error("For partial loading, beforeSum + (sum of subvalues) + afterSum must equal sum!"),i=!1),this._isFacetChart||(e.beforeSum<0&&(this.chart.error("beforeSum cannot be negative!"),i=!1),e.afterSum<0&&(this.chart.error("afterSum cannot be negative!"),i=!1),e.sum<0&&(this.chart.error("sum cannot be negative!"),i=!1)))}return i},e.prototype.addVerifiedData=function(t,e){this.chart.scene.loading=this.hasPendingRequests();var i=e.id,n={};return n[i]=!0,t?this.chart.log("Data arrived, id="+i+", offset="+t.offset+", len="+e.subvalues.length+" of "+(t.limit||"unset")):this.chart.log("Data arrived, id="+i+", offset="+e.offset+", len="+e.subvalues.length+" of "+(e.limit||"unset")),this.dataSettings.autoCategories&&(e=this.autoCategorize(e,this.dataSettings.autoCategories)),this.addDataInt(i,e.subvalues,e.offset,e.limit,e.afterSum,e.beforeSum,e.sum,e,n),{pieChartPieIds:n}},e.prototype.requestFailedPermanently=function(t){if(this.chart.scene.loading=this.hasPendingRequests(),t){var e=new r;e.done=!0,this.pies[t.id]=e,this.chart.error("Data request failed for pie with ID `"+t.id+"`."),delete this.requestedPies[t.id]}else this.chart.error("Data request failed.")},e}(d.Data);t.Data=a;var o=function(t){function e(){t.apply(this,arguments),this.marker=new l,this.showOthers=!1}return n(e,t),e}(d.SettingsLegend);t.SettingsLegend=o;var l=function(t){function e(){t.apply(this,arguments),this.shape="square"}return n(e,t),e}(d.SettingsLegendMarker);t.SettingsLegendMarker=l;var h=function(t){function e(e,i,n){t.call(this,e,i,null,null),this.sliceHovered=!1,this.data=n}return n(e,t),e.prototype.isHovered=function(){return this.hoverCount>0||this.sliceHovered},e}(d.LegendEntry),u=function(t){function e(e){t.call(this,e),this.paintOrder=20,this.updateOrder=1e3}return n(e,t),e.prototype.onSceneChange=function(e){t.prototype.onSceneChange.call(this,e);var i=e.changes;i.pie&&(this.rebuildItems(),i.bounds=!0)},e.prototype.getLastHoveredSlice=function(){var t=this.getLastHoveredEntry();return t?t.data:null},e.prototype.doAnimations=function(){for(var t=this.chart.scene.hoverSlice,e=0;e<this.entries.length;e++)this.entries[e].sliceHovered=this.entries[e].data===t;for(var i=this.chart.scene.selection,e=0;e<i.length;e++){var n=this.entryIndex[i[e].id];n&&(n.sliceHovered=!0)}},e.prototype.paintMarker=function(t,e,i,n,s){var r=s.data,a={fillColor:r.currentFillColor,lineColor:this.settings.marker.lineColor},o=t.context;o.beginPath(),d.Graphics.strokeMarker(o,this.settings.marker.shape,e,i,n),d.Graphics.paint(o,a)},e.prototype.rebuildItems=function(){var t=[],e=this.chart.scene.peek();if(e){var i=this.settings.text.fillColor,n=function(t){return new h(t.data.nameLegend||t.label.text||t.data.name,i,t)},s=this.settings.showOthers,r=e.slices,a=e.previousSlice,o=e.othersSlice;s&&a&&!a.removed&&t.push(n(a)),t.push.apply(t,r.map(n)),s&&o&&!o.removed&&t.push(n(o))}this.entryIndex={};for(var l=0;l<t.length;l++)this.entryIndex[t[l].data.id]=t[l];this.resetEntries(t)},e.prototype.itemClicked=function(t,e){},e}(d.Legend);t.Legend=u;var p=function(){function t(){this.hwidth=0,this.hheight=0,this.x=null,this.y=null,this.userPlaced=!1,this.inside=!0}return t}();t.Icon=p;var f=function(){function t(t,e){this.id=null,this.pie=null,this.data=null,this.index=0,this.value=0,this.percent=null,this.fraction=0,this.cutoutDistance=0,this.selectDistance=15,this.selection=0,this.brightness=1,this.expandable=!0,this.selected=!1,this.active=!1,this.removed=!1,this.icon=null,this.iconOffset=null,this.url=null,this.urlTarget=null,this.userPlaced=!1,this.inside=!0,this.x=0,this.y=0,this.originalId=null,this.currentCutoutDistance=null,this.currentFraction=null,this.currentInsideLabel=null,this.currentLabel=null,this.currentIcon=null,this.currentLineColor=null,this.currentFillColor=null,this.targetFillColor=null,this.targetLineColor=null,this._resetLabelText=!1,this._label={textStyle:{}},this._insideLabel={textStyle:{}},this.lineColor=null,this.fillColor=null,this.fillColor2=null,this.lineWidth=1,this.lineDash=null,this.lineBrightness=0,this._animatorF=null,this._animatorLineColor=null,this._animatorFillColor=null,this._animatorCutout=null,this._renderParams=null,this.index=e,this.pie=t}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){d.Helpers.isObjectOrArray(t)?this._label=t:(d.Helpers.warn("Slice.label should no longer be set to the text value - instead use Slice.label.text."),this._label.text=t?""+t:null,this._resetLabelText=!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"insideLabel",{get:function(){return this._insideLabel},set:function(t){d.Helpers.isObjectOrArray(t)?this._insideLabel=t:(d.Helpers.warn("Slice.insideLabel should no longer be set to the text value - instead use Slice.insideLabel.text."),this._insideLabel.text=t?""+t:null,this._resetLabelText&&(this._resetLabelText=!1,this._label.text=null))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelStyle",{get:function(){return d.Helpers.warn("Slice.labelStyle is deprecated - use Slice.label instead."),this._label},set:function(t){d.Helpers.warn("Slice.labelStyle is deprecated - use Slice.label instead."),t&&(t.text||(t.text=this._label.text),d.Helpers.extendDeep(this._label,t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"insideLabelStyle",{get:function(){return d.Helpers.warn("Slice.insideLabelStyle is deprecated - use Slice.insideLabel instead."),this._insideLabel},set:function(t){d.Helpers.warn("Slice.insideLabelStyle is deprecated - use Slice.insideLabel instead."),t&&(t.text||(t.text=this._insideLabel.text),d.Helpers.extendDeep(this._insideLabel,t))},enumerable:!0,configurable:!0}),t}();t.Slice=f;var g=function(){function t(){this.id=null,this.data=null,this.total=1,this.parentSlice=null,this.othersSlice=null,this.previousSlice=null,this.slices=[],this.allSlices=[],this.offset=0,this.count=0,this.background=!1,this.activeSliceId=null,this.brightness=1,this.loading=!1,this.scrollOffset=0,this.fillColor=null,this.x=0,this.y=0,this.startAngle=0,this.endAngle=0,this.rotationSpeed=0,this.currentlyRotating=!1,this.currentStartAngle=null,this.currentEndAngle=null,this.currentRadius=0,this.innerRadius=0,this.radius=0,this.currentInnerRadius=0,this.colorDistribution=null,this.sliceColors=null,this.removed=!1,this.visibleFraction=1,this.removeTime=null,this._animatorA0=null,this._animatorA1=null,this._animatorR0=null,this._animatorR1=null}return t.prototype.getActiveSlice=function(){if(!this.activeSliceId)return null;for(var t=0;t<this.slices.length;t++){var e=this.slices[t];if(e.id===this.activeSliceId)return e}return null},t}();t.Pie=g;var m=function(t){function e(){t.apply(this,arguments),this.radius=100,this.innerRadius=0,this.currentRadius=null,this.currentInnerRadius=null,this.pies=[],this.stack=[],this.selectionIds=[],this.hoverBack=!1,this.hoverSlice=null,this.hoverLabel=null,this.hoverPie=null,this.view=null,this.selection=[],this.pendingAction=null,this.pendingOffset=null}return n(e,t),e.prototype.addPie=function(t){return this.pies.push(t),this.stack.push(t),t},e.prototype.removePie=function(t){if(null!==t){t.removed=!0,t.removeTime=null,d.Helpers.removeFromArray(this.stack,t);for(var e=0;e<this.selection.length;){var i=this.selection[e];i.pie===t?d.Helpers.removeFromArray(this.selection,i):e++}}},e.prototype.deletePie=function(t){return d.Helpers.removeFromArray(this.pies,t),d.Helpers.removeFromArray(this.stack,t)},e.prototype.length=function(){return this.stack.length},e.prototype.peek=function(){return 0===this.stack.length?null:this.stack[this.stack.length-1]},e.prototype.push=function(t,e){void 0===e&&(e=null);var i=this.peek();if(i&&!e)for(var n=0;n<i.slices.length;n++){var s=i.slices[n];if(s.id===t.id){e=s;break}}if(e){t.parentSlice=e;var r=e.pie,a=this.getSliceAngles(e);t.currentStartAngle=a.a0,t.currentEndAngle=a.a1,t.currentRadius=r.currentRadius,t.currentInnerRadius=r.currentInnerRadius,i.activeSliceId=e.id;for(var n=0;n<t.allSlices.length;n++){var s=t.allSlices[n];s.currentFillColor=e.currentFillColor,s.currentLineColor=e.currentLineColor}}else i&&(i.activeSliceId=null);return i&&(i.background=!0),this.addPie(t)},e.prototype.pop=function(){if(0!==this.stack.length){this.removePie(this.peek());var t=this.peek();t&&(t.background=!1,t.brightness=1)}},e.prototype.getParent=function(t){for(var e=null,i=0;i<this.stack.length;i++){var n=this.stack[i];if(n===t)return e;e=n}return null},e.prototype.getChild=function(t){for(var e=null,i=0;i<this.stack.length;i++){var n=this.stack[i];if(e===t)return n;e=n}return null},e.prototype.updateOnPieChanged=function(t){var e=this.getParent(t),i=this.getChild(t);if(e&&!t.parentSlice)for(var n=0;n<e.slices.length;n++){var s=e.slices[n];if(s.id===t.id){t.parentSlice=s,e.activeSliceId=s.id;break}}if(i&&!i.parentSlice)for(var n=0;n<t.slices.length;n++){var s=t.slices[n];if(s.id===i.id){i.parentSlice=s,t.activeSliceId=s.id;break}}},e.prototype.findPieAt=function(t,e,i){return this.view.findPieAt(t,e,i)},e.prototype.findSliceAt=function(t,e,i,n){return this.view.findSliceAt(t,e,i,n)},e.prototype.findLabelAt=function(t,e,i){return this.view.findLabelAt(t,e,i)},e.prototype.getSliceAngles=function(t){for(var e=0,i=t.pie,n=0,s=0;s<i.allSlices.length;s++){var r=i.allSlices[s];if(n=e,e+=r.currentFraction,r.id===t.id)break}var a=i.currentEndAngle-i.currentStartAngle,o=i.currentStartAngle;return{a0:o+a*n,a1:o+a*e}},e.prototype.getSliceTargetAngles=function(t){for(var e=0,i=t.pie,n=0,s=0;s<i.allSlices.length;s++){var r=i.allSlices[s];if(n=e,e+=r.currentFraction,r.id===t.id)break}var a=i.currentEndAngle-i.currentStartAngle,o=i.currentStartAngle;return{a0:o+a*n,a1:o+a*e}},e}(d.Scene);t.Scene=m;var v=function(t){function e(i){t.call(this,d.SettingsMapping.PieChartSettings),this.theme=e.FlatTheme,this.data=[],this.legend=new o,this.navigation={initialDrilldown:[""],initialOffset:0},this.pie={radius:null,adaptiveRadius:!0,outerMargin:1,margin:2,centerMargin:5,showInnerPiesExport:!0,showInnerPies:!0,innerRadius:.3,innerRadiusWhenDrilldown:.2,startAngle:-Math.PI/2,endAngle:1.5*Math.PI,rotationSpeed:0,theme:"flat",depth:0,x:null,y:null,style:{fillColor:"transparent",sliceColors:["#2fc32f","#b0dc0b","#eab404","#de672c","#ec2e2e","#d5429b","#6f52b8","#1c7cd5","#56b9f7","#0ae8eb"],colorDistribution:"list",brightness:1},noDataStyle:{fillColor:"#ddd"},backgroundStyle:{},backgroundHoveredStyle:{brightness:.7},styleFunction:null},this.slice={margin:2,minFraction:0,style:{lineBrightness:0,brightness:1,lineWidth:1,label:{backgroundStyle:null,textStyle:{fillColor:"#000",font:"12px Arial"},lineSpacing:.2,margin:4,padding:0,borderRadius:999,text:null},insideLabel:{textStyle:{fillColor:"#fff",font:"12px Arial"},lineSpacing:.2,margin:4,padding:0,borderRadius:0,text:null}},hoverStyle:{brightness:1.2,lineBrightness:2,lineWidth:.35},selectedStyle:null,backgroundStyle:{fillColor:"#e2e2e2",fillColor2:"#e0e0e0"},backgroundActiveStyle:{brightness:1.3},othersStyle:{fillColor:"#ccc",lineDecoration:"zigzag"},previousStyle:{fillColor:"#ccc",lineDecoration:"zigzag"},connectorStyle:{lineColor:"#333",lineWidth:1},expandableMarkStyle:{lineWidth:1,lineColor:"rgba(255,255,255,0.8)",distance:4,lineDash:null},styleFunction:null},this.filters={sliceFilter:null,allowZeroValues:!1},this.labels=new y,this.icons={sizeExtent:[16,64],placement:"auto",autohideWhenTooSmall:!0},this.advanced=new x,this.interaction=new C,this.info={enabled:!0,contentsFunction:null},this.events=new S,this.toolbar=new d.SettingsToolbar(!1,[new d.SettingsToolbarItem("back"),new d.SettingsToolbarItem("export"),new d.SettingsToolbarItem("zoomOut"),new d.SettingsToolbarItem("fullscreen")]),this.localization=new b,this.toolbar.zoomOut=!1,this.apply(i),this._initializing=!1}return n(e,t),e.prototype.apply=function(e){this.applyCompatibility(e,[{from:"slice.labelStyle",to:"slice.style.label"},{from:"slice.insideLabelStyle",to:"slice.style.insideLabel"},{from:"labels.connectorStyle",to:"slice.connectorStyle"},{from:"labels.textStyle",to:"slice.style.label.textStyle"},{from:"labels.backgroundStyle",to:"slice.style.label.backgroundStyle"},{from:"labels.insideTextStyle",to:"slice.style.insideLabel.textStyle"},{from:"labels.padding",to:"slice.style.label.padding"},{from:"labels.borderRadius",to:"slice.style.label.borderRadius"},{from:"area.initialPieId",to:"navigation.initialDrilldown"},{from:"area.initialPieOffset",to:"navigation.initialOffset"},{from:"area.initialAnimation",to:"advanced.initialAnimation"},{from:"advanced.iconMinSize",alternative:"icons.sizeExtent[0]"},{from:"advanced.pointer.dragSensitivity",to:"interaction.selection.swipeSensitivity"}]);var i=t.prototype.apply.call(this,e);return i},e.FlatTheme={advanced:{themeCSSClass:"DVSL-flat",assets:[]},pie:{theme:"flat",depth:0}},e.DarkTheme={advanced:{themeCSSClass:"DVSL-dark",assets:[]},area:{style:{fillColor:"rgba(28,26,28,1)"}},title:{margin:15,style:{fillColor:"#A8A7A8"}},pie:{theme:"flat",depth:0,style:{sliceColors:["#32CD32","#36BEFF","#FBBD30","#EE3431","#894BBC","#0EC9AC","#524BBC","#0b83ea","#3ca20d","#BC438F"]}},slice:{connectorStyle:{lineColor:"#4C4C4C"},style:{label:{textStyle:{fillColor:"#A8A7A8"}}}},legend:{text:{fillColor:"#A8A7A8"},marker:{lineColor:null}}},e.BevelTheme={advanced:{themeCSSClass:"DVSL-flat",assets:[]},pie:{theme:"bevel",depth:0}},e.GradientTheme={advanced:{themeCSSClass:"DVSL-flat",assets:[]},pie:{theme:"smoothy",depth:0}},e.CanTheme={advanced:{themeCSSClass:"DVSL-flat",assets:[]},pie:{theme:"can",depth:10}},e}(d.Settings);t.Settings=v;var y=function(){function t(){this.enabled=!0,this.connectors=!0,this.connectorLength=20,this.angle=0,this.insideLabel="append",this.insideLabelVisibilityFraction=.8,this.interLabelSpacing=.6,this.placement="aligned"}return t}();t.SettingsLabels=y;var S=function(t){function e(){t.apply(this,arguments),this.onPieChange=null,this.onPieReadyStateChanged=null}return n(e,t),e}(d.SettingsEvents);t.SettingsEvents=S;var b=function(t){function e(){t.apply(this,arguments),this.othersLabel="Others",this.previousLabel="Previous"}return n(e,t),e}(d.SettingsLocalization);t.SettingsLocalization=b;var C=function(t){function e(){t.apply(this,arguments),this.mode="drilldown",this.coverCenter=!1,this.selection={enabled:!0,tolerance:2,swipe:!1,swipeSensitivity:10,partialSwipe:!1,maxSwipeDistance:45},this.animation={scrollDuration:500,hoverDuration:200},this.others={enabled:!0,centerGoesToPrevious:!1,navigationFraction:.15,maxSlicesVisible:15,minSlices:1,maxOthersFraction:.6,minSliceFraction:.01},this.scrolling={enabled:!1}}return n(e,t),e}(d.SettingsInteraction);t.SettingsInteraction=C;var x=function(t){function e(){t.call(this),this.iconMinSize=null,this.initialAnimation=!0,this.renderQuality=1,this.backImage="builtin://piechart-back",this.backImageBackground=null,this.backAlwaysVisible=!1,this.labelInsideTreshold=1,this.builtinAssets["piechart-back"]=c.PiechartBack,this.pointer.noClickOnDoubleClick=!1}return n(e,t),e}(d.SettingsAdvanced);t.SettingsAdvanced=x;var w=function(e){function i(i){e.call(this),this.animationOrder=1100,this.paintOrder=10,this.updateOrder=1200,this.currentSlice=null,this.currentLabel=null,this.currentPie=null,this.hoveringLegend=!1,this.draggedLabelSlice=null,this.draggedLabel=null,this.hoverEvent=null,this.dragStartConditions={angle:1/0,distance:1/0,slice:null,pie:null},this.isScrolling=!1,this.px=0,this.py=0,this.chart=i,this.scene=i.scene,this.events=i.events,this.scrolling=new t.Scrolling(i)}return n(i,e),i.prototype.doAnimations=function(t){this.hoverEvent&&this.onPointerMove(this.hoverEvent)},i.prototype.previewPointerDrag=function(t){this.hoverEvent=t},i.prototype.onPointerMove=function(t){this.hoverEvent=t,this.updateCurrentObject(t)},i.prototype.onPointerOut=function(t){this.updateCurrentObject(t),this.switchCurrentSlice(null,null,!1,t),this.hoverEvent=null},i.prototype.onPointerDown=function(t){this.handlePointerDown(t),this.scrolling.handlePointerDown(t)},i.prototype.handlePointerDown=function(t){this.updateCurrentObject(t);var e=this.currentSlice;(e||this.currentPie)&&(t.consumed=!0),this.px=t.x,this.py=t.y;var i=this.scene.settings.interaction.selection;if(i.swipe||i.partialSwipe){var n=this.scene.settings.interaction,s=this.scene.pies[0],r=s&&n.others.centerGoesToPrevious&&s.previousSlice,a=n.coverCenter&&!r&&(!s||!s.background),o=this.scene.findSliceAt(t.x,t.y,n.selection.tolerance,a);if(this.dragStartConditions.slice=null,this.dragStartConditions.pie=null,this.dragStartConditions.distance=1/0,this.dragStartConditions.angle=0,o&&null!==o.id){this.dragStartConditions.slice=e,this.dragStartConditions.pie=s;var l=t.x-s.x,h=t.y-s.y,u=Math.sqrt(l*l+h*h);this.dragStartConditions.distance=u-e.currentCutoutDistance,this.dragStartConditions.angle=180*Math.atan2(h,l)/Math.PI}}var c=this.scene.findLabelAt(t.x,t.y,this.scene.settings.interaction.selection.tolerance);this.draggedLabelSlice=c.slice,this.draggedLabel=c.label,this.draggedLabel=null,this.draggedLabelSlice=null},i.prototype.onPointerDrag=function(t){this.handlePointerDrag(t),this.scrolling.handlePointerDrag(t)},i.prototype.handlePointerDrag=function(t){var e=this.scene.settings.interaction.selection;if(!this.isScrolling){if(t.distance({x:this.px,y:this.py})<e.swipeSensitivity)return;this.isScrolling=!0}if((e.swipe||e.partialSwipe)&&(this.currentSlice||this.dragStartConditions.slice)){var i=this.dragStartConditions.slice;if(null!==i){var n=this.dragStartConditions.pie,s=this.dragStartConditions.distance,r=this.dragStartConditions.angle;r===1/0&&(r=180*Math.atan2(t.y-n.y,t.x-n.x)/Math.PI);var a=t.x-n.x,o=t.y-n.y,l=180*Math.atan2(o,a)/Math.PI,h=Math.abs(r-l);if(h<=90){var u=Math.sqrt(a*a+o*o);this.dragStartConditions.distance===1/0&&(s=u-i.currentCutoutDistance);var c=this.scene.innerRadius>=i.selectDistance/2?-i.selectDistance/2:0,d=u*Math.cos(h*Math.PI/180),p=d-s>e.maxSwipeDistance,f=d-s>c;i.userPlaced=!0,p?i.currentCutoutDistance=e.maxSwipeDistance:f&&(i.currentCutoutDistance=d-s>c?d-s|0:0),i.selection=i.currentCutoutDistance>0?i.currentCutoutDistance/e.maxSwipeDistance*100:0,t.changes.pie=!0}}}if(this.draggedLabel){var g=this.draggedLabel;g.userPlaced=!0,g.x+=t.dx,g.y+=t.dy,t.consumed=!0,t.changes.pie=!0}},i.prototype.onPointerUp=function(t){this.handlePointerUp(t),this.scrolling.handlePointerUp(t)},i.prototype.handlePointerUp=function(t){this.isScrolling=!1;var e=this.scene.settings.interaction.selection;if(e.swipe||e.partialSwipe){var i=this.dragStartConditions.slice;if(i){var n=i.currentCutoutDistance>=i.selectDistance/2&&!i.selected,s=i.currentCutoutDistance<i.selectDistance/2&&i.selected;e.swipe||i.currentCutoutDistance<=0&&e.partialSwipe?i.userPlaced=!1:e.partialSwipe&&(i.userPlaced=!0),s||n?this.updateSelection(t,i,!1):i.currentCutoutDistance>=i.selectDistance/2&&i.selected&&this.setSelection([i],[],!0)}}this.draggedLabel&&(this.draggedLabel=null,t.consumed=!0)},i.prototype.onPointerCancel=function(t){this.onPointerUp(t)},i.prototype.onClick=function(t){this.onPointerMove(t);var e=this.createClickArgs(t);if(("legend"!==e.clickOrigin||this.chart.settings.legend.interaction.click)&&(this.chart.notifyClick(t,this.createClickArgs(t)),(this.currentSlice||this.currentPie)&&(t.consumed=!0),t.defaultPrevented||this.updateSelection(t,this.currentSlice,!1)),t.touch){var i=t.x;t.x=1e9,this.onPointerOut(t),t.x=i}},i.prototype.onRightClick=function(t){this.onPointerMove(t),(this.currentSlice||this.currentPie)&&(t.consumed=!0),this.chart.notifyRightClick(t,this.createClickArgs(t)),t.defaultPrevented&&(t.consumed=!0)},i.prototype.onDoubleClick=function(t){this.onPointerMove(t),this.chart.notifyDoubleClick(t,this.createClickArgs(t)),t.consumed=!0},i.prototype.onTripleClick=function(t){this.onPointerMove(t),this.chart.notifyTripleClick(t,this.createClickArgs(t)),t.consumed=!0},i.prototype.createClickArgs=function(t){var e=this.chart.createEventArguments(t,"user"),i=e.hoverSlice;if(e.clickSlice=i,e.clickPie=i?i.pie:e.hoverPie,e.clickLabel=e.hoverLabel,i){
  51. var n=e.clickLabel;this.hoveringLegend?e.clickOrigin="legend":n?n===i.currentInsideLabel?e.clickOrigin="insideLabel":e.clickOrigin="label":e.clickOrigin="slice"}else this.scene.hoverBack&&(e.clickOrigin="back");return e},i.prototype.updateSelection=function(t,e,i){if(this.scene.settings.interaction.selection.enabled){var n=t.shiftKey,s="toggle"===this.scene.settings.interaction.mode||t.ctrlKey;e?n||i&&e.selected||s&&!e.selected?e.selected||(this.scene.selection.push(e),e.selected=!0,this.setSelection(this.scene.selection,this.scene.selectionIds,!0)):s&&e.selected?(d.Helpers.removeFromArray(this.scene.selection,e),e.selected=!1,this.setSelection(this.scene.selection,this.scene.selectionIds,!0)):!e.selected||this.scene.selection.length>1?this.setSelection([e]):this.setSelection([]):n||s||this.setSelection([])}},i.prototype.switchCurrentSlice=function(t,e,i,n){t===this.currentSlice&&e===this.currentLabel&&this.hoveringLegend===i||(n.changes.current=!0,this.scene.hoverSlice&&(this.scene.hoverSlice.active=!1),this.scene.hoverPie&&(this.scene.hoverPie.active=!1),this.scene.hoverSlice=t,this.scene.hoverPie=null,this.scene.hoverLabel=e,this.currentSlice=t,this.currentLabel=e,this.currentPie=null,this.hoveringLegend=i,t&&(t.active=!0),this.events.notifySceneChanges({pie:!0}),this.chart.notifyHoverChanged(n,this.chart.createEventArguments(n,"user")))},i.prototype.switchCurrentPie=function(t,e){t!==this.currentPie&&(e.changes.current=!0,this.scene.hoverSlice&&(this.scene.hoverSlice.active=!1),this.scene.hoverPie&&(this.scene.hoverPie.active=!1),this.scene.hoverPie=t,this.scene.hoverSlice=null,this.currentSlice=null,this.currentPie=t,this.hoveringLegend=!1,t&&(t.active=!0),this.events.notifySceneChanges({pie:!0}),this.chart.notifyHoverChanged(e,this.chart.createEventArguments(e,"user")))},i.prototype.onSceneChange=function(t){t.changes.pie&&this.updateSelectionIds()&&(this.events.notifySceneChanges({selection:!0}),this.chart.notifySelectionChanged(this.chart.createEventArguments(null,"api")))},i.prototype.updateSelectionIds=function(){for(var t=[],e=0;e<this.scene.selectionIds.length;e++)for(var i=this.scene.selectionIds[e],n=0;n<this.scene.pies.length;n++){var s=this.scene.pies[n];if(!s.background)for(var r=0;r<s.slices.length;r++){var a=s.slices[r];if(a.id===i){t.push(a);break}}}if(t.length>0)for(var r=0;r<t.length;r++){var a=t[r];a.selected||(a.selected=!0,this.scene.selection.push(a)),d.Helpers.removeFromArray(this.scene.selectionIds,a.id)}return t.length>0},i.prototype.setSelection=function(t,e,i,n){void 0===e&&(e=[]),void 0===i&&(i=!1),void 0===n&&(n="user"),this.scene.selectionIds=e;var s;if(i)s=!0;else{for(var r=0;r<this.scene.selection.length;r++){var a=this.scene.selection[r];t.indexOf(a)<0&&(a.selected=!1,s=!0)}for(var r=0;r<t.length;r++){var a=t[r];a.selected||(a.selected=!0,s=!0)}this.scene.selection=t}var o=this.updateSelectionIds();s=s||o,s&&(this.events.notifySceneChanges({selection:!0}),this.chart.notifySelectionChanged(this.chart.createEventArguments(null,n)))},i.prototype.updateCurrentObject=function(t){var e,i=this.scene,n=i.settings.interaction,s=i.findPieAt(t.x,t.y,n.selection.tolerance),r=s&&n.others.centerGoesToPrevious&&s.previousSlice,a=n.coverCenter&&!r&&(!s||!s.background),o=i.findLabelAt(t.x,t.y,n.selection.tolerance),l=!1;e=o.slice?o.slice:i.findSliceAt(t.x,t.y,n.selection.tolerance,a);var h=this.chart.legend;!e&&h&&(e=h.getLastHoveredSlice(),e&&(l=!0)),e&&(this.chart.settings.legend.interaction.click&&(t.cursor="pointer"),t.hovered=!0),this.switchCurrentSlice(e,o.label,l,t),s&&(s.background||r)&&!e?(t.cursor="pointer",t.hovered=!0,s.background?this.switchCurrentPie(s,t):(this.switchCurrentSlice(s.previousSlice,null,!1,t),this.switchCurrentPie(null,t)),i.hoverBack=!0):(this.switchCurrentPie(null,t),i.hoverBack=!1)},i}(d.ChartElement);t.Selection=w;var L=function(t){function e(e){t.call(this),this.animationOrder=100,this.paintOrder=25,this.updateOrder=900,this.chart=e,this.scene=e.scene}return n(e,t),e.needStyleUpdate=function(t){return t.settings||t.pie||t.selection||t.style},e.prototype.onSceneChange=function(t){if(e.needStyleUpdate(t.changes))for(var i=0;i<this.scene.pies.length;i++){var n=this.scene.pies[i];this.updatePie(n),this.computePieColors(n);for(var s=0;s<n.allSlices.length;s++){var r=n.allSlices[s];this.updateSlice(r,s)}}},e.prototype.updatePie=function(t){d.Helpers.extendStyleTo(this.scene.settings.pie.style,t),0===t.slices.length&&d.Helpers.extendStyleTo(this.scene.settings.pie.noDataStyle,t),t.background&&d.Helpers.extendStyleTo(this.scene.settings.pie.backgroundStyle,t),this.scene.hoverPie===t&&d.Helpers.extendStyleTo(this.scene.settings.pie.backgroundHoveredStyle,t),this.scene.settings.pie.styleFunction&&this.scene.settings.pie.styleFunction.call(this.chart.api,t,t.data)},e.prototype.computePieColors=function(t){for(var e=t.sliceColors,i=t.colorDistribution,n=0,s=0;s<t.slices.length;s++){var r=t.slices[s];r.removed||(n+=1)}if(1===n)return void(t.slices[0].fillColor=e[0]);if(1===e.length){var a=e[0];e=[a,d.Colors.blend(a,"#fff",.8)]}var o=e.length;if("gradient"===i)for(var l=0,s=0;s<t.slices.length;s++){var r=t.slices[s];if(!r.removed){var h=e[l*(o-1)|0],u=e[l*(o-1)+1|0],c=l*(o-1);c-=Math.floor(c);var a=d.Colors.blend(h,u,c,!1);r.fillColor=a,l+=1/(n-.9)}}else if("gradientProportional"===i)for(var l=0,s=0;s<t.slices.length;s++){var r=t.slices[s];if(!r.removed){var h=e[l*(o-1)|0],u=e[l*(o-1)+1|0],c=l*(o-1);c-=Math.floor(c);var a=d.Colors.blend(h,u,c,!1);r.fillColor=a,l+=r.fraction}}else for(var p=0;p<t.slices.length;p++){var r=t.slices[p];if(!r.removed){var a=e[(t.offset+p)%o],f=p/o|0;1===f?a=d.Colors.derive(a,1.5,1):f>=2&&(a=d.Colors.derive(a,.5,1)),r.fillColor=a}}},e.prototype.updateSlice=function(t,e){if(!t.removed){var i=t.pie,n=this.scene.settings.slice,s=n.styleFunction;t.expandable=this.scene.mainData.canExpand(t.id),d.Helpers.extendDeep(t,n.style),t===i.othersSlice?d.Helpers.extendDeep(t,n.othersStyle):t===i.previousSlice&&d.Helpers.extendDeep(t,n.previousStyle),i.total>0?t.percent=t.value/i.total*100:t.percent=0;var r=t.label;r.text?r.text+=" ":r.text="",t.data.name&&(r.text+=t.data.name+" "),r.text+=t.percent.toFixed(1)+"%",t.cutoutDistance=t.selected?t.selectDistance:0,this.scene.hoverSlice===t&&d.Helpers.extendDeep(t,n.hoverStyle),t.data.style&&d.SettingsHelper.updateRecursive(t,t.data.style,d.SettingsMapping.PieChartSettingsSliceStyle,{}),s&&(t._resetLabelText=!0,s.call(this.chart.api,t,t.data)),i.background&&(i.activeSliceId!==t.id?(d.Helpers.extendDeep(t,n.backgroundStyle),e%2===1&&(t.fillColor=t.fillColor2)):d.Helpers.extendDeep(t,n.backgroundActiveStyle));var a="rgba(255,255,255,0)";t.fillColor&&(a=t.fillColor);var o="rgba(255,255,255,0)";t.lineColor?o=t.lineColor:t.lineBrightness&&(o=d.Colors.derive(a,t.lineBrightness,1));var l=t.brightness*i.brightness;1!==l&&(a=d.Colors.derive(a,l,1),o=d.Colors.derive(o,l,1),a.indexOf("255,255,255")!==-1&&o.indexOf("255,255,255")!==-1&&(o="rgb(200,200,200)")),i.removed&&i.parentSlice?(t.targetFillColor=i.parentSlice.targetFillColor,t.targetLineColor=i.parentSlice.targetLineColor):(t.targetFillColor=d.Colors.normalize(a),t.targetLineColor=d.Colors.normalize(o))}},e}(d.ChartElement);t.Styles=L;var A=function(t){function e(e){t.call(this,e)}return n(e,t),e.prototype.createDom=function(e){t.prototype.createDom.call(this,e),this.backgroundImage.className+=" DVSL-PC-background-image",this.backgroundImage.style.display="none"},e.prototype.doAnimations=function(e){if(t.prototype.doAnimations.call(this,e),this.scene.settings.area.style.image&&this.scene.pies.length>0){var i=this.scene.currentInnerRadius-this.scene.settings.pie.margin,n=this.scene.pies[0].x,s=this.scene.pies[0].y;(0!==n||0!==s)&&i>0?(this.backgroundImage.style.left=Math.round(n-i)+"px",this.backgroundImage.style.top=Math.round(s-i)+"px",this.backgroundImage.style.width=Math.round(2*i)+"px",this.backgroundImage.style.height=Math.round(2*i)+"px",this.backgroundImage.style.display=""):this.backgroundImage.style.display="none"}},e}(d.DomLayer);t.DomLayer=A;var T=function(){function t(t){this.pie=null,this.chart=t,this.scene=t.scene,this.events=t.events}return t.prototype.handlePointerDown=function(t){this.scene.settings.interaction.scrolling.enabled&&(this.pointer||(this.pointer=t.identifier,this.pie=this.scene.peek()))},t.prototype.handlePointerDrag=function(t){this.pie&&this.scene.settings.interaction.scrolling.enabled&&(t.consumed=!0,t.identifier===this.pointer&&(this.pie.scrollOffset+=this.scene.view.getMovement(this.pie,t).dfraction,this.updatePieScrolling(this.pie),t.changes.pie=!0))},t.prototype.handlePointerUp=function(t){this.scene.settings.interaction.scrolling.enabled&&t.identifier===this.pointer&&(this.updatePieAfterScroll(this.pie),this.pie=null,this.pointer=null)},t.prototype.updatePieScrolling=function(t){if(t.scrollOffset>0&&0===t.offset&&(t.scrollOffset=0),0!==t.scrollOffset)return this.scene.view.updatePie(this.pie,!1)},t.prototype.updatePieAfterScroll=function(t){return t.scrollOffset=0,this.scene.view.updatePie(t,!0)},t}();t.Scrolling=T;var M=function(t){function e(e){t.call(this),this.animationOrder=250,this.paintOrder=30,this.updateOrder=650,this.chart=e,this.scene=e.scene,this.events=e.events}return n(e,t),e.prototype.onNewDataObject=function(){},e.prototype.setPie=function(t,e,i){Array.isArray(t)||(t=[t]),this.scene.pendingAction=null;for(var n=0;this.scene.length()>t.length;)this.scene.pop(),n++;for(;this.scene.length()>0&&this.scene.peek().id!==t[this.scene.length()-1];)this.scene.pop(),n++;for(;this.scene.length()<t.length;){var s=new g;s.id=t[this.scene.length()],s.offset=this.scene.length()+1===t.length?e:0,this.scene.push(s),this.scene.view.updatePie(s),n++}var r=this.scene.peek();r&&r.offset!==e?(this.scroll(r,e),n++):n&&r&&this.scene.view.updatePie(r),n&&(this.chart.notifyChartUpdate(i),this.events.notifySceneChanges({pie:!0}))},e.prototype.getPie=function(){return this.scene.stack.map(function(t){return t.id})},e.prototype.getPieOffset=function(){return this.scene.peek().offset},e.prototype.goBack=function(t){var e=this.scene.length();1===e?this.goPrevious(this.scene.peek(),t,0):e>1&&(this.scene.pop(),this.scene.pendingAction=null,this.updateAndNotifyCurrent(t))},e.prototype.goCenter=function(t){var e=this.scene.peek();e.offset>0&&this.scene.settings.interaction.others.centerGoesToPrevious?this.goPrevious(e,t):this.scene.length()>1&&(this.scene.pop(),this.scene.pendingAction=null,this.updateAndNotifyCurrent(t))},e.prototype.drillDown=function(t,e){this.scene.pendingAction=null;var i=new g;i.id=t,i.offset=0,this.scene.push(i),this.updateAndNotifyCurrent(e)},e.prototype.goOthers=function(t,e){var i=this.scene.view.scrollForward(t,t.offset+t.count);i||(this.scene.pendingAction="forward",this.scene.pendingOffset=null),this.events.notifySceneChanges({pie:!0}),this.chart.notifyChartUpdate(e)},e.prototype.goPrevious=function(t,e,i){if(void 0===i&&(i=null),!(t.offset<=0)){var n=this.scene.view.scrollBackward(t,i);n||(this.scene.pendingAction="back",this.scene.pendingOffset=null),this.chart.notifyChartUpdate(e),this.events.notifySceneChanges({pie:!0})}},e.prototype.scroll=function(t,e){var i=!0;t.offset>e?(i=this.scene.view.scrollBackward(t,e),i||(this.scene.pendingAction="back",this.scene.pendingOffset=e)):t.offset<e&&(i=this.scene.view.scrollForward(t,e),i||(this.scene.pendingAction="forward",this.scene.pendingOffset=e))},e.prototype.updateAndNotifyCurrent=function(t){var e=this.scene.peek();this.scene.view.updatePie(e),this.chart.notifyChartUpdate(t),this.events.notifySceneChanges({pie:!0})},e.prototype.expandSlice=function(t,e){var i=t.pie;if(i!==this.scene.peek())return this.chart.setSelection([]),this.goBack(e),!0;if(t===i.othersSlice)return this.chart.setSelection([]),this.goOthers(i,e),!0;if(t===i.previousSlice)return this.chart.setSelection([]),this.goPrevious(i,e),!0;var n=t.id;return!(!t.expandable||!this.scene.mainData.canExpand(n))&&(this.chart.setSelection([]),this.drillDown(n,e),!0)},e.prototype.onSceneChange=function(t){var e=!1,i=this.scene.peek();if(t.changes.data||t.changes.pieChartPieIds||t.changes.dataArrived)for(var n=t.changes.pieChartPieIds||Object.create(null),s=0;s<this.scene.stack.length;s++){var r=this.scene.stack[s];if(n[r.id]||!r.data||r===i||t.changes.dataDeep){if(r===i){var a=void 0;a="forward"===this.scene.pendingAction?this.scene.view.scrollForward(r,this.scene.pendingOffset):"back"===this.scene.pendingAction?this.scene.view.scrollBackward(r,this.scene.pendingOffset):this.scene.view.updatePie(r),a&&(this.scene.pendingAction=null,this.scene.pendingOffset=null),e=a}else this.scene.view.updatePie(r);t.changes.pie=!0}}e&&this.chart.notifyChartUpdate("data",!0)},e}(d.Navigator);t.Navigator=M;var k=function(t){function e(e){t.call(this),this.currentSlice=null,this.animationOrder=500,this.paintOrder=15,this.updateOrder=1100,this.activePointer=null,this.chart=e,this.scene=e.scene,this.options=this.scene.settings,this.events=e.events,this.popup=new d.InfoPopup(e)}return n(e,t),e.prototype.previewPointerMove=function(t){if(null===this.activePointer||this.activePointer===t.identifier){var e=t.y,i=t.x;if(this.options.info.enabled&&(!this.chart.legend||!this.chart.legend.containsCoordinate(i,e))){var n=this.scene.hoverSlice,s=this.scene.hoverPie;s&&!n&&(n=s.getActiveSlice()),this.setCurrentObject(i,e,n)}}},e.prototype.previewRightClick=function(t){t.touch&&(this.activePointer=t.identifier,this.previewPointerMove(t))},e.prototype.previewPointerCancel=function(t){null!==this.activePointer&&this.activePointer===t.identifier&&(this.activePointer=null)},e.prototype.previewPointerUp=function(t){null!==this.activePointer&&this.activePointer===t.identifier&&(this.activePointer=null)},e.prototype.previewPointerDown=function(t){null===this.activePointer&&(this.activePointer=t.identifier,this.hide())},e.prototype.previewPointerDrag=function(t){null!==this.activePointer&&this.activePointer!==t.identifier||this.hide()},e.prototype.previewPointerOut=function(t){null!==this.activePointer&&this.activePointer!==t.identifier||t.touch||this.hide()},e.prototype.hide=function(){this.activePointer=null,this.setCurrentObject(0,0,null)},e.prototype.setCurrentObject=function(t,e,i){if(i){if(i!==this.currentSlice){var n=this.buildContents(i);this.popup.show(t,t,e,n)}else this.popup.updateXY(t,t,e);this.currentSlice=i}else this.currentSlice=null,this.popup.hide()},e.prototype.buildContents=function(t){var e=this;if(this.options.info.contentsFunction){var i=function(i){if(t===e.currentSlice)return e.popup.updateContents(i)};return this.options.info.contentsFunction.call(this.chart.api,t.data,t,i)}return t.label.text},e}(d.ChartElement);t.InfoPopup=k;var P=function(){function t(t){this.prevTime=0,this.radiusAnimator=null,this.innerRadiusAnimator=null,this.chart=t,this.scene=t.scene,this.events=t.events}return t.prototype.doAnimations=function(t){var e=0;this.prevTime&&(e=Math.min(30,t.timeStamp-this.prevTime));var i=this.scene.settings.interaction.animation.scrollDuration,n=this.scene.settings.interaction.animation.hoverDuration,s=t.timeStamp,r=[],a=[],o=!1;if(this.scene.settings.pie.adaptiveRadius){this.innerRadiusAnimator||(this.innerRadiusAnimator=new d.Animator(0,this.scene.innerRadius,i,"<>",s),this.radiusAnimator=new d.Animator(0,this.scene.radius,i,"<>",s));var l=this.radiusAnimator.updateAndGet(this.scene.radius,s);this.scene.currentRadius=l.value;var h=l.changes;l=this.innerRadiusAnimator.updateAndGet(this.scene.innerRadius,s),this.scene.currentInnerRadius=l.value;var u=l.changes;o=o||h||u,t.animating=t.animating||o}else this.scene.currentRadius===this.scene.radius&&this.scene.currentInnerRadius===this.scene.innerRadius||(o=!0,this.scene.currentRadius=this.scene.radius,this.scene.currentInnerRadius=this.scene.innerRadius);for(var c=0;c<this.scene.pies.length;c++){var p=this.scene.pies[c],f=t.changes.bounds||L.needStyleUpdate(t.changes),g=!1;if(p.removed===!0&&null===p.removeTime&&(p.removeTime=s+i),p.removed&&(t.animating=!0,g=p.removeTime<s),g)r.push(p);else{if(p._animatorA0||(f=!0,p._animatorA0=new d.Animator(p.currentStartAngle,p.startAngle,i,"<>",s),p._animatorA1=new d.Animator(p.currentEndAngle,p.endAngle,i,"<>",s),p._animatorR0=new d.Animator(p.currentInnerRadius,p.innerRadius,i,"<>",s),p._animatorR1=new d.Animator(p.currentRadius,p.radius,i,"<>",s),this.scene.settings.advanced.initialAnimation||(p._animatorA0.jump(p.startAngle),p._animatorA1.jump(p.endAngle),p._animatorR0.jump(p.innerRadius),p._animatorR1.jump(p.radius))),p.rotationSpeed){if(null===p.currentStartAngle)p.currentStartAngle=p.startAngle,p.currentEndAngle=p.endAngle;else{var m=t.dtime*p.rotationSpeed/1e3;p.currentStartAngle+=m,p.currentEndAngle+=m}p.currentlyRotating=!0,f=!0}else if(p.currentlyRotating){var v=2*Math.PI;p._animatorA0.reset(p.currentStartAngle%v-v,p.startAngle,t.timeStamp),p._animatorA1.reset(p.currentEndAngle%v,p.endAngle,t.timeStamp),p.currentlyRotating=!1,f=!0}else{var y=p._animatorA0.updateAndGet(p.startAngle,s);p.currentStartAngle=y.value,f=f||y.changes;var S=p._animatorA1.updateAndGet(p.endAngle,s);p.currentEndAngle=S.value,f=f||S.changes}var b=p._animatorR1.updateAndGet(p.radius,s);p.currentRadius=b.value,f=f||b.changes,b=p._animatorR0.updateAndGet(p.innerRadius,s),p.currentInnerRadius=b.value,f=f||b.changes,p.currentInnerRadius=Math.min(p.currentInnerRadius,p.currentRadius);for(var C=[],x=0,w=0;w<p.allSlices.length;w++){var A=p.allSlices[w];A._animatorF||(f=!0,A._animatorF=new d.Animator(A.currentFraction,A.fraction,i,"<>",s));var T=A._animatorF.updateAndGetFixed(A.fraction,s);A.currentFraction=T.value,f=f||T.changes,A.removed&&0===A.currentFraction&&C.push(A),x+=A.currentFraction}if(Math.abs(x-1)>.001){x=1/x;for(var w=0;w<p.allSlices.length;w++){var A=p.allSlices[w];A.currentFraction*=x}}if(C.length>0){f=!0;for(var w=0;w<C.length;w++){var A=C[w];d.Helpers.removeFromArray(p.slices,A),d.Helpers.removeFromArray(p.allSlices,A),A===p.othersSlice&&(p.othersSlice=null),A===p.previousSlice&&(p.previousSlice=null)}}for(var w=0;w<p.allSlices.length;w++){var A=p.allSlices[w];A._animatorLineColor||(f=!0,A._animatorLineColor=new d.ColorAnimator(A.currentLineColor,A.targetLineColor,n,"<>",s),A._animatorFillColor=new d.ColorAnimator(A.currentFillColor,A.targetFillColor,n,"<>",s),A._animatorCutout=new d.Animator(A.currentCutoutDistance,A.cutoutDistance,n,"<>",s));var M=A._animatorLineColor,k=A._animatorFillColor,P=A._animatorCutout,I=M.updateAndGet(A.targetLineColor,s);if(A.currentLineColor=I.value,f=f||I.changes,I=k.updateAndGet(A.targetFillColor,s),A.currentFillColor=I.value,f=f||I.changes,A.userPlaced)P.jump(A.currentCutoutDistance);else{var l=P.updateAndGet(A.cutoutDistance,s);A.currentCutoutDistance=l.value,f=f||l.changes}}(f||o)&&a.push(p),t.animating=t.animating||f}}for(var c=0;c<r.length;c++){var p=r[c];this.scene.deletePie(p)}return this.prevTime=s,a},t}();t.Animations=P;var I=function(){function t(t,e){this.view=e,this.chart=t,this.scene=t.scene,this.events=t.events}return t.prototype.placeStack=function(t,e){var i=this.scene,n=i.settings,s=n.pie,r=i.stack,a=s.depth,o=!1,l=i.height-2*a;l=Math.max(2,l);var h=s.x,u=s.y;null===h?h=i.x0+i.width/2:h>=0&&h<=1&&(h=i.x0+i.width*h),null===u?u=i.y0+l/2:u>=0&&u<=1&&(u=i.y0+i.height*u);var c=n.pie.startAngle,d=n.pie.endAngle,p=n.pie.rotationSpeed;t.x===h&&t.y===u&&c===t.startAngle&&d===t.endAngle&&p===t.rotationSpeed||(o=!0,t.x=h,t.y=u,t.startAngle=c,t.endAngle=d,t.rotationSpeed=p);var f=Math.min(l/2,i.width/2);f-=n.pie.outerMargin;var g=n.pie.radius;if(g)g<=1&&(g=f*g);else if(n.labels.enabled&&n.pie.adaptiveRadius){var m=this.computeDesiredRadiusFromLabels(t,e);m=Math.min(f,m),m-=n.labels.connectorLength,m=Math.max(m,f/3),g=m}else g=f;var v=n.pie.innerRadius;if(v<1&&(v=g*v),r.length>1){var y=n.pie.innerRadiusWhenDrilldown;y<1&&(y=g*y),v=Math.max(v,y)}var S=0,b=0;g!==v&&(S=1/(g-v),b=-v*S),i.radius===g&&i.innerRadius===v||(o=!0,i.radius=g,i.innerRadius=v),t.radius=1,t.innerRadius=v*S+b;var C=r.length-1;if(C>0){v-=n.pie.margin;for(var x=C,w=Math.max(0,Math.min(g-v,(v-n.pie.centerMargin)/x)),L=C-1;L>=0;L--)g=v,v-=w,t=r[L],u+=a,t.x=h,t.y=u,t.radius=g*S+b,t.innerRadius=(v+n.pie.margin)*S+b,t.brightness=.8-.8*(x-L-1)/x,t.startAngle=n.pie.startAngle,t.endAngle=n.pie.endAngle}for(C=0;C<i.pies.length;C++)if(t=i.pies[C],t.removed&&t.parentSlice){var A=i.getSliceTargetAngles(t.parentSlice);t.startAngle=A.a0,t.endAngle=A.a1}return o},t.prototype.computeDesiredRadiusFromLabels=function(t,e){for(var i=this.scene.settings.slice.style.label,n=new D(e,1,0,100,0,100,i,this.scene.settings.labels),s=2*i.padding,r=n.lineHeight+s,a=0,o=0,l=0,h=0,u=0,c=t.startAngle,p=t.endAngle,f=p-c,g=t.startAngle,m=g,v=0;v<t.slices.length;v++){var y=t.slices[v],S=m;u=Math.min(1,u+y.fraction),m=g+u*f;var b=Math.max(S,c),C=Math.min(m,p);if(!(b>=p||C<=c)&&y.label.text){for(var x="",w=0,L=y.label.text.split(" ");w<L.length;w++){var A=L[w];A.length>x.length&&(x=A)}var T=d.Graphics.getTextWidth(e,y.label.textStyle,x)+s,M=d.Graphics.getTextWidth(e,y.label.textStyle,y.label.text)+s,k=r*M*1.2,P=((b+C)/2+Math.PI/2)%(2*Math.PI)<=Math.PI;P?(h+=k,o=Math.max(o,T)):(l+=k,a=Math.max(a,T))}}d.Graphics.clearShadow(e);var I=Math.min(this.scene.width,this.scene.height),F=this.scene.width*I,N=Math.max(1,F-2*Math.max(l,h)*1.2),E=Math.sqrt(N/Math.PI),z=Math.max(a,o),O=this.scene.width/2-1.1*z;return Math.min(E,O)},t.prototype.placeLabels=function(t,e){if(this.chart.assetsLoaded){var i=this.scene.settings.icons,n=this.scene.settings.labels,s=this.scene.settings.slice,r=n.enabled,a=i.sizeExtent[0],o=i.sizeExtent[1],l=i.placement,h=i.autohideWhenTooSmall;this.scene.settings.advanced.iconMinSize&&(a=this.scene.settings.advanced.iconMinSize);for(var u=s.margin,c=t.x,f=t.y,g=this.scene.currentInnerRadius,m=this.scene.currentRadius-g,v=t.currentInnerRadius*m+g,y=t.currentRadius*m+g,S=0,b=t.currentStartAngle,C=t.currentEndAngle,x=C-b,w=t.currentStartAngle,L=this.scene.x0-c,A=L+this.scene.width,T=this.scene.y0-f,M=T+this.scene.height,k=new D(e,y,L,A,T,M,s.style.insideLabel,this.scene.settings.labels),P=new D(e,y,L,A,T,M,s.style.label,this.scene.settings.labels),I=[],F=[],N=w,E=0;E<t.allSlices.length;E++){var z=t.allSlices[E],O=N;S=Math.min(1,S+z.currentFraction),N=w+S*x;var H=Math.max(O,b),_=Math.min(N,C),R=v+z.currentCutoutDistance,B=y+z.currentCutoutDistance,U=(H+_)/2;if(z.removed||t.background)z.currentLabel=null,z.currentInsideLabel=null;else{if(z.insideLabel.text&&r){var V=z.insideLabel.text,G=void 0;G=z.currentInsideLabel?z.currentInsideLabel:z.currentInsideLabel=new d.Label(z.insideLabel,!0),z.currentInsideLabel.text!==V&&(G.text=V);var W=k.fitLabelInSlice(e,G,R,B,H,_);G.shouldBeVisible=G.visible="always"===n.insideLabel||W>=n.insideLabelVisibilityFraction}else z.currentInsideLabel=null;var j=z.label.text&&r?z.label.text:"";if("append"===n.insideLabel&&z.insideLabel.text&&r&&!z.currentInsideLabel.userPlaced&&!z.currentInsideLabel.shouldBeVisible&&(j?(c=Math.cos(U),j=c>0?z.insideLabel.text+", "+j:j+", "+z.insideLabel.text):j=z.insideLabel.text),j){var G=null;G=z.currentLabel?z.currentLabel:z.currentLabel=new d.Label(z.label,!0),z.currentLabel.text!==j&&(G.text=j),G.userPlaced||P.placeOutsideLabelInitial(G,U),G.x>0?(G.style.align="left",F.push(G)):(G.style.align="right",I.push(G))}else z.currentLabel=null}var Y=null;if(z.icon&&(!t.background||z.id===t.activeSliceId)){var q=k.fitBoxInSlice(1,1,R,B,H,_);c=q.x,f=q.y;var Z=q.prop;Z-=u,(!h||2*Z>=a)&&(Z=Math.max(Math.min(Z,o/2),a/2),Y=new p,Y.hwidth=Z,Y.hheight=Z,Y.inside=!0,z.iconOffset?(Y.x=0,Y.y=0,this.applyOffset(Y,z.iconOffset,R,B,H,_)):"center"===l?(Y.x=0,Y.y=0,this.applyOffset(Y,[0,0,0,0],R,B,H,_)):(Y.x=c,Y.y=f))}z.currentIcon=Y}P.computeOutsideLabelLocations(e,I,F)}},t.prototype.applyOffset=function(t,e,i,n,s,r){var a=0,o=0;e.length>=2&&(a=e[0],o=e[1]);var l=0,h=0;e.length>=4&&(l=e[2],h=e[3]);var u=i+(n-i)*(l+1)/2,c=s+(r-s)*(h+1)/2;a+=Math.cos(c)*u,o+=Math.sin(c)*u,t.x+=a,t.y+=o},t}();t.PieLayout=I;var D=function(t){function e(e,i,n,s,r,a,o,l){t.call(this),this.config=l,this.bottom=a,this.top=r,this.right=s,this.left=n,this.margin=o.margin||0,this.rr=i+l.connectorLength,this.lineHeight=d.Graphics.getTextHeight(e,o.textStyle.font),this.interLabelSpacing=Math.max(l.interLabelSpacing*this.lineHeight,this.margin)}return n(e,t),e.prototype.placeOutsideLabelInitial=function(t,e){var i=this.rr*Math.cos(e),n=this.rr*Math.sin(e),s=1;n<this.top&&(s=Math.min(s,this.top/n)),n>this.bottom&&(s=Math.min(s,this.bottom/n)),i<this.left&&(s=Math.min(s,this.left/i)),i>this.right&&(s=Math.min(s,this.right/i)),t.x=i*s,t.y=n*s},e.prototype.computeOutsideLabelLocations=function(t,e,i){var n=this.bottom-this.margin,s=this.top+this.margin,r=this.interLabelSpacing;e.sort(function(t,e){return e.y-t.y}),i.sort(function(t,e){return t.y-e.y});for(var a=0;a<e.length;a++){var o=e[a];o.originX=o.x}for(var a=0;a<i.length;a++){var o=i[a];o.originX=o.x}for(var l="wrap"===this.config.placement?[!1]:[!0,!1],h=0;h<l.length;h++){for(var u=l[h],c=100,d=!1,p=0;p<2;p++){for(var f=0===p?e:i,a=0;a<f.length;a++){var o=f[a];o.prop=this.fitLabelOutside(t,o,u)}for(var g=n-s,m=[],v=0,a=0;a<f.length;a++){var o=f[a];if(o.visible){var y=2*o.hheight+r;v+y<g?(m.push(o),v+=y):(o.visible=o.userPlaced,c=.5)}}var S=n,b=s;f===e?b+=v:S-=v;for(var a=0;a<m.length;a++){var o=m[a];if(f===e?b-=2*o.hheight+r:S+=2*o.hheight+r,!o.userPlaced&&(o.y+o.hheight>S||o.y-o.hheight<b)){o.y=Math.min(Math.max(o.y,b+o.hheight),S-o.hheight);var C=this.fitLabelOutside(t,o,u);c=Math.min(C,c),d=d||o.rows&&o.rows.subLines[o.rows.subLines.length-1].row>0}else c=Math.min(c,o.prop);f===e?S=o.y-o.hheight-r:b=o.y+o.hheight+r}}if(c>=1||!d)break}},e.prototype.fitLabelOutside=function(t,e,i){var n=this;void 0===i&&(i=!1),null==i&&(i=!1);var s=function(t){return e.userPlaced?n.getOutsideMaxWidth(e.x,e.y,t,!1):n.placeOutsideMaxWidth(e.originX,e.y,t,i)};return this.fitLabelInRect(t,e,s)},e.prototype.fitLabelInSlice=function(t,e,i,n,s,r){var a,o=this,l=Math.cos(s),h=Math.cos(r),u=Math.min(l,h),c=Math.max(l,h);a=u<0&&c<0||-u>2*c?"right":u>0&&c>0||2*-u<c?"left":"center";var d,p;if(e.userPlaced)d=e.x,p=e.y;else{var f=void 0;f=2*i>=n?.5:.5+(n-2*i)/n/4;var g=i+(n-i)*f,m=(s+r)/2,v=Math.cos(m),y=Math.sin(m);d=g*v,p=g*y}var S=p-this.rayIntersectsSlice(d,p,0,-1,i,n,s,r),b=p+this.rayIntersectsSlice(d,p,0,1,i,n,s,r),C=function(t,e){if(!(n>0)||e<=S||e>=b)return[1e-5,1e-5];var a=o.rayIntersectsSlice(t,e,-1,0,i,n,s,r),l=o.rayIntersectsSlice(t,e,1,0,i,n,s,r);return[a,l]};return this.fitLabelInLines(t,e,d,p,"center",a,C)},e.prototype.placeOutsideMaxWidth=function(t,e,i,n){var s=this.rr,r=e-i/2,a=r+i;if(r<this.top){var o=this.top-r;r+=o,a+=o}if(a>this.bottom){var o=this.bottom-a;r+=o,a+=o}var l,h=this.left,u=this.right;return l=n?s:r>s||a<-s?0:r>0?Math.sqrt(s*s-r*r):a<0?Math.sqrt(s*s-a*a):s,t>0?h=Math.max(l,t):u=Math.min(t,-l),{x:(h+u)/2,y:(r+a)/2,dx:1,dy:0,width:u-h}},e.prototype.getOutsideMaxWidth=function(t,e,i,n){var s,r=e-i/2,a=r+i,o=this.left,l=this.right,h=this.rr;s=n?h:r>h||a<-h?0:r>0?Math.sqrt(h*h-r*r):a<0?Math.sqrt(h*h-a*a):h,t>0?o=s:l=-s;var u=Math.min(Math.abs(t-o),Math.abs(t-l));return{x:t,y:e,dx:1,dy:0,width:2*u}},e.prototype.fitBoxInSlice=function(t,e,i,n,s,r){var a=.5+(n-i)/n/4,o=i+(n-i)*a,l=(s+r)/2,h=Math.cos(l),u=Math.sin(l),c=o*h,d=o*u,p=t,f=e,g=this.rayIntersectsSlice(c,d,p,f,i,n,s,r),m=this.rayIntersectsSlice(c,d,-p,f,i,n,s,r),v=this.rayIntersectsSlice(c,d,-p,-f,i,n,s,r),y=this.rayIntersectsSlice(c,d,p,-f,i,n,s,r),S=Math.min(g,m,v,y);return{x:c,y:d,prop:S}},e.prototype.rayIntersectsSlice=function(t,e,i,n,s,r,a,o){var l=d.Geometry.rayIntersectsCircle(t,e,i,n,s);l=Math.min(l,d.Geometry.rayIntersectsCircle(t,e,i,n,r));var h=Math.cos(a),u=Math.sin(a);return l=Math.min(l,d.Geometry.rayIntersectsSegment(t,e,i,n,s*h,s*u,r*h,r*u)),h=Math.cos(o),u=Math.sin(o),l=Math.min(l,d.Geometry.rayIntersectsSegment(t,e,i,n,s*h,s*u,r*h,r*u))},e}(d.LabelLayoutBase);t.LabelLayout=D,function(t){var e=function(){function t(t){this.renderer=t,this.settings=this.renderer.settings}return t.prototype.paintPie=function(t,e,i,n,s,r,a,o){o.fillColor&&(t.beginPath(),t.arc(e,i,s,r,a,!1),t.arc(e,i,n,a,r,!0),t.closePath(),d.Graphics.fill(t,o))},t.prototype.paintExpandableHilights=function(t,e,i,n){var s=this.settings.slice.expandableMarkStyle.distance,r=this.settings.slice.expandableMarkStyle;if(!(r.lineWidth<=0))for(var a=0;a<n.length;a++){var o=n[a];if(o.expandable){var l=o._renderParams,h=e+o.x,u=i+o.y,c=l[0],p=l[1],f=Math.max((c+p)/2,p-s),g=l[2],m=l[3];t.beginPath(),t.arc(h,u,f,g,m),d.Graphics.paint(t,r)}}},t.prototype.strokeSlice=function(t,e,i,n){var s=n._renderParams;e+=n.x,i+=n.y;var r=s[0],a=s[1],o=s[2],l=s[3],h=s[4],u=s[5],c=a*Math.abs(l-o),d=a-r,p=Math.min(.1*Math.min(c,d),3);r+a===-2&&(r=0,a=0),t.beginPath(),"zigzag"===n.lineDecoration?this.strokeZigZag(t,e,i,a,p,o,l):t.arc(e,i,a,o,l,!1),h===u?t.lineTo(e+Math.cos(u)*r,i+Math.sin(h)*r):t.arc(e,i,r,u,h,!0),t.closePath()},t.prototype.strokeZigZag=function(t,e,i,n,s,r,a){var o=5/n,l=r;for(t.moveTo(e+n*Math.cos(r),i+n*Math.sin(r));l+o<a;)l+=o,t.lineTo(e+(n+s)*Math.cos(l),i+(n+s)*Math.sin(l)),s=-s;t.lineTo(e+n*Math.cos(a),i+n*Math.sin(a))},t.prototype.strokeAndPaint=function(t,e,i,n){var s=d.Graphics.beginStrokeAndFill(t,n);this.strokeSlice(s,e,i,n),d.Graphics.endStrokeAndFill(t,s,n)},t}();t.CommonBase=e;var i=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.paintSlices=function(t,e,i,n){for(var s=0;s<n.length;s++){var r=n[s];this.strokeAndPaint(t,e,i,r)}},e}(e);t.Flat=i;var s=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.paintPie=function(e,i,n,s,r,a,o,l){t.prototype.paintPie.call(this,e,i,n,s,r,a,o,l);var h=this.settings.pie.depth;if(h>0&&l.allSlices.length>0){e.fillStyle="rgba(0,0,0,0.05)";for(var u=0;u<[5,10,18].length;u++){var c=[5,10,18][u];e.beginPath(),e.arc(i,n+c+h,r,a,o,!1),e.arc(i,n+c+h,s,o,a,!0),e.closePath(),e.fill()}}},e.prototype.paintSlices=function(t,e,i,n){var s=this.settings.pie.depth,r=2*this.settings.advanced.renderQuality,a=1/r,o=s*r;t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=1.5*s,t.shadowColor="black",t.fillStyle="black";for(var l=0;l<n.length;l++){var h=n[l];this.strokeSlice(t,e,i+s,h),t.fill()}t.shadowColor=null,t.shadowBlur=0,t.lineWidth=1;for(var u=0;u<=o;u++)for(var l=0;l<n.length;l++){var h=n[l];h.fillColor instanceof CanvasGradient?d.Helpers.error("slice.fillColor cannot be gradient if `can` renderer is used"):(this.strokeSlice(t,e,i+s-u*a,h),u>=o-1?t.strokeStyle=d.Colors.derive(h.fillColor,1.35,1):t.strokeStyle=d.Colors.derive(h.fillColor,.5+u/o*.2,1),t.stroke())}var c=Math.PI;t.shadowBlur=s,t.shadowColor="rgba(0,0,0,0.1)",t.fillStyle="black";for(var l=0;l<n.length;l++){var h=n[l],p=h._renderParams,f=p[4],g=p[5];if(f!==g){for(;f>c;)f-=2*c,g-=2*c;f<0?g>0&&(g=Math.min(g,c),this.strokeInnerShadowSlice(t,e,i,h,0,g)&&t.fill()):g<c?this.strokeInnerShadowSlice(t,e,i,h,f,g)&&t.fill():(f<c&&this.strokeInnerShadowSlice(t,e,i,h,f,c)&&t.fill(),g>2*c&&this.strokeInnerShadowSlice(t,e,i,h,2*c,g)&&t.fill())}}for(var l=0;l<n.length;l++){var h=n[l];this.strokeAndPaint(t,e,i,h)}},e.prototype.strokeInnerShadowSlice=function(t,e,i,n,s,r){var a=n._renderParams,o=a[0]+1,l=Math.min(a[1]-1,o+10);return!(o>=a[1]||l<=a[0])&&(s+=1/o,r-=1/o,s>=r?void 0:(t.beginPath(),t.arc(e,i,l,s,r,!1),t.arc(e,i,o,r,s,!0),t.closePath(),!0))},e}(e);t.Can=s;var r=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.paintSlices=function(t,e,i,n){this.g=t;for(var s=0;s<n.length;s++){var r=n[s];this.strokeAndPaint(t,e,i,r),this.elegantGradient(e,i,r)}},e.prototype.getRadialGradient=function(t,e,i,n,s,r,a){var o=Math.abs(Math.sin(a)),l=this.g.createRadialGradient(t,e,i,n,s,r);return this.addColorStops(l,o,a),l},e.prototype.getLinearGradient=function(t,e,i,n,s,r,a,o){var l=a-n,h=Math.sin(o),u=Math.cos(o),c=e+u*n,d=i+h*n,p=c+u*l,f=d+h*l,g=Math.abs(h),m=this.g.createLinearGradient(c,d,p,f);return this.addColorStops(m,g,o),m},e.prototype.addColorStops=function(t,e,i){var n="0,0,0",s="255,255,255",r=s,a=n;(i<=0||i>Math.PI)&&(r=n,
  52. a=s);var o=.4*e,l=.2*e,h=.1*e,u=.3*e,c=.5*e;t.addColorStop(0,"rgba("+r+","+o.toFixed(3)+")"),t.addColorStop(.1,"rgba("+r+","+l.toFixed(3)+")"),t.addColorStop(.1,"rgba("+r+","+h.toFixed(3)+")"),t.addColorStop(.4,"rgba("+n+",0.1)"),t.addColorStop(.9,"rgba("+a+","+h.toFixed(3)+")"),t.addColorStop(.95,"rgba("+a+","+u.toFixed(3)+")"),t.addColorStop(1,"rgba("+a+","+c.toFixed(3)+")")},e.prototype.elegantGradient=function(t,e,i){for(var n=i._renderParams[0],s=i._renderParams[1],r=i._renderParams[2],a=i._renderParams[3],o=this.settings.advanced.renderQuality,l=Math.PI/Math.max(1,180*o),h=r;h<a;){var u=Math.min(h+l,a);this.g.beginPath(),this.g.arc(t,e,s,h,u),this.g.arc(t,e,n,u,h,!0),this.g.closePath(),d.Graphics.paint(this.g,{fillColor:this.getRadialGradient(t,e,n,t,e,s,h)}),h=u}},e}(e);t.Smoothy=r;var a=function(t){function e(){t.apply(this,arguments)}return n(e,t),e.prototype.paintSlices=function(t,e,i,n){this.g=t;for(var s=0;s<n.length;s++){var r=n[s];this.strokeAndPaint(t,e,i,r),this.smartGradient(e,i,r)}},e.prototype.getSmartGradient=function(t,e,i,n,s,r){var a,o,l=0,h=0,u=0,c=0;"inside"===s?"top"===r?(u=n-i,c=e,a="rgba(0,0,0,0.3)",o="rgba(0,0,0,0)"):(u=e,c=e+i,a="rgba(255,255,255,0)",o="rgba(255,255,255,0.3)"):"top"===r?(c=e,a="rgba(255,255,255,0.3)",o="rgba(255,255,255,0)"):(u=e,c=e+n,a="rgba(0,0,0,0)",o="rgba(0,0,0,0.3)");try{var d=this.g.createLinearGradient(l,u,h,c);return d.addColorStop(0,a),d.addColorStop(1,o),d}catch(t){throw"Could not create linear gradient: "+t}},e.prototype.smartOuterShineTop=function(t,e,i,n,s,r,a,o){if(!(s>0&&r<Math.PI)){r>0&&s<0&&(r=0,o=0),s>0&&s<Math.PI&&(s=Math.PI,a=Math.PI);var l={_renderParams:[n-.1*(n-i),n,s,r,a,o,null,null],x:0,y:0,fillColor:this.getSmartGradient(t,e,i,n,"outside","top")};this.strokeAndPaint(this.g,t,e,l)}},e.prototype.smartOuterShineBottom=function(t,e,i,n,s,r,a,o){if(!(r<0||s>Math.PI)){s<0&&(s=0,a=0),r>Math.PI&&(r=Math.PI,o=Math.PI);var l={_renderParams:[n-.1*(n-i),n,s,r,a,o,null,null],x:0,y:0,fillColor:this.getSmartGradient(t,e,i,n,"outside","bottom")};this.strokeAndPaint(this.g,t,e,l)}},e.prototype.smartInnerShineTop=function(t,e,i,n,s,r,a,o){if(!(s>0&&r<Math.PI)){r>0&&s<0&&(r=0,o=0),s>0&&s<Math.PI&&(s=Math.PI,a=Math.PI);var l={_renderParams:[i,i+.1*(n-i),s,r,a,o,null,null],x:0,y:0,fillColor:this.getSmartGradient(t,e,i,n,"inside","top")};this.strokeAndPaint(this.g,t,e,l)}},e.prototype.smartInnerShineBottom=function(t,e,i,n,s,r,a,o){if(!(r<0||s>Math.PI)){s<0&&(s=0,a=0),r>Math.PI&&(r=Math.PI,o=Math.PI);var l={_renderParams:[i,i+.1*(n-i),s,r,a,o,null,null],x:0,y:0,fillColor:this.getSmartGradient(t,e,i,n,"inside","bottom")};this.strokeAndPaint(this.g,t,e,l)}},e.prototype.smartGradient=function(t,e,i){t+=i.x,e+=i.y;var n=i._renderParams[0],s=i._renderParams[1],r=i._renderParams[2],a=i._renderParams[3],o=i._renderParams[4],l=i._renderParams[5];this.smartOuterShineTop(t,e,n,s,r,a,o,l),this.smartOuterShineBottom(t,e,n,s,r,a,o,l),this.smartInnerShineTop(t,e,n,s,r,a,o,l),this.smartInnerShineBottom(t,e,n,s,r,a,o,l)},e}(e);t.Bevel=a}(e);var F=function(){function t(t){this.renderer=null,this.chart=t,this.settings=t.settings,this.scene=t.scene}return t.prototype.onSceneChange=function(t){t.changes.settings&&this.buildSeries()},t.prototype.buildSeries=function(){var t=this.settings.pie.theme,i=t.charAt(0).toUpperCase()+t.slice(1);try{this.renderer=new e[i](this)}catch(e){throw"Renderer "+t+" is not available: "+e}},t.prototype.paintScene=function(t){for(var e=t.context,i=t.labelRenderer,n=t.isExport?this.settings.pie.showInnerPiesExport:this.settings.pie.showInnerPies,s=!1,r=0;r<this.scene.pies.length;r++){var a=this.scene.pies[r];!n&&a.background||this.paintPie(e,i,a),s=s||a.background}!t.isExport&&(this.scene.hoverBack||this.scene.settings.advanced.backAlwaysVisible&&s)&&this.paintBackArrow(t)},t.prototype.paintBackArrow=function(t){var e=this.scene.assetsLoader.getAssetImage(this.scene.settings.advanced.backImage);if(e){var i=this.scene.pies[this.scene.pies.length-1],n=.707106781186547,s=i.x,r=i.y,a=this.settings.pie.depth;r+=(this.scene.pies.length-1)*a;var o=e.width/2,l=e.height/2,h=i.innerRadius*n,u=Math.min(o,Math.max(h,o/2))/o,c=Math.min(l,Math.max(h,l/2))/l,p=Math.min(u,c),f=t.context;if(this.settings.advanced.backImageBackground){var g=this.settings.slice.margin,m=this.scene.currentInnerRadius,v=this.scene.currentRadius-m,y=Math.max(this.scene.pies[0].currentInnerRadius*v+m,g/2);f.beginPath(),f.arc(s,r,y,0,2*Math.PI),f.closePath(),f.fillStyle=this.settings.advanced.backImageBackground,f.fill()}f.globalAlpha=.5,d.Graphics.drawImageHighQuality(f,e,s-o*p,r-l*p,2*o*p,2*l*p),f.globalAlpha=1}},t.prototype.paintPie=function(t,e,i){var n=this.settings.slice.margin;i.allSlices.length<2&&(n=0);var s=this.scene.currentInnerRadius,r=this.scene.currentRadius-s,a=Math.max(i.currentInnerRadius*r+s,n/2),o=i.currentRadius*r+s,l=i.currentStartAngle,h=i.currentEndAngle,u=h-l,c=l;if(o>0&&u>0){for(var p=a>0?1/a:0,f=1/o,g=n/2*p,m=n/2*f,v=[],y=0;y<i.allSlices.length;y++){var S=i.allSlices[y],b=S.currentFraction*u;if(!(S.currentFraction<=0)){var C=c;c+=b;var x=a+S.currentCutoutDistance,w=o+S.currentCutoutDistance,L=void 0,A=void 0;if(b<=4*m){var T=(C+c)/2,M=b/4;L=T-M,A=T+M}else L=C+m,A=c-m;var k=C+g,P=c-g;k>P&&(k=P=(k+P)/2),A<l||L>h||(L=Math.max(L,l),A=Math.min(A,h),k=Math.max(k,l),P=Math.min(P,h),k>P&&(k=P=(k+P)/2),S._renderParams=[x,w,L,A,k,P,S.fillColor,S.lineColor],S.fillColor=S.currentFillColor,S.lineColor=S.currentLineColor,v.push(S))}}var I=i.x,D=i.y;this.renderer.paintPie(t,I,D,a,o,i.currentStartAngle,i.currentEndAngle,i),this.renderer.paintSlices(t,I,D,v),i===this.scene.peek()&&this.renderer.paintExpandableHilights(t,I,D,v);for(var F=0;F<v.length;F++){var N=v[F];N.fillColor=N._renderParams[6],N.lineColor=N._renderParams[7]}if(!i.removed){d.Graphics.clearShadow(t);for(var y=0;y<i.allSlices.length;y++){var S=i.allSlices[y];if(S.currentIcon){var E=this.scene.assetsLoader.getAssetImage(S.icon);if(E){var z=S.currentIcon,O=I+z.x,H=D+z.y,_=Math.min(E.width/2,z.hwidth),R=Math.min(E.height/2,z.hheight);d.Graphics.drawImageHighQuality(t,E,O-_,H-R,2*_,2*R)}}}c=l;for(var y=0;y<i.allSlices.length;y++){var S=i.allSlices[y],b=S.currentFraction*u,C=c;c=C+b;var B=Math.max(C,l),U=Math.min(c,h),V=(B+U)/2,G=S===this.scene.hoverSlice,W=o+S.currentCutoutDistance;S.currentInsideLabel&&S.currentInsideLabel.visible&&this.paintLabel(t,e,I,D,W,V,S.currentInsideLabel,G),S.currentLabel&&S.currentLabel.visible&&this.paintLabel(t,e,I,D,W,V,S.currentLabel,G)}}}},t.prototype.paintLabel=function(t,e,i,n,s,r,a,o){var l,h,u=this.scene.y0+3,c=u+this.scene.height-6,p=this.settings.labels,f=a.x,g=a.y,m=a.hwidth,v=s+p.connectorLength;if(f<0?(l=f+m,h=g):f>=0&&(l=f-m,h=g),p.connectors&&l*l+h*h>s*s){var y=Math.sin(r),S=Math.cos(r);t.beginPath();var b=i+s*S,C=n+s*y;t.moveTo(b,C);var x=i+v*S,w=n+v*y;w=Math.min(Math.max(w,u),c),l+=i,h+=n,h=Math.min(Math.max(h,u),c);var L=(s+v)/2,A=d.Geometry.rayIntersectsCircle(l-i,h-n,b-l,C-h,s),T=d.Geometry.lineTouchingCircle(l-i,h-n,x-i,w-n,v);if(A<.9&&T){for(var M=T.x,k=T.y,P=Math.atan2(k,M);P-r>Math.PI;)P-=2*Math.PI;for(;P-r<-Math.PI;)P+=2*Math.PI;var I=P-r;M+=i,k+=n,x=i+L*S,w=n+L*y,w=Math.min(Math.max(w,u),c);var D=i+L*Math.cos(r+.2*I),F=n+L*Math.sin(r+.2*I);F=Math.min(Math.max(F,u),c),t.quadraticCurveTo(x,w,D,F);var N=i+v*Math.cos(P),E=n+v*Math.sin(P);E=Math.min(Math.max(E,u),c),d.Graphics.arcBetweenTwoPoints(t,i,n,L,D,F,N,E),t.lineTo(l,h)}else t.quadraticCurveTo(x,w,l,h);var z=this.settings.slice.connectorStyle,O=z.lineWidth;o&&(z.lineWidth+=2),d.Graphics.stroke(t,z),z.lineWidth=O}e.paint(t,i+a.x,n+a.y,1,a),d.Graphics.clearShadow(t)},t}();t.PieRenderer=F;var N=function(){function t(t){this.chart=t,this.scene=t.scene}return t.prototype.updatePie=function(t,e){var i=this.getPieData(t);this.rectifyScrollOffsets(t,i);var n=this.getForwardCount(t.id,i,t.offset),s=n.numberOfSlices,r=n.isReady;if(t.data=i,t.loading=!r,r){var a=this.buildSlices(t,t.offset,s),o=a.slices,l=a.othersSlice,h=a.previousSlice;this.applyNewSlices(t,o,l,h,e)}return r},t.prototype.scrollForward=function(t,e){var i=this.getPieData(t);t.data=i;var n,s=!0;if(null===e||void 0===e){var r=this.getForwardCount(t.id,i,t.offset);n=r.numberOfSlices,s=r.isReady,e=t.offset+n}if(s){var r=this.getForwardCount(t.id,i,e);n=r.numberOfSlices,s=r.isReady}if(s){var a=this.buildSlices(t,e,n),o=a.slices,l=a.othersSlice,h=a.previousSlice;if(t.othersSlice){var u=Math.min(o.length,Math.max(0,t.offset+t.count-e));this.fitSlicesInOrigin(t.othersSlice,o.slice(u),l),l||(l=t.othersSlice,l.fraction=0,l.currentFraction=0,l.removed=!0)}return t.offset=e,this.applyNewSlices(t,o,l,h),t.loading=!1,!0}return t.loading=!0,!1},t.prototype.scrollBackward=function(t,e){var i=this.getPieData(t);t.data=i;var n=!0,s=0;if(i&&i.done&&t.offset>i.offset+i.values.length&&(t.offset=i.offset+i.values.length),null==e){var r=this.getBackOffset(t.id,i,t.offset);if(e=r.newOffset,n=r.isReady)do{e+=s;var a=this.getForwardCount(t.id,i,e);s=a.numberOfSlices,n=a.isReady}while(n&&e+s<t.offset)}else{var a=this.getForwardCount(t.id,i,e);s=a.numberOfSlices,n=a.isReady}if(n){var o=this.buildSlices(t,e,s),l=o.slices,h=o.othersSlice,u=o.previousSlice;if(t.previousSlice){var c=Math.min(l.length,Math.max(0,t.offset-e));this.fitSlicesInOrigin(t.previousSlice,l.slice(0,c),u),u||(u=t.previousSlice,u.fraction=0,u.currentFraction=0,u.removed=!0)}return t.offset=e,this.applyNewSlices(t,l,h,u),t.loading=!1,!0}return t.loading=!0,!1},t.prototype.fitSlicesInOrigin=function(t,e,i){for(var n=Math.max(1e-6,t.currentFraction),s=0,r=0;r<e.length;r++){var a=e[r];s+=a.fraction}i&&(s+=i.fraction);for(var o=n/s,r=0;r<e.length;r++){var a=e[r];a.currentFraction=a.fraction*o,a.currentFillColor=t.currentFillColor,a.currentLineColor=t.currentLineColor}i&&(i.currentFraction=i.fraction*o,i.currentFillColor=t.currentFillColor,i.currentLineColor=t.currentLineColor)},t.prototype.rectifyScrollOffsets=function(t,e){if(null==e)return void(t.scrollOffset=0);var i,n=t.offset;if(t.scrollOffset<0){for(0===n&&(t.scrollOffset-=this.scene.settings.interaction.others.navigationFraction);t.scrollOffset<0&&n-e.offset<e.values.length;)i=e.values[n-e.offset],t.scrollOffset+=i.fraction/t.visibleFraction,n++;var s=this.scene.settings.interaction.others.maxSlicesVisible+1;n+s>e.values.length&&(t.scrollOffset=0,n=Math.max(e.values.length-s,0))}else if(t.scrollOffset>0){var r=0;for(1===n&&(r=this.scene.settings.interaction.others.navigationFraction);n>0&&t.scrollOffset+r>e.values[n-e.offset-1].fraction/t.visibleFraction;)i=e.values[n-e.offset-1],t.scrollOffset-=i.fraction/t.visibleFraction,n--;0===n&&(t.scrollOffset=0)}t.offset=n},t.prototype.getForwardCount=function(t,e,i){if(!e||e.offset>i||e.offset+e.values.length<=i)return!e||!e.done||e.offset>i?(this.scene.mainData.requestPieData(t,i),{numberOfSlices:0,isReady:!1}):{numberOfSlices:0,isReady:!0};var n=e.offset,s=n+e.values.length,r=this.scene.settings.interaction.others,a=r.minSliceFraction,o=r.maxOthersFraction,l=r.maxSlicesVisible;if(!r.enabled||s-i<=r.minSlices)return e.done||this.scene.mainData.requestMorePieData(t),{numberOfSlices:Math.max(s-i,0),isReady:e.done};for(var h=e.afterFraction,u=i;u<=s-1;u++)h+=e.values[u-n].fraction;for(var c=0,d=0,p=e.done;c+i<s;){c++;var f=e.values[i+c-n-1].fraction;d+=f,h-=f;var g=h/(h+d),m=Math.min(g,o),v=f/d*(1-m);if(c>l||v<a){e.done&&c+i!==s&&c--,p=!0;break}}return p||this.scene.mainData.requestMorePieData(t),{numberOfSlices:c,isReady:p}},t.prototype.getBackOffset=function(t,e,i){if(0===i)return{newOffset:0,isReady:!0};if(!e||e.offset>=i||!e.done&&e.offset+e.values.length<i)return this.scene.mainData.requestPieData(t,Math.max(0,i-this.scene.mainData.dataSettings.itemsToLoad)),{newOffset:0,isReady:!1};if(0===i)return{newOffset:0,isReady:!0};for(var n=e.offset,s=n+e.values.length,r=this.scene.settings.interaction.others.minSliceFraction,a=this.scene.settings.interaction.others.maxOthersFraction,o=this.scene.settings.interaction.others.maxSlicesVisible,l=e.afterFraction,h=i;h<s;h++)l+=e.values[h-n].fraction;for(var u=i,c=e.values[i-n-1].fraction,d=0,p=0===e.offset;u>e.offset;){u--,d+=e.values[u-n].fraction;var f=i-u,g=Math.min(l/(l+d),a),m=c/d*(1-g);if(0===u||f>o||m<r){0!==u&&u++,p=!0;break}}return p||this.scene.mainData.requestLessPieData(t),{newOffset:u,isReady:p}},t.prototype.buildSlices=function(t,e,i){var n=this.scene.settings,s=t.data;if(!s)throw new Error("Internal error - buildSlices");for(var r=0,a=[],o=e;o<e+i;o++){var l=new f(t,o);l.data=s.values[o-s.offset],l.id=l.data.__id,r+=l.data.fraction,a.push(l)}for(var h=n.interaction.others,u=s.afterFraction,c=s.afterSum,o=e+i;o<s.offset+s.values.length;o++){var d=s.values[o-s.offset];c+=d.value,u+=d.fraction}var p;u>0&&(e>0||s.values.length>h.minSlices)?(p=new f(t,1/0),p.data={value:c,fraction:u,name:n.localization.othersLabel}):p=null;var g=null,m=0;if(e>0){for(var v=s.beforeSum,o=s.offset;o<=Math.min(e,s.offset+s.values.length)-1;o++)v+=Math.abs(s.values[o-s.offset].value);g=new f(t,-1),m=h.navigationFraction,m+=t.scrollOffset,g.data={value:v,name:n.localization.previousLabel},g.fraction=m}t.visibleFraction=(r+u)*(1+m/(1-m)),p&&(u=Math.max(h.navigationFraction,u),u=Math.min(h.maxOthersFraction,u),p.fraction=u);var y=(1-m-u)/r;r=1-m-u;for(var S=0;S<a.length;S++){var b=a[S];b.fraction=b.data.fraction*y}var C=n.slice.minFraction;if(C>0)for(var x=0;;){for(var w=0,L=0,S=0;S<a.length;S++){var b=a[S];b.fraction<=C&&(w+=1,L+=b.fraction)}if(w===a.length){for(var A=r/a.length,S=0;S<a.length;S++){var b=a[S];b.fraction=A}break}y=(r-w*C)/(r-L);for(var S=0;S<a.length;S++){var b=a[S];b.fraction<=C?b.fraction=C:b.fraction=b.fraction*y}if(w===x)break;x=w}return{slices:a,othersSlice:p,previousSlice:g}},t.prototype.applyNewSlices=function(t,e,i,n,s){void 0===s&&(s=!0);var r=t.allSlices,a=0===r.length,o=[],l=[],h=0,u=0,c=r.length,p=e.length+(i?1:0)+(n?1:0);for(n?(t.previousSlice?(t.previousSlice.removed=n.removed,t.previousSlice.data=n.data,t.previousSlice.fraction=n.fraction,t.previousSlice.value=n.value,s||this.jumpSliceToAnimationEnd(t.previousSlice)):(a||(n.currentFraction=0),t.previousSlice=n),l.push(t.previousSlice)):t.previousSlice&&(t.previousSlice.removed=!0,t.previousSlice.fraction=0,l.push(t.previousSlice));h<r.length||u<e.length;){var f=r[h],g=e[u];!f||f.index!==1/0&&f.index!==-1?f&&g&&(f.originalId||f.id)===g.id?(f.removed=!1,f.fraction=g.fraction,f.data=g.data,g.currentFraction&&s&&(f.currentFraction=g.currentFraction,f._animatorF=null),s||this.jumpSliceToAnimationEnd(f),o.push(f),l.push(f),h++,u++):!g||f&&(f.index<g.index||c>p)?(f.removed=!0,f.fraction=0,f.originalId||(f.originalId=f.id),f.id=d.Helpers.getIdentifierStr(),s&&l.push(f),h++):(g.currentFraction||a||(g.currentFraction=0),s||this.jumpSliceToAnimationEnd(g),o.push(g),l.push(g),u++):h++}i?(t.othersSlice?(t.othersSlice.removed=i.removed,t.othersSlice.data=i.data,t.othersSlice.fraction=i.fraction,t.othersSlice.value=i.value,s||this.jumpSliceToAnimationEnd(t.othersSlice)):(a||(i.currentFraction=0),t.othersSlice=i),l.push(t.othersSlice)):t.othersSlice&&(l.push(t.othersSlice),t.othersSlice.removed=!0,t.othersSlice.fraction=0),!s&&t.othersSlice&&this.jumpSliceToAnimationEnd(t.othersSlice),t.total=t.data?t.data.total:0,t.count=e.length,t.slices=o,t.allSlices=l;for(var m=0;m<l.length;m++){var v=l[m];v.value=v.data.value,s||this.jumpSliceToAnimationEnd(v)}this.scene.updateOnPieChanged(t)},t.prototype.jumpSliceToAnimationEnd=function(t){t._animatorF?t._animatorF.jump(t.fraction):t._animatorF=new d.Animator(t.fraction,t.fraction,this.scene.settings.interaction.animation.scrollDuration,"<>",0),t.currentFraction=t.fraction},t.prototype.getPieData=function(t){var e=this.scene.mainData.getPieData(t.id);if(!e)return null;var i=e.total;if(i>0)for(var n=0;n<e.values.length;n++){var s=e.values[n];s.fraction=Math.max(1e-9,s.value/i)}else{i=e.values.length;for(var n=0;n<e.values.length;n++){var s=e.values[n];s.fraction=1/i}}return e.afterSum>0?e.afterFraction=e.afterSum/i:e.afterFraction=0,e.beforeSum>0?e.beforeFraction=e.beforeSum/i:e.beforeFraction=0,e},t}();t.PieBuilder=N;var E=function(t){function e(e){t.call(this),this.animationOrder=500,this.paintOrder=30,this.updateOrder=700,this.chart=e,this.scene=e.scene,this.renderer=new F(e),this.animator=new P(e),this.layout=new I(e,this),this.builder=new N(e)}return n(e,t),e.prototype.updatePie=function(t,e){return void 0===e&&(e=!0),this.builder.updatePie(t,e)},e.prototype.scrollForward=function(t,e){return this.builder.scrollForward(t,e)},e.prototype.scrollBackward=function(t,e){return this.builder.scrollBackward(t,e)},e.prototype.onSceneChange=function(t){this.renderer.onSceneChange(t)},e.prototype.doAnimations=function(t){var e=!1;if(t.changes.settings||t.changes.pie||t.changes.bounds||t.changes.assets){var i=this.scene.peek();i&&this.chart.assetsLoaded&&(e=this.layout.placeStack(i,t.context))}for(var n=this.animator.doAnimations(t),s=0;s<n.length;s++){var i=n[s];this.layout.placeLabels(i,t.context)}(e||n)&&(t.changes.position=!0)},e.prototype.paintScene=function(t){this.renderer.paintScene(t)},e.prototype.getMovement=function(t,e){var i=e.x-e.dx-t.x,n=e.y-e.dy-t.y,s=e.x-t.x,r=e.y-t.y,a=d.Geometry.normalizeAngle(Math.atan2(n,i)),o=d.Geometry.normalizeAngle(Math.atan2(r,s)),l=d.Geometry.subtractAngle(o,a)/(t.currentEndAngle-t.currentStartAngle),h=Math.sqrt(i*i+n*n),u=Math.sqrt(s*s+r*r),c=u-h;return{dfraction:l,doffset:c}},e.prototype.findPieAt=function(t,e,i){for(var n=this.scene.currentInnerRadius,s=this.scene.currentRadius-n,r=this.scene.pies.length-1;r>=0;r--){var a=this.scene.pies[r],o=a.x,l=a.y,h=a.currentInnerRadius*s+n,u=a.currentRadius*s+n,c=Math.max(0,h-i);c=u+i;var d=c*c,p=t-o,f=e-l,g=p*p+f*f;if((a.background||1===this.scene.pies.length)&&g<=d)return a}return null},e.prototype.findSliceAt=function(t,e,i,n){for(var s=this.scene.currentInnerRadius,r=this.scene.currentRadius-s,a=this.scene.pies.length-1;a>=0;a--){var o=this.scene.pies[a];if(!o.background){var l=o.x,h=o.y,u=n?0:o.currentInnerRadius*r+s,c=o.currentRadius*r+s,d=Math.max(0,u-i);d=c+i;var p=t-l,f=e-h,g=p*p+f*f,m=Math.sqrt(g);p/=m,f/=m;for(var v=o.currentStartAngle,y=o.currentEndAngle-v,S=Math.cos(v),b=Math.sin(v),C=0;C<o.allSlices.length;C++){var x=o.allSlices[C],w=S,L=b;if(v+=y*x.currentFraction,S=Math.cos(v),b=Math.sin(v),m>=u+x.currentCutoutDistance&&m<=c+x.currentCutoutDistance){var A=L*p-w*f,T=b*p-S*f;if(A<0&&T>0)return x;if(Math.abs(y*x.currentFraction)>Math.PI&&(A<0&&T<0||A>0&&T>0))return x}}}}return null},e.prototype.findLabelAt=function(t,e,i){for(var n=this.scene.pies.length-1;n>=0;n--)for(var s=this.scene.pies[n],r=t-s.x,a=e-s.y,o=0;o<s.allSlices.length;o++){var l=s.allSlices[o];if(l.currentLabel){var h=l.currentLabel;if(h.visible&&h.x-h.hwidth<=r&&h.x+h.hwidth>=r&&h.y-h.hheight<=a&&h.y+h.hheight>=a)return{slice:l,label:h}}if(l.currentInsideLabel){var h=l.currentInsideLabel;if(h.visible&&h.x-h.hwidth<=r&&h.x+h.hwidth>=r&&h.y-h.hheight<=a&&h.y+h.hheight>=a)return{slice:l,label:h}}}return{slice:null,label:null}},e}(d.ChartElement);t.PieView=E;var z=function(t){function e(e,i){t.call(this,new v(e),new m,i),this.scene.loading=!1,this.selection=this.events.addElement(new w(this)),this.scene.view=new E(this),this.popup=this.events.addElement(new k(this)),this.legend=this.events.addElement(new u(this)),this.events.addElement(new L(this)),this.navigator=this.events.addElement(new M(this)),this.events.addElement(this.scene.view),this.finalInitialize(),this.navigator.setPie(this.settings.navigation.initialDrilldown,this.settings.navigation.initialOffset,"init")}return n(e,t),e.prototype.createDataObj=function(t){return new a(this,t,!1)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e.prototype.createDomLayer=function(){return new A(this)},e.prototype.onSettingsChanged=function(t){t.navigation&&(t.navigation.initialDrilldown||t.navigation.initialOffset)&&this.navigator.setPie(this.settings.navigation.initialDrilldown,this.settings.navigation.initialOffset),(t.labels||t.icons||t.pie||t.slice||t.interaction)&&this.events.notifySceneChanges({pie:!0})},e.prototype.save=function(){var t=this.saveSelection();return JSON.stringify({pie:this.navigator.getPie(),offset:this.navigator.getPieOffset(),selection:t})},e.prototype.zoomOut=function(t,e){void 0===t&&(t=!0),void 0===e&&(e="api"),this.navigator.goBack(e)},e.prototype.zoomOutPossible=function(){var t=this.scene;return t.length()>1||t.peek().offset>0},e.prototype.restore=function(t,e){if(t){var i=JSON.parse(t);this.setPie(i.pie,i.offset,e),this.setSelection(i.selection)}},e.prototype.updateFilters=function(){this.updateFilter(!0)},e.prototype.updateFilter=function(t){void 0===t&&(t=!1),this.log("Update filter");var e={};for(var i in this.settings._computedDataMap)e[i]=!0;this.events.notifySceneChanges({data:e,dataDeep:t})},e.prototype.setSelection=function(t,e){void 0===e&&(e="api"),this.log("Set selection");for(var i=[],n=[],s=0;s<t.length;s++){var r=t[s];r instanceof f?i.push(r):d.Helpers.isString(r)?n.push(r):this.error("SetSelection: Selection contents must be Piechart_Slice object or string, got "+r)}this.selection.setSelection(i,n,!1,e)},e.prototype.saveSelection=function(){for(var t=this.scene.selectionIds.splice(0),e=0;e<this.scene.selection.length;e++){var i=this.scene.selection[e];t.push(i.id)}return t},e.prototype.exportVisibleData=function(){var t=this.scene.peek();return t?a.exportValues(t.data):[]},e.prototype.setPie=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n="api"),this.log("Set pie"),this.navigator.setPie(t,e,n)},e.prototype.setPieOffset=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i="api"),this.log("Set pie offset"),this.navigator.setPie(this.getPie(),t,i)},e.prototype.getPie=function(){return this.navigator.getPie()},e.prototype.getActiveSlices=function(){for(var t=[],e=0;e<this.scene.stack.length;e++){var i=this.scene.stack[e];i.parentSlice&&t.push(i.parentSlice)}return t},e.prototype.getActivePies=function(){return this.scene.stack},e.prototype.expandSlice=function(t,e){return void 0===e&&(e="api"),this.navigator.expandSlice(t,e)},e.prototype.getSliceDimensions=function(t,e){if(!Array.isArray(t))return this.error("getSliceDimensions: slice Id must be an array"),null;if(t.length<2)return null;if(!e&&this.scene.stack.length+1<t.length)return null;for(var i,n=0,s=0;s<this.scene.stack.length;s++){if(i=this.scene.stack[s],i.id!==t[n])return null;if(n+=1,n===t.length-1)break}for(var r=t[n],a=0;a<i.slices.length;a++){var o=i.slices[a];if(o.id===r){var l=o._renderParams;return l?{centerX:i.x,centerY:i.y,r0:l[0],r1:l[1],a0:l[2],a1:l[3]}:null}}return null},e.prototype.saveNavigation=function(){var t=this.scene.peek();return!t||t.loading?null:{pie:this.navigator.getPie(),offset:this.navigator.getPieOffset()}},e.prototype.restoreNavigation=function(t,e,i){this.navigator.setPie(t.pie,t.offset,i)},e.prototype.doChartUpdateNotify=function(e){t.prototype.doChartUpdateNotify.call(this,e);var i=this.createEventArguments(null,e);this.dispatchEventParams("pieChange",i,null),this.dispatchEventParams("pieReadyStateChanged",i,null)},e.prototype.createEventArguments=function(t,e){var i=this.scene,n=i.peek();return{chart:this.api,origin:e,pie:n,offset:n?n.offset:null,count:n?n.count:null,selection:i.selection.slice(),slice:i.hoverSlice,hoverSlice:i.hoverSlice,hoverPie:i.hoverPie,label:i.hoverLabel,hoverLabel:i.hoverLabel}},e.prototype.defaultClick=function(t,e){var i=e.clickSlice,n=e.clickPie,s="drilldown"===this.settings.interaction.mode;(s||i&&(i===i.pie.othersSlice||i===i.pie.previousSlice))&&(i?i.url?(d.Helpers.openUrl(i.url,i.urlTarget),t.preventDefault()):this.navigator.expandSlice(i,"user")&&t.preventDefault():n&&"back"===e.clickOrigin&&(this.setSelection([],"user"),this.navigator.goCenter("user"),t.preventDefault()))},e}(d.Impl);t.Impl=z}(a),function(t){var e=function(){function t(){this.enabled=!0,this.size=40,this.defaultUnitWidth=50,this.maxUnitWidth=400,this.zoomOutUnitWidth=20,this.labels={enabled:!0,angle:0,lineSpacing:.2,interLabelSpacing:.6,textStyle:{fillColor:"#000",font:"12px Arial"},margin:4,padding:0,aspectRatio:3,allowOverflow:!1},this.title={enabled:!1,aspectRatio:0,align:"center",useFacetName:!0,textStyle:{font:"13px Arial",fillColor:"#000"}}}return t}();t.SettingsFacetAxis=e;var i=function(){function t(t,e){this.title=null,this.titleHeight=null,this.facet=e,this.chart=t,this.scene=this.chart.scene,this.options=this.scene.settings.facetAxis,this.currentItemWidth=1,this.currentItemHeight=1,this.panel=new d.ChartPanel,this.panel.side="bottom",this.createTitle(),this.panel.packingOrder=100}return t.prototype.getPanel=function(){var t=this.options,e=this.panel;return t.enabled&&t.size>0?(e.desiredHeight=t.size,e.visible=!0,this.scene.bottomAxisSize=t.size):(e.desiredHeight=0,e.visible=!1,this.scene.bottomAxisSize=0),e.enableClipping=!t.labels.allowOverflow,e},t.prototype.createTitle=function(){this.options.title.enabled?this.title=new d.Label(this.options.title):(this.title=null,this.titleHeight=0)},t.prototype.updateTitle=function(t,e){var i=this.title,n=this.options.title,s=this.facet.data?this.facet.data.name:"",r=(n.useFacetName?s||n.text:n.text)||"";i&&(i.text=r,e.measure(t,i),r?this.titleHeight=2*((i.style.margin||0)+i.hheight):this.titleHeight=0)},t.prototype.paintTitle=function(t,e){var i=this.title;if(i){this.updateTitle(t,e);var n=this.titleHeight;if(n){var s=this.panel.left,r=this.panel.right,a=this.scene.y0,o=this.scene.height,l=a+o+this.scene.bottomAxisSize-n/2,h=void 0,u=i.style.align;h=(s+r)/2,"left"===u&&(h=s+i.hwidth),"right"===u&&(h=r-i.hwidth),e.paint(t,h,l,1,i)}}},t.prototype.paint=function(t,e,i,n){var s=this.options.labels;if(n.length>1&&this.panel.visible&&s.enabled&&this.chart.assetsLoaded){var r=t.context,a=t.labelRenderer,o=n[1]-n[0],l=this.panel.top,h=n[0];this.paintTitle(r,a);var u=this.panel.bottom-this.panel.top-this.titleHeight,c=!1;(Math.abs(1-this.currentItemWidth/o)>.01||Math.abs(1-this.currentItemHeight/u)>.01)&&(this.currentItemWidth=o,this.currentItemHeight=u,c=!0),t.changes&&t.changes.settings&&(c=!0),this.layout=new d.LabelLayoutBase;var p=this.facet.items,f=(s.angle||0)*Math.PI/180,g=Math.abs(Math.sin(f));this.panel.pushClip(t);for(var m=0;m<p.length;m++){var v=n[m];if(!(h>v)){var y=p[m],S=y.currentLabel,b=this.htmlDecodeLabel(y.label||y.data.name||s.text,this.layout,r);if(y.currentLabel=null,b){(null===y.currentLabel||c||y.currentLabel.text!==b)&&(S=this.buildLabel(r,b,o,u),y.currentLabel=S);var C=Math.max.apply(Math,S.rows.rowWidths);if(h=v+S.x+C/2,0!==f){for(var x=1,w=g*(n[m+1]-n[m]);w<S.lineHeight+(s.margin||0)+(s.padding||0);)x++,w=g*(n[m+x]-n[m]);h=n[m+x],void 0===n[m+x]&&(h=1/0)}a.paint(r,v+S.x,l+S.y,1,S)}}}this.panel.popClip(t)}},t.prototype.htmlDecodeLabel=function(t,e,i){if(null==t||0===t.length)return"";for(var n=e.styleTagParser2(i,t,{}),s="",r=0,a=n.words,o=0;o<a.length;o++){var l=a[o];if(s+=l.word,o===a.length-1)break;n.breaks[r]===o+1?(s+=" ",r++):l.spaceWidth&&(s+=" ")}return s},t.prototype.buildLabel=function(t,e,i,n){var s=new d.Label(this.options.labels),r=s.style;s.text=e;var a=(r.angle||0)*Math.PI/180,o=r.align;o||(o=a>0?"left":a<0?"right":"center",r.align=o);var l=function(t,e,s){var r,o,l=0,h=1;0!==a?(l=Math.sin(a),h=Math.cos(a),o=s/Math.abs(l),r=i/2):(r=e/2,o=2*t<=n?e:0);var u,c;return a>0?(u=r+o/2*h-2*t*h,c=e/2*l):a<0?(u=r-o/2*h+2*t*h,c=-e/2*l):(u=r,c=t),{x:u,y:c,dx:h,dy:l,width:o}};return this.layout.getFormatedText(t,s,i,n,l),s},t}();t.FacetAxis=i;var s=function(){function t(){this.enabled=!0,this.tolerance=4}return t}();t.SettingsInteractionSelection=s;var r=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.paintOrder=15,this.updateOrder=1e3,this.scene=null,this.events=null,this.currentItem=null,this.currentFacet=null,this.hoverEvent=null,this.chart=e,this.scene=e.scene,this.events=e.events}return n(e,t),e.prototype.doAnimations=function(t){this.hoverEvent&&this.onPointerMove(this.hoverEvent)},e.prototype.previewPointerDrag=function(t){this.hoverEvent=t},e.prototype.onPointerMove=function(t){var e=this.chart,i=e.scene;this.hoverEvent=t;var n=i.findItemAt(t.x,t.y);n&&(t.cursor="pointer");var s=e.renderer.hitTest(t.x,t.y);if(e.legend)if(s)e.legend.notifyHoveredSeries(i.settings._computedSeries[s.seriesIndex]);else{e.legend.notifyHoveredSeries(null);var r=e.legend.getLastHoveredSeries();r&&(s={x0:null,y0:null,x1:null,y1:null,isMarker:!1,seriesIndex:i.settings._computedSeries.indexOf(r)})}(!s!=!i.hoverSeriesItem||s&&(s.seriesIndex!==i.hoverSeriesItem.seriesIndex||s.x0!==i.hoverSeriesItem.x0))&&(i.hoverSeriesItem=s,t.changes.hover=!0),this.switchCurrentItem(n,t)},e.prototype.onPointerOut=function(t){this.hoverEvent=this.scene.hoverSeriesItem=null,this.events.notifySceneChanges({selection:!0}),this.switchCurrentItem(null,t)},e.prototype.onClick=function(t){var e=this.scene.findItemAt(t.x,t.y),i=this.chart.createEventArguments(t,"user",e);t.consumed=!0,e&&(t.cursor="pointer"),this.chart.notifyClick(t,i),t.defaultPrevented||this.updateSelection(t,e,!1)},e.prototype.onRightClick=function(t){var e=this.scene.findItemAt(t.x,t.y),i=this.chart.createEventArguments(t,"user",e);this.chart.notifyRightClick(t,i),e&&(t.cursor="pointer"),t.defaultPrevented&&(t.consumed=!0)},e.prototype.onDoubleClick=function(t){var e=this.scene.findItemAt(t.x,t.y),i=this.chart.createEventArguments(t,"user",e);e&&(t.cursor="pointer"),this.chart.notifyDoubleClick(t,i),t.consumed=!0},e.prototype.onTripleClick=function(t){var e=this.scene.findItemAt(t.x,t.y),i=this.chart.createEventArguments(t,"user",e);e&&(t.cursor="pointer"),this.chart.notifyTripleClick(t,i),t.consumed=!0},e.prototype.updateSelection=function(t,e,i){this.scene.settings.interaction.selection.enabled&&(t.shiftKey||e&&!e.selected?e&&t.shiftKey||i&&e.selected?e.selected||(this.scene.selection.push(e),e.selected=!0,this.setSelection(this.scene.selection,this.scene.selectionIds,!0)):e&&this.setSelection([e]):this.setSelection([]))},e.prototype.switchCurrentItem=function(t,e){if(t!==this.currentItem){var i=this.chart.createEventArguments(e,"user");e.changes.current=!0,this.scene.hoverItem&&(this.scene.hoverItem.active=!1),this.scene.hoverItem=t,this.currentItem=t,this.currentFacet=null,this.currentItem&&(this.scene.hoverItem.active=!0,i.hoverItem=this.currentItem),this.events.notifySceneChanges({items:!0}),this.chart.notifyHoverChanged(e,i)}},e.prototype.onSceneChange=function(t){t.changes.items&&this.updateSelectionIds()&&(this.events.notifySceneChanges({selection:!0}),this.chart.notifySelectionChanged(null))},e.prototype.updateSelectionIds=function(){for(var t=[],e=0;e<this.scene.selectionIds.length;e++)for(var i=this.scene.selectionIds[e],n=0;n<this.scene.stack.length;n++)for(var s=this.scene.stack[n],r=0;r<s.items.length;r++){var a=s.items[r];if(a.id===i){t.push(a);break}}if(t.length>0)for(var o=0;o<t.length;o++){var l=t[o];l.selected||(l.selected=!0,this.scene.selection.push(l)),d.Helpers.removeFromArray(this.scene.selectionIds,l.id)}return t.length>0},e.prototype.setSelection=function(t,e,i,n){void 0===e&&(e=[]),void 0===i&&(i=!1),void 0===n&&(n="user"),this.scene.selectionIds=e;var s=!1;if(i)s=!0;else{for(var r=0;r<this.scene.selection.length;r++){var a=this.scene.selection[r];t.indexOf(a)<0&&(a.selected=!1,s=!0)}for(var r=0;r<t.length;r++){var a=t[r];a.selected||(a.selected=!0,s=!0)}this.scene.selection=t}var o=this.updateSelectionIds();s=s||o,s&&(this.events.notifySceneChanges({selection:!0}),this.chart.notifySelectionChanged(this.chart.createEventArguments(null,n)))},e}(d.ChartElement);t.Selection=r;var o=function(t){function e(e){t.call(this,e),this.animationOrder=500,this.paintOrder=25,this.updateOrder=800}return n(e,t),e.prototype.doAnimations=function(t){(t.changes.position||t.changes.navigation)&&this.updatePopup(t)},e.prototype.getPopupAreaMouseMoved=function(t,e){if(!this.scene.xyInChartOrBottom(t,e)||!this.scene.activeFacet)return null;var i=this.scene.activeFacet,n=this.scene.xToPosition(t);if(isNaN(n))return null;var s=Math.floor(n),r=Math.ceil(n);return s===r&&(r=s+1),s<i.offset||s>=i.items.length+i.offset?null:{
  53. t0:s,t1:r}},e.prototype.buildHeader=function(t,e){var i=this.scene.activeFacet,n=i.items[t-i.offset],s=n.label||n.data.name||"";return"<em></em><strong>"+s+"</strong>"},e}(l.InfoPopup);t.InfoPopup=o;var h=function(){function t(){this.enabled=!0,this.enabledOnExport=!1,this.size=28,this.style={fillColor:"rgba(255,255,255,0.5)",lineColor:"rgba(0,0,0,0.5)",hoverFillColor:"rgba(255,255,255,0.9)",hoverLineColor:"rgba(0,0,0,0.9)"}}return t}();t.SettingsScrollButtons=h;var u=function(t){function e(e){t.call(this),this.paintOrder=75,this.chart=e,this.scene=e.scene,this.settings=e.settings.scrollButtons,this.panels=[];for(var i=0;i<2;i++){var n=new d.ChartPanel;n.packingOrder=115,n.side=1===i?"left":"right",n.location="inside",n.align="center",this.panels.push(n)}}return n(e,t),e.prototype.onSceneChange=function(t){this.settings.enabled&&(this.activeFacet=this.chart.scene.activeFacet,this.showLeft=Math.floor(this.activeFacet.from)>0,this.showRight=Math.ceil(this.activeFacet.to)<this.activeFacet.totalCount)},e.prototype.getPanels=function(t){for(var e=0;e<2;e++){var i=this.panels[e];i.visible=t?this.settings.enabledOnExport:this.settings.enabled,i.desiredWidth=i.desiredHeight=this.settings.size}return this.panels},e.prototype.paintScene=function(t){if(this.panels[0].visible){var e=this.settings.style,i=t.context;i.fillStyle=e.fillColor,i.strokeStyle=e.lineColor;for(var n=this.settings.size,s=n/2,r=n/4,a=this.scene.y0+this.scene.height/2-n/2,o=0;o<this.panels.length;o++){var l=this.panels[o],h=l.left;this.showRight&&"right"===l.side&&(this.rightActive&&(i.fillStyle=e.hoverFillColor,i.strokeStyle=e.hoverLineColor),i.beginPath(),i.fillRect(h,a,n,n),i.moveTo(h+s-r/2+2,a+r),i.lineTo(h+s+r-3,a+s),i.lineTo(h+s-r/2+2,a+n-r),i.stroke()),this.showLeft&&"left"===l.side&&(this.leftActive&&(i.fillStyle=e.hoverFillColor,i.strokeStyle=e.hoverLineColor),i.beginPath(),i.fillRect(h,a,n,n),i.moveTo(h+s+r/2-2,a+r),i.lineTo(h+s-r+3,a+s),i.lineTo(h+s+r/2-2,a+n-r),i.stroke()),i.fillStyle=e.fillColor,i.strokeStyle=e.lineColor}}},e.prototype.findItemAt=function(t,e,i){if(!this.panels[0].visible)return null;for(var n=i.touch?10:0,s=0;s<2;s++){var r=this.panels[s];if(t>=r.left-n&&t<=r.right+n&&e>=r.top-n&&e<=r.bottom+n&&("left"===r.side&&this.showLeft||"right"===r.side&&this.showRight))return r.side}return null},e.prototype.onClick=function(t){if(this.panels[0].visible){var e=d.Helpers.performanceNow(),i=this.findItemAt(t.x,t.y,t);if(null!==i){var n=this.chart.scrolling,s=this.activeFacet,r=s.from,a=s.to,o=s.totalCount,l=a-r;"right"===i&&(a+l>o?(a=a-l+(o-a),n.goToPosition(a,o,!0,e,!0)):n.goToPosition(a,a+l,!0,e,!0)),"left"===i&&(r-l<0?n.goToPosition(0,l,!0,e,!0):n.goToPosition(r-l,r,!0,e,!0)),t.consumed=!0}}},e.prototype.onPointerMove=function(t){var e=this.findItemAt(t.x,t.y,t);null!==e?("left"===e&&(this.leftActive=!0),"right"===e&&(this.rightActive=!0),t.changes.hover=!0,t.consumed=!0):(this.leftActive=!1,this.rightActive=!1)},e}(d.ChartElement);t.ScrollButtons=u;var c="#A8A7A8",p=function(t){function i(i){t.call(this,d.SettingsMapping.FacetChartSettings),this.data=[],this.filters={sliceFilter:null,allowZeroValues:!0},this.navigation={initialDrilldown:[""],initialOffset:0},this.items={style:{label:null,expandable:!0},styleFunction:null},this.chartTypes={columns:{type:"columns"},line:{type:"line"},candlestick:null},this.facetAxis=new e,this.interaction=new g,this.toolbar=new f,this.legend=new l.SettingsLegend,this.scrollButtons=new h,this.localization.toolbar.zoomoutTitle="Zoom-out to previous level",this.apply(i),this._initializing=!1}return n(i,t),i.prototype.apply=function(e){if(this.applyCompatibility(e,[{from:"area.initialPieId",to:"navigation.initialDrilldown"},{from:"area.initialPieOffset",to:"navigation.initialOffset"}]),e.series)for(var i=0;i<e.series.length;i++){var n=e.series[i];n&&void 0!==n.styleFunction&&d.Helpers.error("Setting `series["+i+"].styleFunction` is no longer supported. Consider using `items.styleFunction` instead. See the example: https://zoomcharts.com/developers/en/facet-chart/examples/series/stacked-colored.html")}return t.prototype.apply.call(this,e,m)},i.DarkTheme={advanced:{themeCSSClass:"DVSL-dark"},area:{style:{fillColor:"rgba(28,26,28,1)"}},title:{margin:15,style:{fillColor:c}},valueAxisDefault:{style:{valueLabel:{textStyle:{fillColor:c}},title:{textStyle:{fillColor:c}}}},facetAxis:{labels:{textStyle:{fillColor:c}},title:{textStyle:{fillColor:c}}},legend:{text:{fillColor:c},advanced:{disabledSeries:{textColor:"rgba(168,167,168,0.5)",lineColor:"rgba(117,117,117,0.3)"}}}},i}(l.Settings);t.Settings=p;var f=function(t){function e(){t.apply(this,arguments),this.logScale=!0,this.zoomOut=!0,this.enabled=!0,this.items=[new d.SettingsToolbarItem("fullscreen","left"),new d.SettingsToolbarItem("back","left"),new d.SettingsToolbarItem("zoomOut","left"),new d.SettingsToolbarItem("logScale","right"),new d.SettingsToolbarItem("export","right")]}return n(e,t),e}(d.SettingsToolbar);t.SettingsToolbar=f;var g=function(t){function e(){t.apply(this,arguments),this.selection=new s,this.animation={scrollDuration:500}}return n(e,t),e}(l.SettingsInteraction);t.SettingsInteraction=g;var m=function(t){function e(){t.apply(this,arguments),this.type="columns",this.data=new v}return n(e,t),e.getMapping=function(t,e){if(t&&e.type&&t.type!==e.type)throw new Error("It is not possible to change the value of `type` property for an existing layer.");switch(t?t.type:e.type){case"columns":case void 0:return d.SettingsMapping.FacetChartSettingsSeriesColumns;case"line":return d.SettingsMapping.FacetChartSettingsSeriesLines;default:throw new Error("The value '"+e.type+"' is not valid for the `type` property of a series. Valid values are: columns, line.")}},e.createInstance=function(t,e){switch(e||t.type){case"columns":case void 0:return new y;case"line":return new S;default:throw new Error("The value '"+(e||t.type)+"' is not valid for the `type` property of a series. Valid values are: columns, line.")}},e}(l.SettingsSeries);t.SettingsSeries=m;var v=function(t){function e(){t.apply(this,arguments),this.field=null,this.valueFunction=null}return n(e,t),e}(l.SettingsSeriesData);t.SettingsSeriesData=v;var y=function(t){function e(){t.apply(this,arguments),this.style=new C,this.data=new v}return n(e,t),e}(l.SettingsSeriesColumns);t.SettingsSeriesColumns=y;var S=function(t){function e(){t.apply(this,arguments),this.data=new v,this.style=new b}return n(e,t),e}(l.SettingsSeriesLines);t.SettingsSeriesLines=S;var b=function(t){function e(){t.apply(this,arguments),this.markerStyleFunction=null}return n(e,t),e}(l.SettingsSeriesLinesStyle);t.SettingsSeriesLinesStyle=b;var C=function(t){function e(){t.apply(this,arguments),this.previewContents=!1,this.previewLineColor="rgba(255,255,255,.5)"}return n(e,t),e}(l.SettingsSeriesColumnsStyle);t.SettingsSeriesColumnsStyle=C;var x=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(C);t.SettingsFacetStyle=x;var w=function(){function t(){this.id=null,this.data=null,this.items=[],this.parentItem=null,this.activeItemId=null,this.offset=0,this.count=0,this.totalCount=0,this.from=0,this.to=0,this.left=0,this.right=1,this.opacity=1,this.loading=null,this.rebuild=!0}return t.prototype.getActiveItem=function(){if(!this.activeItemId)return null;for(var t=0;t<this.items.length;t++){var e=this.items[t];if(e.id===this.activeItemId)return e}return null},t}();t.Facet=w;var L=function(){function t(t,e,i,n){this.expandable=!0,this.selected=!1,this.active=!1,this.url=null,this.urlTarget=null,this.values=[],this.innerFacet=null,this.label=null,this.currentLabel=null,this.facet=t,this.id=e,this.index=i,this.data=n}return t}();t.Item=L;var A=function(){function t(t,e,i,n,s){this.value=0,this.label=null,this.currentLabel=null,this.style=new x,this.previewData=null,this.data=n,this.index=i,this.id=e,this.facet=t,this.seriesId=s}return t}();t.ItemValue=A;var T=function(t){function e(){t.apply(this,arguments),this.data=null,this.stack=[],this.activeFacet=null,this.hoverItem=null,this.selection=[],this.selectionIds=[]}return n(e,t),e.prototype.xToPosition=function(t){var e=this.activeFacet,i=this.x0+e.left*this.width,n=this.x0+e.right*this.width,s=e.from+(t-i)/(n-i)*(e.to-e.from);return s},e.prototype.positionToX=function(t){var e=this.activeFacet,i=this.x0+e.left*this.width,n=this.x0+e.right*this.width;return i+(t-e.from)*(n-i)/(e.to-e.from)},e.prototype.timeToX=function(t){return this.positionToX(t)},e.prototype.xToTime=function(t){return this.xToPosition(t)},e.prototype.length=function(){return this.stack.length},e.prototype.peek=function(){return 0===this.stack.length?null:this.stack[this.stack.length-1]},e.prototype.push=function(t,e){var i=this.peek();if(i&&!e)for(var n=0;n<i.items.length;n++){var s=i.items[n];if(s.data.__id===t.id){e=s;break}}if(e){t.parentItem=e,e.innerFacet=t;var r=this.getItemPlacement(e);t.left=r.left,t.right=r.right,i.activeItemId=e.id}else i&&(i.activeItemId=null);this.stack.push(t),this.activeFacet=t},e.prototype.pop=function(){if(this.stack.length>0){var t=this.stack.pop();t.parentItem&&(t.parentItem.facet.activeItemId=null)}return this.stack.length>0?this.activeFacet=this.peek():this.activeFacet=null,this.activeFacet},e.prototype.getParent=function(t){for(var e=null,i=0;i<this.stack.length;i++){var n=this.stack[i];if(n===t)return e;e=n}return null},e.prototype.getChild=function(t){for(var e=null,i=0;i<this.stack.length;i++){var n=this.stack[i];if(e===t)return n;e=n}return null},e.prototype.updateLinks=function(t){var e=this.getParent(t),i=this.getChild(t);if(e&&!t.parentItem)for(var n=0;n<e.items.length;n++){var s=e.items[n];if(s.id===t.id){t.parentItem=s,e.activeItemId=s.id;break}}if(i&&!i.parentItem)for(var n=0;n<t.items.length;n++){var s=t.items[n];if(s.id===i.id){i.parentItem=s,t.activeItemId=s.id;break}}},e.prototype.getItemPlacement=function(t){var e=t.facet,i=t.index,n=e.to-e.from,s=e.from,r=(i-s)/n,a=(i-s+1)/n;return{left:e.left+r*(e.right-e.left),right:e.left+a*(e.right-e.left)}},e.prototype.getFacetPlacementFromItem=function(t,e,i){var n=t.facet,s=t.index,r=s+1,a=(s-n.from)/(n.to-n.from),o=(r-n.from)/(n.to-n.from),l=e-a*(e-i)/(a-o),h=l+(e-i)/(a-o);return{left:l,right:h}},e.prototype.findItemAt=function(t,e){var i=this.activeFacet;if(!i||!this.xyInChart(t,e))return null;var n=Math.floor(this.xToPosition(t));return n>=i.offset&&n<i.offset+i.count?i.items[n-i.offset]:null},e}(l.Scene);t.Scene=T;var M=function(t){function e(e){t.call(this,e),this.animationOrder=100,this.paintOrder=10,this.updateOrder=1100,this.animatingFacet=null,this.leftAnimator=null,this.rightAnimator=null,this.activePieReady=!1,this._shouldZoomOut=!1}return n(e,t),e.prototype.setState=function(t,e,i,n){if(0===t.length)return void this.chart.error("setPie - array needs at least one item.");for(var s=0;this.scene.length()>t.length;)this.scene.pop(),s++;for(;this.scene.length()>0&&this.scene.peek().id!==t[this.scene.length()-1];)this.scene.pop(),s++;for(;this.scene.length()<t.length;){var r=t[this.scene.length()];this.drillDown(r,null),s++}var a=this.scene.peek();if(this.facet=a,s&&this.goToPositionDragging(a.from,a.to),a.offset!==e||i&&a.count!==i){var o=e,l=void 0;l=i>0?o+i:e+a.count,s?(this.goToPositionDragging(o,l),this.animateFillChart()):this.goToPosition(o,l,!0,d.Helpers.performanceNow(),!0)}else s&&this.animateFillChart();this.chart.notifyChartUpdate(n),s&&this.events.notifySceneChanges({navigation:!0})},e.prototype.getState=function(){for(var t=[],e=0;e<this.scene.stack.length;e++){var i=this.scene.stack[e];t.push(i.id)}var n=this.scene.peek();return{idArray:t,offset:n.offset,count:n.count}},e.prototype.goUp=function(t){if(this.scene.length()>1){this.scene.pop();var e=this.facet=this.scene.peek();this.goToPositionDragging(e.from,e.to),this.animateFillChart(),this.events.notifySceneChanges({navigation:!0}),this.updateAndNotifyCurrent(t)}else this.goToPosition(0,this.getMaxItems(),!0,d.Helpers.performanceNow(),!0)},e.prototype.getMaxItems=function(){var t=this.scene.width/this.scene.settings.facetAxis.defaultUnitWidth;return this.facet.data.totalCount&&(t=Math.min(t,this.facet.data.totalCount)),t},e.prototype.drillDown=function(t,e){this.stopAnimations();var i=new w;i.id=t,this.scene.push(i,null),this.chart.builder.updateFacet(i),this.facet=i,this.setFrom(i.from),this.setTo(i.to),this.animateFillChart(),this.events.notifySceneChanges({navigation:!0}),this.updateAndNotifyCurrent(e)},e.prototype.updateAndNotifyCurrent=function(t){this.chart.builder.updateFacet(this.facet),this.chart.notifyChartUpdate(t)},e.prototype.onSceneChange=function(t){var e=this.facet,i=t.timeStamp,n=t.changes.settingsChanges;if(n&&n.series){t.changes.items=!0;for(var s=0;s<this.scene.stack.length;s++){var r=this.scene.stack[s];this.chart.builder.rebuildValues(r)}}if((t.changes.pieChartPieIds||t.changes.dataArrived||t.changes.data)&&(this.activePieReady=!1,t.changes.data||t.changes.dataArrived))for(var a=t.changes.pieChartPieIds||Object.create(null),o=0;o<this.scene.stack.length;o++){var r=this.scene.stack[o],l=!r.data||r===e||a[r.id]||t.changes.dataDeep;l&&(r.rebuild=!0,this.chart.builder.updateFacet(r,t),t.changes.items=!0,this.activePieReady=this.activePieReady||r===e&&!r.loading)}this.activePieReady&&this.scene.width>0&&(this.activePieReady=!1,this.inertiaT.finished(i)&&e.from<e.to&&(this.setFrom(e.from),this.setTo(e.to),this.animateFillChart()),this.chart.notifyChartUpdate(null))},e.prototype.doAnimations=function(e){var i=this.facet;if(this.animatingFacet){i.left=this.leftAnimator.get(e.timeStamp),i.right=this.rightAnimator.get(e.timeStamp);var n=this.leftAnimator.finished(e.timeStamp)||this.rightAnimator.finished(e.timeStamp);n&&(this.animatingFacet=null,this.leftAnimator=null,this.rightAnimator=null),this.events.notifySceneChanges({position:!0}),e.animating=!0}else i.opacity=1;this.layoutFacets();for(var s=0;s<this.scene.stack.length;s++)i=this.scene.stack[s],this.chart.builder.updateFacet(i,e);t.prototype.doAnimations.call(this,e)},e.prototype.xyInArea=function(t,e){return this.scene.xyInChartOrBottom(t,e)},e.prototype.xyToPosition=function(t,e){return this.scene.xToPosition(t)},e.prototype.onGoHome=function(t,e){return{from:0,to:e-t,origin:0}},e.prototype.handleZoomWheel=function(t,e,i,n,s){t<0&&(e-=t,t=0);var r=this.onSnapWhileDragging(t,e,i,this.scrollingActive,s);t=r.from,e=r.to;var a=this.onSnapAfterDragging(t,e,i,this.scrollingActive,s);return a?void this.goToPosition(a.from,a.to,!0,n,!0):void(this.wheelOrigin=null)},e.prototype.onStartDragging=function(t,e,i){this.stopAnim()},e.prototype.onSnapWhileDragging=function(t,e,i,n,s){var r=e-t,a=this.facet,o=a.totalCount,l=0,h=1,u=!1;return this.scene.stack.length>1&&(r>2*o||this.scene.width/r<this.scene.settings.facetAxis.zoomOutUnitWidth)&&(u=!0),(u||t<0)&&(l=t/(t-e),t=0),(u||e>o)&&(h=Math.max(l+.1,(o-t)/(e-t)),e=o),this._shouldZoomOut=u,a.left=l,a.right=h,{from:t,to:e}},e.prototype.onSnapAfterDragging=function(t,e,i,n,s){if(this._shouldZoomOut)return this._shouldZoomOut=!1,this.goUp("user"),null;var r=this.snap(t,e,i,n,s);return t=r.from,e=r.to,this.animateFillChart(),this.chart.notifyChartUpdate("user"),{from:t,to:e}},e.prototype.onPositionChanged=function(t,e){var i=this.facet;i.from=t,i.to=e,this.chart.builder.updateFacet(i),this.events.notifySceneChanges({position:!0})},e.prototype.onAnimationDone=function(t,e){this.chart.notifyChartUpdate(null),this.chart.notifyAnimationDone()},e.prototype.snap=function(t,e,i,n,s){var r=this.facet,a=r.totalCount;r.right<1&&(0===r.right&&(r.right=1e-10),e=t+(e-t)/r.right),r.left>0&&(1===r.left&&(r.left=1-1e-10),t=e-(e-t)/(1-r.left));var o=this.scene.width/(e-t),l=o;a>0&&(l=Math.max(l,this.scene.width/a)),l=Math.min(this.scene.settings.facetAxis.maxUnitWidth,l);var h=o/l;if(t=i+(t-i)*h,e=i+(e-i)*h,t=Math.round(t),e=Math.round(e),t<0)e-=t,t=0;else if(e>a){var u=Math.max(0,a-(e-t));e=e-t+u,t=u}return{from:t,to:e}},e.prototype.animateFillChart=function(){0===this.facet.left&&1===this.facet.right&&this.animatingFacet===this.facet||(this.animatingFacet=this.facet,this.leftAnimator=new d.Animator(this.facet.left,0,this.scene.settings.interaction.animation.scrollDuration,"<>"),this.rightAnimator=new d.Animator(this.facet.right,1,this.scene.settings.interaction.animation.scrollDuration,"<>"),this.events.notifySceneChanges({requestPaint:!0}))},e.prototype.stopAnim=function(){var t=this.facet;this.animatingFacet&&(t.opacity=1,this.animatingFacet=null),this.leftAnimator&&(t.left=this.leftAnimator.get(1/0),this.leftAnimator=null),this.rightAnimator&&(t.right=this.rightAnimator.get(1/0),this.rightAnimator=null),this.layoutFacets()},e.prototype.layoutFacets=function(){for(var t=this.scene.stack.length-2;t>=0;t--){var e=this.scene.stack[t+1],i=this.scene.stack[t];if(e.parentItem){var n=this.scene.getFacetPlacementFromItem(e.parentItem,e.left,e.right);i.left=n.left,i.right=n.right}i.opacity=e.left>0||e.right<1?.5:0}this._shouldZoomOut?(this.facet.opacity=.65,this.facet.parentItem.facet.opacity=1):this.facet.opacity=1},e}(l.Scrolling);t.Scrolling=M;var k=function(){function t(t,e,n){this.bounds={x0:0,y0:0,width:0,height:0},this.facet=n,this.chart=e,this.scene=this.chart.scene,this.valueAxis=new l.ValueAxisSet(this.chart,this.scene.settings._computedValueAxisList),this.xes=[],this.facetAxis=new i(e,n),this.r=new l.Renderer(this.chart,this.valueAxis)}return t.prototype.getPanels=function(){var t=this.valueAxis.getPanels(!0);return t.push(this.facetAxis.getPanel()),t},t.prototype.setPanels=function(t){this.valueAxis.setPanels(t),this.facetAxis.panel=t[t.length-1]},t.prototype.doAnimations=function(t,e){var i=e.x0,n=e.y0,s=e.width,r=e.height,a=this.facet,o=a.offset,l=a.left,h=a.right;l=i+s*l,h=i+s*h;var u=Math.max(i,l),c=Math.min(i+s,h);this.bounds={x0:u,y0:n,width:c-u,height:r};var d=t.changes;if(d.position||d.data||d.bounds||d.items){for(var p=(h-l)/(a.to-a.from),f=l-a.from*p,g=[],m=[],v=o,y=o+a.count,S=v;S<=y+1;S++)g.push(S),m.push(S*p+f);this.xes=m;for(var b=[],C=0;C<this.scene.settings._computedSeries.length;C++){for(var x=[],w=[],L=[],S=v;S<=y-1;S++){var A=this.facet.items[S-o],T=A.values[C];x.push(T.value),L.push(1),w.push(T)}b.push({xes:m,times:g,counts:L,fromIndex:0,toIndex:g.length,values:x,config:w,externalItems:function(t,e){var i=this;return i.config.slice(t,e)}})}this.r.process(b)}this.valueAxis.updateMinMax(t),this.r.afterProcess(),this.valueAxis.doAnimations(t)},t.prototype.paintScene=function(t){var e=t.context,i=this.bounds,n=this.facet.opacity,s=1===n?n:.2;0!==n&&(e.globalAlpha=s,this.valueAxis.paintUnder(t),e.globalAlpha=n,d.Graphics.pushClip(t,i.x0,i.y0,i.width,i.height),this.r.paint(t),d.Graphics.popClip(t),e.globalAlpha=s,this.facetAxis.paint(t,i.x0,i.width,this.xes),this.valueAxis.paint(t),e.globalAlpha=1)},t}();t.Layer=k;var P=function(t){function e(e){t.call(this),this.animationOrder=400,this.paintOrder=5,this.updateOrder=1200,this.chart=e,this.scene=this.chart.scene,this.events=this.chart.events,this.layers=[],this.panels=[]}return n(e,t),e.prototype.onSceneChange=function(t){var e=t.changes;if(e.settings||e.navigation||e.linearChartSeries||e.linearChartValueAxis){var i=e.settingsChanges;e.linearChartValueAxis||i&&i.facetAxis?(e.bounds=!0,this.layers=[]):e.linearChartSeries&&(this.layers=[]);for(var n=0;n<this.layers.length;n++){var s=this.layers[n];s.facet!==this.scene.stack[n]&&(this.layers=this.layers.slice(0,n))}for(;this.layers.length<this.scene.stack.length;){var r=this.scene.stack[this.layers.length],a=new k(t,this.chart,r);this.layers.push(a)}0===this.layers.length&&this.layers.push(new k(t,this.chart,new w));var o=this.layers[0].getPanels();this.panels=o.filter(function(t){return null!=t});for(var l=0;l<this.layers.length;l++)this.layers[l].setPanels(o)}},e.prototype.getPanels=function(){return this.panels},e.prototype.doAnimations=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.doAnimations(t,this.scene)}},e.prototype.paintScene=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.paintScene(t)}},e.prototype.exportData=function(t,e){return this.layers[this.layers.length-1].r.exportData(t,e)},e.prototype.hitTest=function(t,e){return this.scene.xyInChart(t,e)&&this.layers.length>0?this.layers[this.layers.length-1].r.hitTest(t,e,this.scene.settings.interaction.selection.tolerance):null},e}(d.ChartElement);t.Renderer=P;var I=function(){function t(t){this.chart=t,this.scene=t.scene,this.loading=!1}return t.prototype.updateFacet=function(t,e){void 0===e&&(e=null);var i=this.chart.getData("default"),n=t.data;if((!n||e&&(e.changes.data||e.changes.dataArrived||e.changes.filters))&&(n=t.data=i.getPieData(t.id),!n))return t.loading=!0,void i.requestPieData(t.id,Math.floor(t.from));var s=!1;if(this.scene.width&&(!(t.from<t.to)||t.rebuild)){t.rebuild=!1;var r=Math.max(1,Math.floor(this.scene.width/this.scene.settings.facetAxis.maxUnitWidth)),a=Math.max(1,Math.floor(this.scene.width/this.scene.settings.facetAxis.defaultUnitWidth));n.totalCount&&(a=Math.min(n.totalCount,a)),a=Math.max(r,a),t.offset=Math.floor(t.from),t.count=0,t.to=t.from+(0|a),t.items=[]}var o=Math.max(0,(0|t.from)-2),l=Math.ceil(t.to+2),h=n.values.length+n.offset,u=n.offset;t.loading=!1,u>o&&(o=u,i.requestLessPieData(t.id),t.loading=!0),h<l&&(l=h,n.done||(i.requestMorePieData(t.id),t.loading=!0));var c=t.offset+t.items.length;if((l<t.offset||o>c)&&(t.offset=o,t.items=[],c=o),o>t.offset)t.items=t.items.slice(o-t.offset);else if(o<t.offset){for(var d=[],p=o;p<=t.offset-1;p++)d.push(this.buildItem(t,n,p));t.items=d.concat(t.items),s=!0}if(t.offset=o,l<c)t.items=t.items.slice(0,l-t.offset);else if(l>c){for(var p=c;p<l;p++)t.items.push(this.buildItem(t,n,p));s=!0}if(t.count=t.items.length,t.totalCount=Math.max(t.offset+t.count,n.totalCount||0),s)if(e)e.changes.items=!0,e.changes.changedItems||(e.changes.changedItems={}),e.changes.changedItems[t.id]=!0;else{var f={};f[t.id]=!0,this.chart.events.notifySceneChanges({items:!0,changedItems:f})}return this.scene.updateLinks(t)},t.prototype.rebuildValues=function(t){for(var e=0;e<t.items.length;e++){var i=t.items[e];this.updateItem(i)}},t.prototype.buildItem=function(t,e,i){var n=e.values[i-e.offset],s=new L(t,n.__id,i,n);return this.updateItem(s),s},t.prototype.updateItem=function(t){for(var e=[],i=0;i<this.scene.settings._computedSeries.length;i++){var n=this.scene.settings._computedSeries[i],s=new A(t.facet,t.id,t.index,t.data,n.id);t.data?s.value=this.getSeriesValue(t.data,n):s.value=null,e.push(s)}t.values=e},t.prototype.getSeriesValue=function(t,e){var i=e.data.valueFunction,n=null;if(i)n=i(t);else{var s=e.data.field||"value";n=t[s]}return d.Helpers.tryParseFloat(n,null)},t.prototype.buildPreviewData=function(t,e){var i=t.id,n=this.scene.mainData,s=n.getPieData(i),r=null;if(s)if(s.offset>0)n.requestLessPieData(t.id);else{r=[];for(var a=0,o=0;o<s.values.length;o++){var l=s.values[o],h=this.getSeriesValue(l,e);r.push(h),a+=h}if(a>0){a=1/a;for(var u=0;u<r.length;u++)r[u]=r[u]*a}else r=null}else t.expandable&&n.canExpand(i)&&n.requestPieData(t.id,0);return r},t}();t.Builder=I;var D=function(t){function e(e){t.call(this),this.animationOrder=200,this.paintOrder=20,this.updateOrder=900,this.chart=e,this.scene=e.scene}return n(e,t),e.prototype.doAnimations=function(t){if(t.changes.settings||t.changes.items||t.changes.selection||t.changes.navigation){var e=this.scene.activeFacet;if(e)for(this.computeFacetStyleRec(e);e&&e.parentItem;)e=e.parentItem.facet,this.computeFacetStyleRec(e)}},e.prototype.computeFacetStyleRec=function(t){this.computeFacetStyle(t);for(var e=0;e<t.items.length;e++){var i=t.items[e];this.computeItemStyle(t,i),i.innerFacet&&this.computeFacetStyleRec(i.innerFacet)}},e.prototype.computeFacetStyle=function(t){},e.prototype.computeItemStyle=function(t,e){var i=this.scene.settings._computedSeries;if(d.Helpers.extendStyleTo(this.scene.settings.items.style,e),e.data.style&&d.SettingsHelper.updateRecursive(e,e.data.style,d.SettingsMapping.FacetChartSettingsFacetStyle,{}),e.id===e.facet.activeItemId)for(var n=0;n<e.values.length;n++){var s=e.values[n];s.style.fillColor=null,s.style.lineColor=null}else for(var n=0;n<e.values.length;n++){var s=e.values[n];d.Helpers.extendStyleTo(i[n].style,s.style)}if(this.scene.settings.items.styleFunction?(this.scene.settings.items.styleFunction(e,e.data),e.label&&!d.Helpers.isString(e.label)&&(e.label=""+e.label)):e.data.name&&(e.label=e.data.name),e.id!==e.facet.activeItemId)for(var n=0;n<e.values.length;n++){var s=e.values[n],r=i[n];s.style.previewContents?s.previewData=this.chart.builder.buildPreviewData(e,r):s.previewData=null}else e.values[e.values.length-1].previewData=null},e}(d.ChartElement);t.Styles=D;var F=function(t){function e(e,i){t.call(this,new p(e),new T,i),this.builder=new I(this),this.renderer=this.events.addElement(new P(this)),this.scrolling=this.events.addElement(new M(this)),this.selection=this.events.addElement(new r(this)),this.events.addElement(new D(this)),this.events.addElement(new o(this)),this.events.addElement(new l.Highlights(this)),this.scrollButtons=this.events.addElement(new u(this)),this.finalInitialize(),this.scrolling.setState(this.settings.navigation.initialDrilldown,this.settings.navigation.initialOffset,0,"init")}return n(e,t),e.prototype.createDataObj=function(t){return new a.Data(this,t,!0)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e.prototype.onSettingsChanged=function(t){var e={settings:!0,settingsChanges:t,items:!1};t.navigation&&this.scrolling.setState(this.settings.navigation.initialDrilldown,this.settings.navigation.initialOffset,null,"api"),(t.series||t.interaction)&&(e.items=!0),this.events.notifySceneChanges(e),(t.data||t.facetAxis)&&this.updateSize(!0)},e.prototype.updateFilters=function(){return this.updateFilter(!0)},e.prototype.updateFilter=function(t){void 0===t&&(t=!1),this.log("Update filter");var e={};for(var i in this.settings._computedDataMap)e[i]=!0;this.events.notifySceneChanges({data:e,dataDeep:t})},e.prototype.setSelection=function(t,e){void 0===e&&(e="api"),this.log("Set selection");for(var i=[],n=[],s=0;s<t.length;s++){var r=t[s];r instanceof L?i.push(r):d.Helpers.isString(r)?n.push(r):this.error("SetSelection: Selection contents must be FacetChart.Item object or string, got "+typeof r)}this.selection.setSelection(i,n,!1,e)},e.prototype.exportVisibleData=function(){var t=this.scene.peek();return t?a.Data.exportValues(t.data):[]},e.prototype.setPie=function(t,e,i,n){void 0===i&&(i=null),void 0===n&&(n=!0),this.log("Set pie"),this.scrolling.setState(t,e,i,"api")},e.prototype.getPie=function(){return this.scrolling.getState().idArray},e.prototype.getPieOffset=function(){return this.scrolling.getState().offset},e.prototype.getActiveItems=function(){for(var t=[],e=0;e<this.scene.stack.length;e++){var i=this.scene.stack[e];i.parentItem&&t.push(i.parentItem)}return t},e.prototype.getActiveFacets=function(){return this.scene.stack},e.prototype.zoomOut=function(t,e){void 0===t&&(t=!0),void 0===e&&(e="api"),this.scrolling.goUp(e)},e.prototype.zoomOutPossible=function(){var t=this.scene;return t.length()>1||t.peek().offset>0},e.prototype.getBottomHeight=function(){return this.scene.chartHeight-this.settings.facetAxis.size},e.prototype.expandItem=function(t,e){var i=t.facet;if(i===this.scene.peek()){var n=t.id;if(t.expandable&&this.scene.mainData.canExpand(n))return this.setSelection([]),this.scrolling.drillDown(n,e),!0}return!1},e.prototype.saveNavigation=function(){var t=this.scene.peek();return!t||this.scrolling.isActive()?null:this.scrolling.getState()},e.prototype.restoreNavigation=function(t,e,i){return this.scrolling.setState(t.idArray,t.offset,t.count,i)},e.prototype.save=function(){for(var t=this.scene.selectionIds.splice(0),e=0;e<this.scene.selection.length;e++){var i=this.scene.selection[e];t.push(i.id)}var n=this.scrolling.getState();return JSON.stringify({pie:n.idArray,offset:n.offset,count:n.count,selection:t})},e.prototype.restore=function(t,e){if(t){var i=JSON.parse(t);this.setPie(i.pie,i.offset,i.count,e),this.setSelection(i.selection)}},e.prototype.createEventArguments=function(t,e,i){var n=this.scene,s=n.peek(),r=i?i.facet:null,a=n.hoverSeriesItem,o=a&&null!=a.seriesIndex?n.settings._computedSeries[a.seriesIndex]:null;return{chart:this.api,origin:e,facet:s,offset:s?s.offset:null,count:s?s.count:null,hoverItem:n.hoverItem,hoverSeries:o,hoverMarker:!!a&&a.isMarker,selection:n.selection.slice(),clickItem:i,clickFacet:r}},e.prototype.defaultClick=function(t,e){var i=e.clickItem;i&&(i.url?(d.Helpers.openUrl(i.url,i.urlTarget),t.preventDefault()):this.expandItem(i,"user")&&t.preventDefault())},e}(l.Impl);t.Impl=F}(r),function(e){function s(t){return t?t.properties&&t.properties.id&&d.Helpers.isString(t.properties.id)?t.properties.id:t.id:null}function r(t){if(!Array.isArray(t))return"GeoJSON LineString data contained invalid coordinate collection.";if(t.length<2)return"GeoJSON LineString data must contain at least 2 points.";for(var e=new Array(2*t.length),i=0;i<t.length;i++){var n=t[i];if(!n||!d.Helpers.isNumber(n[0])||!d.Helpers.isNumber(n[1]))return"GeoJSON LineString data contained invalid coordinates.";e[2*i]=n[0],e[2*i+1]=n[1]}return e}function a(t,e){if(!Array.isArray(t))return"GeoJSON Polygon data contained invalid coordinate collection.";if(t.length<1)return"GeoJSON Polygon data doesn't contain any LinearRings.";for(var i=0;i<t.length;i++){var n=r(t[i]);if(d.Helpers.isString(n))return n;e.push(n)}return null}function o(t){return d.Helpers.isNumber(t[0])&&d.Helpers.isNumber(t[1])?[t[0],t[1]]:"GeoJSON data contained invalid coordinates."}function l(t){var e=[],i=a(t.coordinates,e);return i?i:e}function h(t){var e=t.coordinates;if(!Array.isArray(e))return"GeoJSON MultiPolygon data contained invalid coordinates";if(e.length<1)return"GeoJSON MultiPolygon data doesn't contain any Polygons.";for(var i=[],n=0;n<e.length;n++){var s=a(e[n],i);if(s)return s}return i}function c(t){var e=r(t.coordinates);return d.Helpers.isString(e)?e:[e]}function p(t){var e=t.coordinates;if(!Array.isArray(e))return"GeoJSON MultiLineString data contained invalid coordinates";if(e.length<1)return"GeoJSON MultiLineString data doesn't contain any lines.";for(var i=new Array(e.length),n=0;n<e.length;n++){var s=r(e[n]);if(d.Helpers.isString(s))return s;i[n]=s}return i}function f(t,e,i,n,r,a){d.Helpers.isString(e)?a(e,n):t.push({_x:0,_y:0,id:s(n),loaded:!0,coordinates:e,type:i,shapeFeature:n,shapeGeometry:r})}function g(t,e,i,n){if(!Array.isArray(e.coordinates))return void n("GeoJSON data contained invalid object.",i);switch(e.type){case"Point":f(t,o(e.coordinates),"point",i,e,n);break;case"MultiPoint":var s=e;if(Array.isArray(s.coordinates))for(var r=0;r<s.coordinates.length;r++)f(t,o(s.coordinates[r]),"point",i,e,n);else n("GeoJSON data contained invalid MultiPoint object.",i);break;case"LineString":f(t,c(e),"line",i,e,n);break;case"MultiLineString":f(t,p(e),"line",i,e,n);break;case"Polygon":f(t,l(e),"polygon",i,e,n);break;case"MultiPolygon":f(t,h(e),"polygon",i,e,n);break;default:return void n('GeoJSON data contained unknown object with type "'+e.type+'" .',i)}}function m(t,e,i,n){if("GeometryCollection"===e.type){var s=e;if(Array.isArray(s.geometries))for(var r=0;r<s.geometries.length;r++)m(t,s.geometries[r],i,n);else n("GeoJSON data contained invalid GeometryCollection object.",i)}else g(t,e,i,n)}function v(t,e,i){return e.geometry&&"Feature"===e.type?void m(t,e.geometry,e,i):void i("GeoJSON data contained invalid feature object.",e)}function y(t,e,i){if(!Array.isArray(e.features)||"FeatureCollection"!==e.type)return void i("GeoJSON data contained invalid FeatureCollection object.",null);for(var n=0;n<e.features.length;n++)v(t,e.features[n],i)}function S(t,e){function i(t,i){e.error("Error: "+t+" Feature id: '"+s(i)+"'")}if(!t)return[];var n=[];switch(t.type){case"FeatureCollection":y(n,t,i);break;case"Feature":v(n,t,i);break;case"GeometryCollection":m(n,t,null,i);break;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"Polygon":
  54. case"MultiPolygon":g(n,t,null,i);break;default:return void i('GeoJSON data contained unknown object with type "'+t.type+'" .',null)}for(var r={"##default":0},a=0;a<n.length;a++){var o=n[a];null==o.id?o.id="##default"+d.Helpers.SeparatorChar+r["##default"]++:d.Helpers.hasProperty(r,o.id)?o.id+=d.Helpers.SeparatorChar+r[o.id]++:r[o.id]=0}return n}e.convertFromGeoJson=S;var b=function(){function t(t,e,i){this.nodes={},this.links={},this.area=new d.AreaCollection,this.requestedArea=new d.AreaCollection,this.pendingArea=null,this.cacheId=i,this.id=e,this.level=t}return t}();e.DataLayer=b;var C=function(t){function e(){t.apply(this,arguments),this.dataFunction=null,this.preloaded=null,this.prefetchRatio=1,this.bounds=[-180,-85.0511287798,180,85.0511287798],this.wrapLng=!0,this.maxRequestRect=[256,256],this.perBoundsData=!0,this.perZoomData=!1,this.perDrilldownData=!1,this.useGridBasedAggregation=!1,this.aggregationGridSize=100,this.aggregationMinCount=5}return n(e,t),e}(u.SettingsData);e.SettingsData=C;var x=function(t){function e(e,i){var n=this;t.call(this,e,i),this.layers={},this.pendingLayers=[],this.nextId=0,this.aggregationGridSize=1,this.zoomLevel=null,this.projectFun=function(t,e){return n.chart.scene.project(t,e)},this.unprojectFun=function(t,e){return n.chart.scene.unproject(t,e)};var s=this.projectFun(this.dataSettings.bounds[0],this.dataSettings.bounds[1]),r=this.projectFun(this.dataSettings.bounds[2],this.dataSettings.bounds[3]);this.projectedBounds=new d.Rect(Math.min(s.x,r.x),Math.min(s.y,r.y),Math.max(s.x,r.x),Math.max(s.y,r.y))}return n(e,t),e.prototype.getProjectedBounds=function(){return this.projectedBounds},e.prototype.setViewParams=function(t,e,i,n,s){this.dataSettings.perZoomData?this.zoomLevel=e:this.zoomLevel=null,this.aggregationGridSize=t,this.loadDataArea=this.buildRectArea(s),this.returnDataArea=this.buildRectArea(n),this.visibleArea=this.buildRectArea(i),this.pendingLayers=[]},e.prototype.getLayer=function(t){var e="",i=null;t&&(e+=""+t),null!==this.zoomLevel&&(e+="#z"+this.zoomLevel,i=this.zoomLevel);var n;return n=this.layers.hasOwnProperty(e)?this.layers[e]:this.layers[e]=new b(i,t,e),this.lastLayer=n,n},e.prototype.getData=function(t){var e,i=this.getLayer(t);i.area.coversArea(this.loadDataArea)?(i.pendingArea=new d.AreaCollection,e=!1):i.requestedArea.coversArea(this.loadDataArea)?e=this.hasPendingRequests():(i.pendingArea=this.loadDataArea.makeCopy().subtractArea(i.requestedArea),i.pendingArea.isEmpty()||(this.pendingLayers.indexOf(i)<0&&this.pendingLayers.push(i),this.scheduleRequests(!0)),e=this.hasPendingRequests());var n=this.applyFilters(i,this.returnDataArea);return this.chart.log("Data: returned "+n.nodes.length+" nodes and "+n.links.length+" links for ID: "+t+", loading="+e),{nodes:n.nodes,links:n.links,hasData:i.area.intersectsArea(this.visibleArea),loading:e}},e.prototype.applyFilters=function(t,e){var i,n,s=e.toRects(),r=this.settings.filters.nodeFilter,a=[],o=[],l={};for(var h in t.nodes){var u=t.nodes[h],c=u._bounds,d=!r||r(u);if(d)for(i=0;i<s.length;i++)if(n=s[i],n.overlapsRect(c.x0,c.y0,c.x1,c.y1)){a.push(u),l[h]=!0;break}}for(var h in t.links){var p=t.links[h],f=l[p.from],g=l[p.to];if(f||g)o.push(p),f||(l[p.from]=!0,a.push(t.nodes[p.from])),g||(l[p.to]=!0,a.push(t.nodes[p.to]));else{var m=t.nodes[p.from],v=t.nodes[p.to];if(m._x&&v._x){var y=m._x,S=m._y,b=v._x,C=v._y;for(i=0;i<s.length;i++)if(n=s[i],n.intersectsSegment(y,S,b,C)){a.push(m),a.push(v),l[p.from]=!0,l[p.to]=!0;break}}}}return{nodes:a,links:o}},e.prototype.unprojectRect=function(t){var e=this.unprojectFun(t.x0,t.y0),i=this.unprojectFun(t.x1,t.y1);return new d.Rect(Math.min(e.lng,i.lng),Math.min(e.lat,i.lat),Math.max(e.lng,i.lng),Math.max(e.lat,i.lat))},e.prototype.projectRect=function(t){var e=this.projectFun(t.x0,t.y0),i=this.projectFun(t.x1,t.y1);return new d.Rect(Math.min(e.x,i.x),Math.min(e.y,i.y),Math.max(e.x,i.x),Math.max(e.y,i.y))},e.prototype.buildRectArea=function(t){var e=this.projectedBounds,i=t.x0,n=t.y0,s=t.x1,r=t.y1,a=new d.AreaCollection;if(n=Math.max(n,e.y0),r=Math.min(r,e.y1),this.dataSettings.wrapLng){var o=e.x1-e.x0;if(s-i>o)i=e.x0,s=e.x1;else{for(;i<e.x0;)i+=o,s+=o;for(;i>e.x1;)i-=o,s-=o}s<=e.x1?a.addRect(new d.Rect(i,n,s,r)):(a.addRect(new d.Rect(i,n,e.x1,r)),a.addRect(new d.Rect(e.x0,n,s-o,r)))}else a.addRect(t.clone().clip(e));return a},e.prototype.buildRequest=function(){if(this.pendingLayers.length>0){var t=this.pendingLayers[0],e=t.pendingArea.findOverlappingRect(this.dataSettings.maxRequestRect[0],this.dataSettings.maxRequestRect[1]);t.pendingArea.subtractRect(e),t.pendingArea.isEmpty()&&d.Helpers.removeFromArray(this.pendingLayers,t);var i=e,n=[],s=[];if(this.dataSettings.useGridBasedAggregation){var r=this.buildAggregationRequest(e);i=r.rectangle,n=r.xcuts,s=r.ycuts}t.requestedArea.addRect(i);var a=this.unprojectRect(i);return{id:t.id,layerId:t.cacheId,west:a.x0,north:a.y1,east:a.x1,south:a.y0,zoom:this.zoomLevel,aggregateLat:s,aggregateLng:n,aggregateMinItems:this.dataSettings.aggregationMinCount}}return null},e.prototype.buildAggregationRequest=function(t){for(var e=this.aggregationGridSize,i=Math.floor(t.x0/e)*e,n=Math.ceil(t.x1/e)*e,s=Math.floor(t.y0/e)*e,r=Math.ceil(t.y1/e)*e,a=this.dataSettings.bounds[0],o=this.dataSettings.bounds[1],l=this.dataSettings.bounds[2],h=this.dataSettings.bounds[3],u=[],c=[],p=i;p<=n;p+=e)u.push(Math.min(Math.max(this.unprojectFun(p,s).lng,a),l));for(var f=s;f<=r;f+=e)c.push(Math.min(Math.max(this.unprojectFun(i,f).lat,o),h));return{rectangle:new d.Rect(i,s,n,r),xcuts:u,ycuts:c}},e.prototype.dataFunc=function(t,e,i){var n=this.dataSettings;if(n.dataFunction)n.dataFunction(t,e,i);else if(n.url){var s=[["id",t.id],["south",t.south.toString(10)],["west",t.west.toString(10)],["north",t.north.toString(10)],["east",t.east.toString(10)]];(t.aggregateLat.length||t.aggregateLng.length)&&(s.push(["aggregateLat",t.aggregateLat.join(",")]),s.push(["aggregateLng",t.aggregateLng.join(",")]),s.push(["aggregateMinItems",t.aggregateMinItems.toString(10)])),null!==t.zoom&&s.push(["zoom",t.zoom.toString(10)]),d.Data.doRequest(n.url,n,s,e,i)}else i({error:"Chart configuration does not define data retrieval function"})},e.prototype.verifyData=function(t,e){"geojson"===this.dataSettings.format.toLowerCase()&&(e.nodes=S(e,this.chart));var i=!0;e.hasOwnProperty("nodes")||(e.nodes=[]),e.hasOwnProperty("links")||(e.links=[]);var n=d.Helpers.tryParseFloat(e.west,t?t.west:1/0),s=d.Helpers.tryParseFloat(e.east,t?t.east:-(1/0)),r=d.Helpers.tryParseFloat(e.north,t?t.north:1/0),a=d.Helpers.tryParseFloat(e.south,t?t.south:-(1/0));e._bounds=new d.Rect(n,a,s,r);for(var o={},l=0;l<e.nodes.length;l++){var h=e.nodes[l];if(Array.isArray(h.coordinates)||(this.chart.error("Data response: Node has no coordinates, or not an array"),i=!1),h.aggregate)d.Helpers.isNumber(h.count)||(this.chart.error("Aggregated node needs `count` field that contains a number."),i=!1);else if(h.hasOwnProperty("id")){var u=h.id.toString();o.hasOwnProperty(u)&&this.chart.error("Data response: Multiple nodes with same id: "+u),o[u]=!0}else this.chart.error("Data response: Node without ID"),i=!1}for(var c={},p=0;p<e.links.length;p++){var f=e.links[p];f.hasOwnProperty("id")?c.hasOwnProperty(f.id)&&this.chart.error("Data response: Multiple links with the same ID: "+f.id):f.id=d.Helpers.SeparatorChar+(this.nextId++).toString(10),o[f.from]||o[f.to]||this.chart.error("Data response: Returned link that does not match any node: "+f.id),c[f.id]=!0}return i},e.prototype.addVerifiedData=function(t,e){var i,n;t?(n=t.id,i=t.layerId):(i="",n="");var s,r,a=this.layers[i];if(a||(a=this.getLayer(n)),e.clearCache)a.nodes={},a.links={},a.area=new d.AreaCollection,a.area.addRect(this.projectedBounds);else if(e._bounds.x0!==1/0){var o=this.projectRect(e._bounds);for(var l in a.nodes)s=a.nodes[l],o.overlaps(s._bounds)&&delete a.nodes[l];for(var l in a.links)r=a.links[l],a.nodes[r.from]&&a.nodes[r.to]||delete a.links[l];a.area.addRect(o)}else a.area.addRect(this.projectedBounds);for(var h={},u=0;u<e.nodes.length;u++)s=e.nodes[u],s.loaded=!0,s.aggregate?(s.id=d.Helpers.SeparatorChar+this.nextId,this.nextId++,a.nodes[s.id]=s):(h[s.id]=!0,a.nodes.hasOwnProperty(s.id)?d.Helpers.extendDeep(a.nodes[s.id],s):a.nodes[s.id]=s),s.coordinates&&(Array.isArray(s.coordinates[0])?this.prepareShape(s):this.preparePoint(s));for(var c={},p=0;p<e.links.length;p++)r=e.links[p],c[r.id]=!0,a.links[r.id]=r;var f={};f[n||""]={nodes:h,links:c};var g={};return g[this.dataSettings.id]=f,{geoChartDataNodesIds:g}},e.prototype.prepareShape=function(t){for(var e=[],i=d.Rect.createEmpty(),n=0;n<t.coordinates.length;n++){var s=t.coordinates[n],r=this.projectLineString(s,i);e.push(r)}t._bounds=i,t._coordinates=e},e.prototype.preparePoint=function(t){if(2!==t.coordinates.length)return void this.chart.error("Point coordinates must be an array of two numbers.");var e=t.coordinates,i=e[0],n=e[1],s=this.projectFun(i,n);t._x=s.x,t._y=s.y,t._bounds=new d.Rect(s.x,s.y,s.x,s.y)},e.prototype.projectLineString=function(t,e){for(var i=[],n=0;n<t.length-1;n+=2){var s=this.projectFun(t[n],t[n+1]);i.push(s.x),i.push(s.y),e.addPoint(s.x,s.y)}return i},e.prototype.exportAreas=function(){var t=this.lastLayer.area.toRects(),e=this.lastLayer.requestedArea.toRects(),i=this.lastLayer.pendingArea.toRects();return this.projectRects(t),this.projectRects(e),this.projectRects(i),{areasRects:t,reqAreasRects:e,pendingAreasRects:i}},e.prototype.projectRects=function(t){for(var e=0;e<t.length;e++){var i=t[e],n=this.projectFun(i.x0,i.y0);if(i.x0=n.x,i.y0=n.y,n=this.projectFun(i.x1,i.y1),i.x1=n.x,i.y1=n.y,i.y1<i.y0){var s=i.y0;i.y0=i.y1,i.y1=s}}},e}(d.Data);e.Data=x,e.Leaflet=null,"undefined"!=typeof L&&(e.Leaflet=L);var w=function(){function t(t,e,i){var n=this;this.layers=i,this.chartContainer=e,this.chart=t,this.wasDragged=null,this.wasZoomed=!1,this.translate=null,this.updatePosDelegate=function(){return n.updatePos()},this.onZoomDelegate=function(t){return n.onZoom(t)},this.viewResetDelegate=function(){return n.viewReset()},this.userActionEndDelegate=function(){return n.userActionEnd()},this.userActionStartDelegate=function(){return n.userActionStart()}}return t.prototype.onAdd=function(t){this.map=t,t.getPanes().overlayPane.appendChild(this.chartContainer),t.on("move",this.updatePosDelegate,this),t.on("zoomanim",this.onZoomDelegate,this),t.on("viewreset",this.viewResetDelegate,this),t.on("moveend",this.userActionEndDelegate,this),t.on("movestart",this.userActionStartDelegate,this)},t.prototype.onRemove=function(t){t.getPanes().overlayPane.removeChild(this.chartContainer),t.off("move",this.updatePosDelegate,this),t.off("zoomanim",this.onZoomDelegate,this),t.off("viewreset",this.viewResetDelegate,this),t.off("moveend",this.userActionEndDelegate,this),t.off("movestart",this.userActionStartDelegate,this)},t.prototype.userActionStart=function(){this.wasDragged=!0},t.prototype.userActionEnd=function(){var t;t=this.wasDragged===!0?"user":null===this.wasDragged?"init":"api",this.chart.notifyChartUpdate(t),this.wasDragged=!1},t.prototype.viewReset=function(){this.updatePos(),this.userActionEnd()},t.prototype.setTranslate=function(){null!==this.translate&&(this.chartContainer.style[e.Leaflet.DomUtil.TRANSFORM]=this.translate,this.translate=null)},t.prototype.updatePos=function(){if(this.map){var t=this.map.options.crs,i=this.chart.scene;this.offset=this.map.containerPointToLayerPoint(e.Leaflet.point(0,0)),this.chartContainer.setAttribute("class"," "),this.translate=e.Leaflet.DomUtil.getTranslateString(this.offset);var n=this.map.getPixelBounds(),s=t.transformation.untransform(n.min,t.scale(this.map.getZoom()));s=t.transformation.transform(s,t.scale(0));var r=t.transformation.untransform(n.max,t.scale(this.map.getZoom()));r=t.transformation.transform(r,t.scale(0));var a=this.map.getZoom();a!==i.zoomLevel&&(i.zoom=Math.pow(2,a),i.zoomLevel=a,this.wasZoomed=!0),i.centerX=(r.x+s.x)/2,i.centerY=(r.y+s.y)/2,this.chart.events&&!this.layers.resizing&&(this.wasZoomed?(this.chart.events.notifySceneChanges({zoom:!0,position:!0}),this.wasZoomed=!1):this.chart.events.notifySceneChanges({position:!0}))}},t.prototype.onZoom=function(t){var i=this.map.getZoomScale(t.zoom),n=this.map.latLngToLayerPoint(t.center).subtract(this.map.containerPointToLayerPoint(this.map.getSize().divideBy(2))),s=n.multiplyBy(-i).add(this.offset);this.chartContainer.setAttribute("class"," leaflet-zoom-animated"),this.translate=e.Leaflet.DomUtil.getTranslateString(s)+" scale("+i+") ",this.setTranslate(),this.wasZoomed=!0},t}(),A=function(){function t(){this.enabled=!0,this.type="tile",this.url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",this.params={subdomains:"abcd",attribution:'&copy; <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://cartodb.com/attributions" target="_blank">CartoDB</a>'}}return t}();e.SettingsBackground=A;var T=function(t){function i(e){var i=this;t.call(this,e),this.animationOrder=100,this.resizing=!1,this._focusHandler=function(){return i.containerOnFocusChange()}}return n(i,t),i.prototype.createDom=function(n){var s=this;t.prototype.createDom.call(this,n),this.leafletContainer=d.Helpers.createDom("div","DVSL-leaflet",null,null),this.container.insertBefore(this.leafletContainer,this.canvas),this.container.removeChild(this.canvas),this.container.removeChild(this.outerBorder),this.container.removeChild(this.interactionContainer),this.interactionContainer.appendChild(this.canvas),this.canvas.style.position="static",this.outerBorder=null,this.menuContainer.className="DVSL-menu-container",this.itemLayer=new w(this.chart,this.interactionContainer,this),i.setContainerStyle(this.leafletContainer),this.chart.scene.project=function(t,e){return s.projectFunc(t,e)},this.chart.scene.unproject=function(t,e){return s.unprojectFunc(t,e)},null!=e.Leaflet?this.createMap():this.chart.assetsLoader.ensureAssetsList(["assets://leaflet.js"],function(t){return s.leafletLoaded(t)}),d.Helpers.listen(this.interactionContainer,"focus",this._focusHandler),d.Helpers.listen(this.interactionContainer,"blur",this._focusHandler),d.Helpers.listen(this.leafletContainer,"focus",this._focusHandler),d.Helpers.listen(this.leafletContainer,"blur",this._focusHandler)},i.prototype.containerOnFocusChange=function(){if(this.map){var t=d.Helpers.isParentOf(this.container,document.activeElement),e=this.map.scrollWheelZoom;t||!this.chart.settings.advanced.pointer.mouseWheelRequiresFocus?e.enable():e.disable()}},i.prototype.leafletLoaded=function(t){if(!this.removed){if("undefined"==typeof L)throw new Error("`leaflet.js` was loaded but the global variable `L` was not found. Please make sure that `L.noConflict()` is not called.");e.Leaflet=L,this.createMap(),t&&this.chart.notifyChartUpdate("api")}},i.prototype.ensureMap=function(){if(!this.map)throw new Error("This method is only available after leaflet.js has been loaded.")},i.prototype.createMap=function(){var t=this.chart.settings.navigation,i={maxZoom:t.maxZoom,minZoom:t.minZoom,worldCopyJump:!1};this.map=e.Leaflet.map(this.leafletContainer,i),this.map.attributionControl.setPrefix("");var n=t.maxBounds;this.map.setMaxBounds(new e.Leaflet.LatLngBounds(new e.Leaflet.LatLng(n.south,n.west),new e.Leaflet.LatLng(n.north,n.east))),this.createMapBackground(),this.map.addLayer(this.itemLayer),this.crs=this.map.options.crs,this.containerOnFocusChange(),this.chart.domLayerCreated()},i.prototype.createMapBackground=function(){var t=this.map,i=this.tileLayer;i&&(t.removeLayer(i),i=null);var n=this.scene.settings.background;n.enabled&&("tile"===n.type?(i=e.Leaflet.tileLayer(n.url,n.params),t.addLayer(i)):"wms"===n.type&&(i=e.Leaflet.tileLayer.wms(n.url,n.params),t.addLayer(i))),this.tileLayer=i},i.prototype.onSceneChange=function(t){this.itemLayer.setTranslate()},i.prototype.remove=function(){this.removed=!0,d.Helpers.unlisten(this.interactionContainer,"focus",this._focusHandler),d.Helpers.unlisten(this.interactionContainer,"blur",this._focusHandler),d.Helpers.unlisten(this.leafletContainer,"focus",this._focusHandler),d.Helpers.unlisten(this.leafletContainer,"blur",this._focusHandler),this.map&&this.map.remove(),this.map=null},i.prototype.updateSettings=function(i){if(t.prototype.updateSettings.call(this,i),!this.removed&&this.leafletContainer&&(this.map&&i.background&&this.createMapBackground(),i.navigation&&((i.navigation.minZoom||i.navigation.maxZoom)&&d.Helpers.warn("Changing of navigation.minZoom or navigation.maxZoom with updateSettings() is not yet supported."),this.map&&i.navigation.maxBounds))){var n=i.navigation.maxBounds;this.map.setMaxBounds(new e.Leaflet.LatLngBounds(new e.Leaflet.LatLng(n.south,n.west),new e.Leaflet.LatLng(n.north,n.east)))}},i.prototype.projectFunc=function(t,i){return this.ensureMap(),this.crs.latLngToPoint(new e.Leaflet.LatLng(i,t),0)},i.prototype.unprojectFunc=function(t,i){return this.ensureMap(),this.crs.pointToLatLng(new e.Leaflet.Point(t,i),0)},i.prototype.doAnimations=function(e){if(t.prototype.doAnimations.call(this,e),e.changes.bounds){var i=this.scene;i.x0=i.chartLeft,i.y0=i.chartTop,i.width=i.chartWidth,i.height=i.chartHeight,i.leftMargin=0,i.rightMargin=0,i.topMargin=0,i.bottomMargin=0,this.map&&(this.resizing=!0,this.map.invalidateSize(null),this.resizing=!1),this.interactionContainer.style.width=i.chartWidth+"px",this.interactionContainer.style.height=i.chartHeight+"px"}},i}(d.DomLayer);e.DomLayer=T;var M=function(){function t(){this.enabled=!1,this.distance=60,this.maxZoom=18,this.weightFunction=null}return t}();e.SettingsAggregation=M;var k=function(){function t(t,e,i){this.zoom=e.zoom,this.scene=e,this.settings=t,this.chart=i}return t.orientation=function(t,e,i){var n=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x);return 0===n?0:n>0?1:-1},t.distanceLineToPoint=function(t,e,i){var n=Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y));return Math.abs((i.x-t.x)*(e.y-t.y)-(i.y-t.y)*(e.x-t.x))/n},t.prototype.findMainNodes=function(t,e){var i={},n={},s={},r=d.Helpers.isFunction(this.settings.weightFunction);if(r){for(var a=0;a<t.length;a++)s[t[a].id]=this.settings.weightFunction(t[a]);t.sort(function(t,e){return s[e.id]-s[t.id]})}for(var o,l,h,u=this.zoom/(this.settings.distance/2),c=[],p={},a=0;a<t.length;a++){var f=t[a],g=Math.floor(f._x*u),m=Math.floor(f._y*u);if(o=n[g]||(n[g]={}),void 0===o[m]&&void 0===o[m-1]&&void 0===o[m+1]&&(l=n[g-1]||(n[g-1]={}),void 0===l[m]&&void 0===l[m-1]&&void 0===l[m+1]&&(h=n[g+1]||(n[g+1]={}),void 0===h[m]&&void 0===h[m-1]&&void 0===h[m+1]))){o[m]=c.length,o[m+1]=c.length,o[m-1]=c.length,l[m]=c.length,l[m+1]=c.length,l[m-1]=c.length,h[m]=c.length,h[m+1]=c.length,h[m-1]=c.length;var v=r?s[f.id]||0:1,y={id:"__aggr_"+f.id,aggregatedWeight:v,_originalWeight:v,_x:f._x,_y:f._y,_bounds:f._bounds,aggregatedNodes:[f],loaded:!0};c.push(y),i[f.id]=y,p[a]=!0}}for(var S=[],a=0;a<t.length;a++)if(!p[a]){var f=t[a],g=Math.floor(f._x*u),m=Math.floor(f._y*u),b=c[n[g][m]];if(!b){o=n[g]||(n[g]={}),l=n[g-1]||(n[g-1]={}),h=n[g+1]||(n[g+1]={}),S.push(o[m]),S.push(o[m-1]),S.push(o[m+1]),S.push(l[m]),S.push(l[m-1]),S.push(l[m+1]),S.push(h[m]),S.push(h[m-1]),S.push(h[m+1]);for(var C=1/0;S.length>0;){var x=S.pop();if(void 0!==x){var w=c[x],L=(w._x-f._x)*(w._x-f._x)+(w._y-f._y)*(w._y-f._y);L<C&&(C=L,b=w)}}}var A=r?s[f.id]||0:1;(b.aggregatedWeight>0||A>0)&&(b._x=(b._x*b.aggregatedWeight+f._x*A)/(b.aggregatedWeight+A),b._y=(b._y*b.aggregatedWeight+f._y*A)/(b.aggregatedWeight+A)),b._originalWeight<A&&(b._originalWeight=A,b.id="__aggr_"+f.id),i[f.id]=b,b.aggregatedNodes.push(f),b.aggregatedWeight+=A}for(var a=0;a<c.length;a++){var f=c[a],T=this.scene.unproject(f._x,f._y);f.coordinates=[T.lng,T.lat]}if(this.settings.postProcessAggregatedNodes){var M=[];this.settings.postProcessAggregatedNodes(c,i,M);for(var a=0;a<M.length;a++){var f=M[a],k=this.scene.project(f.coordinates[0],f.coordinates[1]);f._x=k.x,f._y=k.y}}var P=this.aggregateLinks(e,i);return this.findConvexShapes(c),{nodes:c,links:P}},t.prototype.aggregateLinks=function(t,e){for(var i=[],n={},s=0;s<t.length;s++){var r=t[s],a=e[r.from],o=e[r.to];if(a)if(o){var l=void 0,h=a.id+"-"+o.id;d.Helpers.hasProperty(n,h)?n[h].aggregatedLinks.push(r):(l={id:h,from:a.id,to:o.id,aggregatedLinks:[r]},i.push(l),n[h]=l)}else this.chart.error("Link with ID '"+r.id+"' specifies non existant end node: '"+r.to+"'");else this.chart.error("Link with ID '"+r.id+"' specifies non existant start node: '"+r.from+"'")}return i},t.prototype.findConvexShapes=function(e){for(var i=0;i<e.length;i++){for(var n=[],s=e[i].aggregatedNodes,r=s[0],a=s[0],o=1;o<s.length;o++){var l=s[o];l._x<=r._x&&(r=s[o]),l._x>=a._x&&(a=s[o])}for(var h=[],u=[],o=0;o<s.length;o++){var l=s[o];if(null!=l){var c=t.orientation({x:r._x,y:r._y},{x:a._x,y:a._y},{x:l._x,y:l._y});c>0?h.push(l):c<0&&u.push(l)}}var d=[r],p={};n=[],this.separateOuterPoints(r,a,u,n,p),d=d.concat(n.sort(function(t,e){return t._x-e._x})),d.push(a),n=[],this.separateOuterPoints(a,r,h,n,p),d=d.concat(n.sort(function(t,e){return e._x-t._x})),e[i].convexShape=d}},t.prototype.separateOuterPoints=function(e,i,n,s,r){if(0!==n.length){if(1===n.length)return r[n[0].id]=1,void s.push(n[0]);for(var a=0,o=null,l=0;l<n.length;l++){var h=n[l],u=t.distanceLineToPoint({x:e._x,y:e._y},{x:i._x,y:i._y},{x:h._x,y:h._y});u>a&&(a=u,o=h)}r[o.id]||(s.push(o),r[o.id]=1);for(var c=[],d=[],l=0;l<n.length;l++){var h=n[l];if(!r[h.id]){var p=t.orientation({x:e._x,y:e._y},{x:o._x,y:o._y},{x:h._x,y:h._y});0!==p&&p<0&&d.push(h);var f=t.orientation({x:o._x,y:o._y},{x:i._x,y:i._y},{x:h._x,y:h._y});0!==f&&f<0&&c.push(h)}}this.separateOuterPoints(e,o,d,s,r),this.separateOuterPoints(o,i,c,s,r)}},t.prototype.aggregate=function(t,e){if(this.zoom>Math.pow(2,this.settings.maxZoom)){var i=[],n=[],s=d.Helpers.isFunction(this.settings.weightFunction),r=void 0;for(r=0;r<t.length;r++){var a=t[r];i.push({id:"__aggr_"+a.id,aggregatedWeight:s?this.settings.weightFunction(a):1,_x:a._x,_y:a._y,_bounds:a._bounds,coordinates:a.coordinates,aggregatedNodes:[a],loaded:!0})}for(r=0;r<e.length;r++){var o=e[r];n.push({from:"__aggr_"+o.from,to:"__aggr_"+o.to,id:"__aggr_"+o.from+"-__aggr_"+o.to,aggregatedLinks:[o]})}return{nodes:i,links:n}}return this.findMainNodes(t,e)},t}();e.Aggregation=k;var P=function(t){function e(i){t.call(this,d.SettingsMapping.GeoChartSettings),this._computedLayers=[],this.theme=e.FlatTheme,this.area=new I,this.background=new A,this.data=[],this.style={fadeTime:200,selection:{fillColor:"rgba(200, 200, 255 ,0.7)",sizeConstant:5,sizeProportional:.2}},this.layerTypes={shapes:{type:"shapes"},items:{type:"items",style:{item:{hoverEffect:!1,zIndex:0}}},aggregateOnShapes:{type:"aggregateOnShapes"},charts:{type:"charts"}},this.layersDefault=null,this.layers=[],this.navigation={initialLat:40,initialLng:25,initialZoom:3,minZoom:0,maxZoom:18,maxBounds:{west:-200,north:-85,east:200,south:85},initialDrilldown:[""],drilldownLayer:"default"},this.filters={nodeFilter:null},this.interaction=new R,this.toolbar=new d.SettingsToolbar(!1,[new d.SettingsToolbarItem("fullscreen")],"bottom","left"),this.advanced.assets.push({url:"assets://leaflet.css",required:function(){return!d.Helpers.isStyleSheetDefined("leaflet-tile","visibility")}}),this.area.defaultHeight=500,this.advanced.style.loadingArcStyle.r=15,this.advanced.style.loadingArcStyle.lineColor="red",this.advanced.style.loadingArcStyle.lineWidth=7,this.apply(i),this._initializing=!1}return n(e,t),e.prototype.apply=function(e){this.applyCompatibility(e,[{from:"layersDefault",alternative:"layerTypes"}]);var i=t.prototype.apply.call(this,e);return(this._initializing||i.layers||i.layerTypes)&&(this._computedLayers=d.SettingsHelper.mergeDefaultValues(this.layers,this.layersDefault,this.layerTypes,N.createInstance,N.getMapping,"layers")),i},e.FlatTheme={advanced:{themeCSSClass:"DVSL-flat"}},e}(u.Settings);e.Settings=P;var I=function(t){function e(){t.apply(this,arguments),this.style=new D}return n(e,t),e}(d.SettingsArea);e.SettingsArea=I;var D=function(t){function e(){t.apply(this,arguments)}return n(e,t),e}(d.SettingsAreaStyle);e.SettingsAreaStyle=D;var F=function(t){function e(){t.call(this),this.aggregatedShape={mode:1,lineColor:"rgba(0,0,128,0.5)",lineWidth:1,fillColor:"rgba(0,0,128,0.3)"},this.scaleObjectsWithZoom=!1,this.node.radius=10,this.node.fillColor="orange",this.node.lineColor="red",this.linkLabel.scaleWithSize=!1,this.linkLabel.scaleWithZoom=!1,this.linkLabel.backgroundStyle.fillColor="white",this.linkLabel.backgroundStyle.lineColor="black",this.nodeLabel.scaleWithSize=!1,this.nodeLabel.scaleWithZoom=!1,this.nodeLabel.backgroundStyle.fillColor="white",this.nodeLabel.backgroundStyle.lineColor="black"}return n(e,t),e}(u.SettingsNodesLayerStyle);e.SettingsNodesLayerStyle=F;var N=function(){function t(){this.enabled=!0,this.id="default",this.name="",this.type="shapes",this.minZoom=0,this.maxZoom=20,this.perZoomStyle=!1,this.data={id:"default"}}return t.getMapping=function(t,e){if(t&&e.type&&t.type!==e.type)throw new Error("It is not possible to change the value of `type` property for an existing layer.");switch(t?t.type:e.type){case"shapes":return d.SettingsMapping.GeoChartSettingsLayerShapes;case"items":return d.SettingsMapping.GeoChartSettingsLayerItems;case"charts":return d.SettingsMapping.GeoChartSettingsLayerCharts;case"aggregateOnShapes":return d.SettingsMapping.GeoChartSettingsLayerAggregated;default:throw new Error("The value '"+e.type+"' is not valid for the `type` property of a layer. Valid values are: shapes, items, charts, aggregateOnShapes.")}},t.createInstance=function(t,e){switch(e||t.type){case"shapes":return new E;case"items":return new z;case"charts":return new _;case"aggregateOnShapes":return new H;default:throw new Error("The value '"+(e||t.type)+"' is not valid for the `type` property of a layer. Valid values are: shapes, items, charts, aggregateOnShapes.")}},t}();e.SettingsLayerBase=N;var E=function(t){function i(){t.call(this),this.style=new e.SettingsShapesLayerStyle,this.type="shapes"}return n(i,t),i}(N);e.SettingsLayerShapes=E;var z=function(t){function e(){t.call(this),this.style=new F,this.aggregation=new M,this.layout=new U,this.auras=new u.SettingsNodesLayerAuras,this.type="items"}return n(e,t),e}(N);e.SettingsLayerItems=z;var O=function(t){function e(){t.apply(this,arguments),this.shapesLayer=null}return n(e,t),e}(N);e.SettingsLayerOverlay=O;var H=function(t){function e(){t.call(this),this.aggregationField=null,this.aggregation="count",this.aggregationFunction=null,this.styleFunction=null,this.type="aggregateOnShapes"}return n(e,t),e}(O);e.SettingsLayerAggregated=H;var _=function(t){function e(){t.call(this),this.chartType="piechart",this.settings=null,this.settingsFunction=null,this.autoSize=!1,this.data={id:null},this.type="charts"}return n(e,t),e}(O);e.SettingsLayerCharts=_;var R=function(t){function e(){t.call(this),this.mode="drilldown",this.nodesMovable=!1,this.selection.enabled=!1}return n(e,t),e}(u.SettingsInteraction);e.SettingsInteraction=R;var B=function(t){function e(e){t.call(this),this.animationOrder=2e3,this.updateOrder=1100,this.scene=null,this.events=null,this.currentObject=null,this.chart=e,this.scene=e.scene,this.events=e.events,this.dragPointers={}}return n(e,t),e.prototype.onPointerMove=function(t){this.updateCurrentObject(t),this.currentObject&&(this.updateCursor(t),t.hovered=!0)},e.prototype.onPointerOut=function(t){this.switchCurrentObject(null,null,t)},e.prototype.onPointerDown=function(t){this.updateCurrentObject(t);var e=this.currentObject;e instanceof u.Node&&(this.updateSelection(t,e,!0),this.updateCursor(t),this.scene.settings.interaction.nodesMovable&&(this.setPointerNode(t,e),t.consumed=!0))},e.prototype.onPointerUp=function(t){this.dragPointers[t.identifier]&&(this.dragPointers[t.identifier].dragging&&(t.consumed=!0,this.updateLastNode(t,this.dragPointers[t.identifier].node)),this.updateCursor(t),this.setPointerNode(t,null))},e.prototype.onPointerCancel=function(t){this.onPointerUp(t)},e.prototype.onPointerDrag=function(t){var e=this.dragPointers[t.identifier];if(e){var i=this.scene.fromDisplay(t.x,t.y),n=i.x,s=i.y;e.mouseX=t.x,e.mouseY=t.y,e.dragging=!0,this.dragNodes(e,n,s,this.scene.settings.interaction.selection.lockNodesOnMove),this.updateCursor(t),t.consumed=!0}},e.prototype.onClick=function(t){this.scene.xyInChart(t.x,t.y)&&((!this.currentObject||!this.scene.settings.interaction.selection.nodesSelectable&&this.currentObject.isNode||!this.scene.settings.interaction.selection.linksSelectable&&this.currentObject.isLink)&&this.updateSelection(t,null,!1),this.chart.notifyClick(t,this.buildEventArgs(t)),t.defaultPrevented&&(t.consumed=!0))},e.prototype.onRightClick=function(t){if(this.scene.xyInChart(t.x,t.y)){var e=this.buildEventArgs(t);this.updateSelection(t,this.currentObject,!1),this.chart.notifyRightClick(t,e),t.defaultPrevented&&(t.consumed=!0)}},e.prototype.onDoubleClick=function(t){this.scene.xyInChart(t.x,t.y)&&(this.chart.notifyDoubleClick(t,this.buildEventArgs(t)),t.defaultPrevented&&(t.consumed=!0))},e.prototype.onTripleClick=function(t){this.scene.xyInChart(t.x,t.y)&&(this.chart.notifyTripleClick(t,this.buildEventArgs(t)),t.defaultPrevented&&(t.consumed=!0))},e.prototype.doAnimations=function(t){for(var e in this.dragPointers){var i=this.dragPointers[e],n=this.scene.fromDisplay(i.mouseX,i.mouseY),s=n.x,r=n.y;this.dragNodes(i,s,r,!1),t.changes.coordinates=!0}},e.prototype.updateSelection=function(t,e,i){this.scene.settings.interaction.selection.enabled&&(t.shiftKey||t.ctrlKey||!(!e||!this.scene.settings.interaction.selection.nodesSelectable&&e.isNode||!this.scene.settings.interaction.selection.linksSelectable&&e.isLink)?e&&t.ctrlKey?(e.selected?this.scene.removeFromSelection(e):this.scene.addToSelection(e),this.notifySelectionChanged("user")):e&&t.shiftKey||i&&e.selected?this.scene.addToSelection(e)&&this.notifySelectionChanged("user"):e&&this.setSelection([e],"user"):this.setSelection([],"user"))},e.prototype.dragNodes=function(t,e,i,n){var s=e+t.x-t.node.x,r=i+t.y-t.node.y;if(0!==s||0!==r){if(this.moveNode(t.node,s,r,n),t.extraNodes&&t.extraNodes.length>0)for(var a=0;a<t.extraNodes.length;a++)this.moveNode(t.extraNodes[a],s,r,n);this.events.notifySceneChanges({coordinates:!0})}},e.prototype.moveNode=function(t,e,i,n){if(t.x+=e,t.y+=i,n&&(t.userLock=!0),!this.scene.settings.interaction.selection.allowMoveNodesOffscreen){var s=this.scene.getVisibleBounds(),r=1.2*t.renderHwidth/this.scene.zoom,a=1.2*t.renderHheight/this.scene.zoom;t.x=Math.min(Math.max(t.x,s.x0+r),s.x1-r),t.y=Math.min(Math.max(t.y,s.y0+a),s.y1-a)}},e.prototype.setPointerNode=function(t,e){var i=t.identifier,n=this.dragPointers[i];if(n){if(n.node.locks--,n.extraNodes&&n.extraNodes.length>0)for(var s=0;s<n.extraNodes.length;s++)n.extraNodes[s].locks--;delete this.dragPointers[i]}if(e){var r=this.scene.fromDisplay(t.x,t.y),a=r.x,o=r.y,l=null;if(!d.Helpers.hasProperties(this.dragPointers)&&this.scene.selection.length>0){l=[];for(var s=0;s<this.scene.selection.length;s++){var h=this.scene.selection[s];h!==e&&h instanceof u.Node&&(h.locks++,l.push(h))}}this.dragPointers[t.identifier]={x:e.x-a,y:e.y-o,node:e,extraNodes:l,mouseX:t.x,mouseY:t.y,dragging:!1},e.locks++}},e.prototype.updateCurrentObject=function(t){if(this.chart.renderer&&this.scene.xyInChart(t.x,t.y)){var e=this.chart.renderer.findObjectAt(t.x,t.y,this.scene.settings.interaction.selection.tolerance);this.switchCurrentObject(e?e.object:null,e?e.details:null,t)}},e.prototype.updateCursor=function(t){this.currentObject&&this.currentObject.cursor?t.cursor=this.currentObject.cursor:t.cursor="default"},e.prototype.switchCurrentObject=function(t,e,i){t===this.currentObject&&e===this.currentItem||(i.changes.current=!0,this.scene.setActiveObject(t,e),this.currentObject=t,this.currentItem=e,this.chart.notifyHoverChanged(i,this.chart.createEventArguments(null,"api")))},e.prototype.buildEventArgs=function(t){var e=this.chart.createEventArguments(t,"user");e.clickItem=this.currentItem;var i=this.currentObject;
  55. return i instanceof u.Node?(e.clickNode=i,this.updateLastNode(t,i)):e.clickLink=i,e},e.prototype.updateLastNode=function(t,e){this.scene.lastClickedNode=e,this.scene.settings.interaction.zooming.autoZoomAfterClick&&(this.scene.autoZoomMode=!0,t.changes.zoom=!0)},e.prototype.setSelection=function(t,e){var i=this.scene.setSelection(t);i&&this.notifySelectionChanged(e)},e.prototype.notifySelectionChanged=function(t){this.events.notifySceneChanges({selection:!0}),this.chart.notifySelectionChanged(this.chart.createEventArguments(null,t))},e}(d.ChartElement);e.Selection=B;var U=function(){function t(){this.mode="static",this.nodeSpacing=3,this.anchorStrength=1}return t}();e.SettingsNodesLayout=U;var V=function(){function t(){}return t}(),G=function(){function t(t,e,i){this.initialLoad=!0,this.scene=t,this.settings=i,this.layer=e,this.random=new d.Random(1)}return t.isNodeLocked=function(t){return t.userLock||t.locks>0||t.anchorMode===u.NodeAnchorMode.Fixed},t.prototype.doAnimations=function(e,n){var s=this,r=!1,a=this.layer.hasTopologyChanges(),o="dynamic"===this.settings.mode;if(o&&"undefined"==typeof i.Chipmunk){if(t.cpRequestInitiated)return;if(this.scene.assetsLoader.loadAssetsList([{url:"assets://cp.js",required:function(){return"undefined"==typeof i.Chipmunk}}],function(){s.layer.events.notifySceneChanges({requestPaint:!0})}))return void(t.cpRequestInitiated=!0)}for(var l=this.layer.nodes(),h=this.layer.getGeometry(),u=0;u<l.length;u+=1){var c=l[u];c.shape.adaptToViewport(h.txm,h.txa,h.tym,h.tya,h.zoom)}if(this.initialLoad&&(a=!0,n=!0),a&&(this.random=new d.Random(1),this.placeNewNodes(o),r=!0),o){this.placeModifiedNodes();var p=this.updateLayout(e.dtime,a,n,e.changes.zoom);p&&(e.animating=!0,r=!0)}else this.placeModifiedNodes(),this.computeNodeAnchorCoordinates();r&&(e.changes.position=!0),this.initialLoad=!1},t.prototype.computeNodeAnchorCoordinates=function(){for(var t=this.layer.getNodesSceneZoom(),e=0,i=this.layer.nodes();e<i.length;e++){var n=i[e],s=n.shape.getAnchor();n.x=n.anchorX-s.x*t,n.y=n.anchorY-s.y*t}},t.prototype.placeNewNodes=function(t){for(var e=this.layer.getNodesSceneZoom(),i=0,n=this.layer.nodes();i<n.length;i++){var s=n[i],r=s.shape.getAnchor();s.anchorX=s.data._x,s.anchorY=s.data._y,null!==s.x&&null!==s.y||(s.x=s.anchorX-r.x*e,s.y=s.anchorY-r.y*e,t&&(s.x+=this.random.get()*e))}},t.prototype.placeModifiedNodes=function(){for(var t in this.layer.modifiedNodes){var e=this.layer.modifiedNodes[t];e.anchorX=e.data._x,e.anchorY=e.data._y}},t.prototype.removeNode=function(t){var e=this.idToState[t.id],i=this.cpSpace;i.removeShape(e.shape),e.locked||(i.removeBody(e.body),i.removeShape(e.anchorShape)),delete this.idToState[t.id]},t.prototype.addNode=function(t,e){var n=new V,s=this.cpSpace,r=this.layer.getNodesSceneZoom(),a=t.shape.getAnchor();if(n.locked=e,this.idToState[t.id]=n,!e){var o=s.addBody(new i.Chipmunk.Body(1,1/0));n.body=o,o.setPos(i.Chipmunk.v(t.x+a.x*r,t.y+a.y*r))}return n},t.prototype.updateLayout=function(e,n,s,r){this.cpSpace||(this.cpSpace=new i.Chipmunk.Space,this.cpSpace.sleepTimeThreshold=1,this.cpSpace.damping=.2,this.idToState={},n=!0);var a=this.cpSpace,o=this.idToState,l=this.settings.nodeSpacing,h=this.settings.anchorStrength,u=this.layer.getNodesSceneZoom();this.zoom=u,this.cpSpace.collisionSlop=2*u,this.cpSpace.idleSpeedThreshold=5*u;var c=this.layer.nodes();if(n){for(var p in this.layer.deletedNodes)this.removeNode(this.layer.deletedNodes[p]);for(var p in this.layer.newNodes){var f=this.layer.newNodes[p];this.addNode(f,t.isNodeLocked(f))}}if(s||n)for(var g=0;g<c.length;g+=1){var f=c[g],m=o[f.id],v=t.isNodeLocked(f),y=null;m&&v===m.locked||(m&&(m.body&&(y=m.body.p),this.removeNode(f)),m=this.addNode(f,v));var S=(Math.max(f.bounds.w(),f.bounds.h())+l)/2*u,b=f.shape.getAnchor(),C=f.anchorX,x=f.anchorY;if(r||m.prevAX!==C||m.prevAY!==x||m.prevR!==S){if(m.locked){var w=m.shape;w&&a.removeShape(w),y||(y=i.Chipmunk.v(C-b.x*u,x-b.y*u)),y.x-=b.x*u,y.y-=b.y*u,w=a.addShape(new i.Chipmunk.CircleShape(a.staticBody,S,y)),m.p=y,w.setElasticity(0),w.setFriction(0),m.shape=w}else{if(m.prevR!==S){var w=m.shape;w&&a.removeShape(w),w=a.addShape(new i.Chipmunk.CircleShape(m.body,S,i.Chipmunk.v(-b.x*u,-b.y*u))),w.setElasticity(0),w.setFriction(0),m.shape=w}if(r||m.prevAX!==C||m.prevAY!==x){var L=m.anchorShape;L&&a.removeShape(L),L=a.addShape(new i.Chipmunk.CircleShape(a.staticBody,2*u,i.Chipmunk.v(C,x))),L.setElasticity(0),L.setFriction(0),m.anchorShape=L}}m.prevAX=C,m.prevAY=x,m.prevR=S}}for(var g=0;g<c.length;g+=1){var f=c[g],m=o[f.id];if(!m.locked){var A=f.anchorX,T=f.anchorY,M=m.body.p.x,k=m.body.p.y,P=m.body,I=M-A,D=k-T,F=P.vx,N=P.vy;I+=.5*F,D+=.5*N;var E=-Math.abs(3*I)*d.Helpers.sign(I),z=0;z=D<0?-2*D:-5*D,P.f=i.Chipmunk.v(E*h,z*h)}}a.step(1/60);for(var O=!0,g=0;g<c.length;g+=1){var f=c[g],m=o[f.id],b=f.shape.getAnchor();m.locked?m.p?(f.x=m.p.x,f.y=m.p.y):(f.x=f.data._x-b.x*u,f.y=f.data._y-b.y*u):(f.x=m.body.p.x-b.x*u,f.y=m.body.p.y-b.y*u,O=O&&m.body.isSleeping())}return!O},t.cpRequestInitiated=!1,t}();e.NodesLayout=G;var W=function(t){function e(e,i,n){t.call(this,e,i,n),this.layout=null,this.hoveredNode=null,this.layout=new G(e.scene,this,i.layout)}return n(e,t),e.prototype.postprocessStyle=function(e){t.prototype.postprocessStyle.call(this,e);var i=e.changes.zoom||this.hasStyleChanges();this.layout.doAnimations(e,i)},e.prototype.paintHoverShape=function(t){var e=this.style.aggregatedShape;switch(e.mode){case 0:break;default:case 1:if(null===this.hoveredNode||!this.hoveredNode.hovered||this.hoveredNode.removed){var i=this.modifiedNodes;this.hoveredNode=null;for(var n in i)if(i[n].hovered){this.hoveredNode=i[n];break}}this.hoveredNode&&this.paintConvex(this.hoveredNode,t,e);break;case 2:for(var s=this.nodes(),r=0;r<s.length;r++){var a=s[r];a.removed||this.paintConvex(a,t,e)}break;case 3:for(var o=this.nodes(),r=0;r<o.length;r++){var a=o[r];!a.removed&&a.selected&&this.paintConvex(a,t,e)}}},e.prototype.paintConvex=function(t,e,i){var n=t.data,s=n.convexShape;if(s&&!(s.length<2)){var r=this.getGeometry(),a={},o=d.Graphics.beginStrokeAndFill(e,i);a[s[0].id]=1,o.moveTo(s[0]._x*r.txm+r.txa,s[0]._y*r.tym+r.tya);for(var l=1;l<s.length;l++)a[s[l].id]=1,o.lineTo(s[l]._x*r.txm+r.txa,s[l]._y*r.tym+r.tya);o.closePath(),d.Graphics.endStrokeAndFill(e,o,i);for(var l=0;l<n.aggregatedNodes.length;l++){var h=n.aggregatedNodes[l];a[h.id]||(o=d.Graphics.beginStroke(e,i),o.arc(h._x*r.txm+r.txa,h._y*r.tym+r.tya,1,0,2*Math.PI,!1),d.Graphics.endStroke(e,o,i))}}},e.prototype.paint=function(e){this.paintHoverShape(e.context),t.prototype.paint.call(this,e)},e}(u.NodesLayer);e.NodesLayer=W;var j=function(t){function e(){t.call(this),this.stack=[],this.zoomLevel=0,this.mainDataEnabled=!1,this.project=null,this.unproject=null}return n(e,t),e.prototype.push=function(t){return this.stack.push(t)},e.prototype.peek=function(){return 0===this.stack.length?null:this.stack[this.stack.length-1]},e.prototype.pop=function(){return 0===this.stack.length?null:this.stack.pop()},e.prototype.getVisibleBoundsLatLon=function(){var t=this.fromDisplay(this.x0,this.y0),e=t.x,i=t.y;t=this.fromDisplay(this.x0+this.width,this.y0+this.height);var n=t.x,s=t.y;return this.unprojectRect(new d.Rect(e,i,n,s))},e.prototype.unprojectRect=function(t){var e=this.unproject(t.x0,t.y0),i=this.unproject(t.x1,t.y1);return new d.Rect(Math.min(e.lng,i.lng),Math.min(e.lat,i.lat),Math.max(e.lng,i.lng),Math.max(e.lat,i.lat))},e}(u.Scene);e.Scene=j;var Y=function(t){function e(){t.apply(this,arguments),this.shapeSimplificationPrecision=1.5,this.node={fillColor:"#c7dae0",lineColor:null,lineWidth:null,radius:30,shadowColor:null,lineDash:null,expandable:!1}}return n(e,t),e}(F);e.SettingsShapesLayerStyle=Y;var q=function(t){function e(e,i){t.call(this,e,i)}return n(e,t),e.prototype.postprocessNode=function(t){t.currentItems=[],t.label,this.postprocessItems(t)},e.prototype.postprocessLink=function(t){var e=[];if(t.label){var i=new d.Label(t.labelStyle);i.text=t.label.toString(),i.style.px=0,i.style.py=0,e.push(i)}t.currentItems=e,this.postprocessItems(t)},e}(u.ItemsStyle);e.ShapesStyle=q;var Z=function(t){function e(e,i){t.call(this,e,i),this.style=i.style}return n(e,t),e.prototype.createStyleUpdater=function(t){return new q(t,this)},e.prototype.paintSelection=function(t,e,i){var n=this.getGeometry(),s=n.txm,r=n.txa,a=n.tym,o=n.tya,l=1/s,h=t.context,u=this.style.selection;h.beginPath();for(var c=0;c<e.length;c++)for(var d=e[c],p=0,f=this.getNodeCoords(d,l);p<f.length;p++){var g=f[p],m=g[0]*s+r,v=g[1]*a+o;h.moveTo(m,v);for(var y=2;y<=g.length-2;y+=2)h.lineTo(g[y]*s+r,g[y+1]*a+o);h.closePath()}h.fillStyle=u.fillColor,h.strokeStyle=u.fillColor,h.lineWidth=2*u.sizeConstant,h.fill(),h.stroke()},e.prototype.paintLinks=function(t,e){},e.prototype.paintNodes=function(t,e){for(var i=t.context,n=this.getGeometry(),s=n.txm,r=n.txa,a=n.tym,o=n.tya,l=n.zoom,h=n.x0w,u=n.y0w,c=n.x1w,p=n.y1w,f=1/s,g=l>this.style.nodeDetailMinZoom,m=this.style.nodeDetailMinSize*this.style.nodeDetailMinSize*f*f,v=this.style.nodeLabelScaleBase,y=0;y<e.length;y++){var S=e[y];if(S.removed)this.deleteNode(S);else if(S.data){var b=S.bounds;if(!(b.x1<h||b.x0>c||b.y1<u||b.y0>p)){var C=S.opacity,x=g&&b.area()>m||S.hovered;if(C<1&&(i.globalAlpha=C),x){S.items.sort(function(t,e){return t.zIndex-e.zIndex});var w=(b.x1+b.x0)/2*s+r,L=(b.y1+b.y0)/2*a+o,A=(b.x1-b.x0)/2*s,T=(b.y1-b.y0)/2*a;this.paintNodeDetails(S,w,L,A,T,l,v,t,!0)}if(S.fillColor||S.lineColor){for(var M=d.Graphics.beginStrokeAndFill(i,S),k=0,P=this.getNodeCoords(S,f);k<P.length;k++){var I=P[k],D=I[0]*s+r,F=I[1]*a+o;M.moveTo(D,F);for(var N=2;N<=I.length-2;N+=2)M.lineTo(I[N]*s+r,I[N+1]*a+o);M.closePath()}d.Graphics.endStrokeAndFill(i,M,S)}if(x){var w=(b.x1+b.x0)/2*s+r,L=(b.y1+b.y0)/2*a+o,A=(b.x1-b.x0)/2*s,T=(b.y1-b.y0)/2*a;this.paintNodeDetails(S,w,L,A,T,l,v,t,!1)}C<1&&(i.globalAlpha=1)}}}return!1},e.prototype.findObjectAt=function(t,e,i){for(var n=this.scene.fromDisplay(t,e),s=n.x,r=n.y,a=1/this.scene.zoom,o=i*a,l=null,h=this.nodes(),u=h.length-1;u>=0;u--){var c=h[u];if(!c.removed){var p=this.getNodeCoords(c,a),f=d.Geometry.distanceToPolygonSq(s,r,p),g=o*o;if(f<=0)return{object:c,details:null};if(f<g){var m=Math.sqrt(f);m<o&&(o=m,l=c)}}}return{object:l,details:null}},e.prototype.getNodeCoords=function(t,e){var i=this.style.shapeSimplificationPrecision;if(!(i>0))return t.coordinates;i*=e;var n=t.coordinatesCachePrecision;if(n<=i&&2*n>i)return t.coordinatesCache;var s,r=[];s=n<i?t.coordinatesCache:t.coordinates;for(var a=0;a<s.length;a++){var o=s[a],l=d.Geometry.computeBoundsSize(o);l>4*i&&(o.length>10&&(o=d.Geometry.simplify(o,i)),r.push(o))}return t.coordinatesCachePrecision=i,t.coordinatesCache=r,r},e}(u.ItemsLayer);e.ShapesLayer=Z;var X=function(t){function e(e,i,n){t.call(this,e),this.layerSettings=n,this.parentId=null,this.baseLayer=i}return n(e,t),e.prototype.findObjectAt=function(t,e,i){return null},e.prototype.nodes=function(){return this.baseLayer.nodes()},e.prototype.links=function(){return this.baseLayer.links()},e.prototype.getModified=function(){return this.baseLayer.getModified()},e.prototype.hasTopologyChanges=function(){return this.baseLayer.hasTopologyChanges()},e.prototype.hasStyleChanges=function(){return this.baseLayer.hasStyleChanges()},e.prototype.getGeometry=function(){return this.baseLayer.getGeometry()},e}(d.Layer);e.OverlayLayerBase=X;var Q=function(e){function i(t,i,n,s){e.call(this,t,i,n),this.idToChart={},this.chart=s}return n(i,e),i.prototype.updateStyle=function(t){},i.prototype.postprocessStyle=function(t){for(var e in this.baseLayer.newNodes){var i=this.baseLayer.newNodes[e];this.idToChart[e]=this.createChart(i)}var n;for(var e in this.baseLayer.modifiedNodes){var i=this.baseLayer.modifiedNodes[e];this.baseLayer.newNodes.hasOwnProperty(e)||(n=this.idToChart[e],n?this.updateChart(n,i):this.idToChart[e]=this.createChart(i))}for(var e in this.baseLayer.deletedNodes)n=this.idToChart[e],n&&(delete this.idToChart[e],this.removeChart(n));for(var s=0,r=this.nodes();s<r.length;s++){var i=r[s];n=this.idToChart[i.id],n&&this.updateXY(n,i)}},i.prototype.paint=function(t){},i.prototype.createChart=function(e){var i=this.layerSettings.chartType,n=this.getChartSettings(e);if(!n)return null;n.parentChart=this.chart.api,n.area?n.area.width||(n.area.width=100,n.area.height=100):n.area={width:100,height:100};var s;return s="piechart"===i?new t.PieChart(n):"facetchart"===i?new t.FacetChart(n):"timechart"===i?new t.TimeChart(n):null},i.prototype.getChartSettings=function(t){return this.layerSettings.settingsFunction?this.layerSettings.settingsFunction(t,t.data):this.layerSettings.settings},i.prototype.updateChart=function(t,e){var i=this.getChartSettings(e);t.updateSettings(i)},i.prototype.removeChart=function(t){t.remove()},i.prototype.updateXY=function(t,e){var i=this.scene.toDisplay(e.x,e.y),n=i.x,s=i.y,r=0,a=0,o=t._impl.settings.area;if(this.layerSettings.autoSize)throw"TODO: implement autoSize";r=o.width,a=o.height;var l=n-r/2,h=s-a/2;o.left===l&&o.top===h&&o.width===r&&o.height===a||t.updateSettings({area:{left:n-r/2,top:s-a/2,width:r,height:a}})},i.prototype.remove=function(){for(var t in this.idToChart)this.removeChart(this.idToChart[t]);this.idToChart={}},i}(X);e.ChartsLayer=Q;var K=function(){function t(t,e,i,n){this.drilldownId=n,this.layerSettings=i,this.data=e,this.chart=t,this.loading=!0,this.scene=t.scene,this.layer=this.createLayer(),this.layer.drilldownId=this.drilldownId,this.dataBounds=d.Rect.createEmpty(),this.expandedNode=null}return t.calculateShapeCentroid=function(t){var e,i,n=0,s=0;for(e=0;e<t.coordinates.length;e++)i=d.Geometry.calculatePolyArea(t.coordinates[e]),Math.abs(i)>Math.abs(s)&&(s=i,n=e);if(0===s)return t.x=(t.bounds.x0+t.bounds.x1)/2,void(t.y=(t.bounds.y0+t.bounds.y1)/2);var r=d.Geometry.calculatePolyCentroid(t.coordinates[n],s);t.x=r.x,t.y=r.y},t.prototype.createLayer=function(){return"shapes"===this.layerSettings.type?new Z(this.scene,this.layerSettings):"items"===this.layerSettings.type?new e.NodesLayer(this.chart,this.layerSettings,!1):null},t.prototype.onSceneChange=function(t){var e,i,n,s=this.data.dataSettings,r=this.layerSettings,a=s.prefetchRatio;s.perBoundsData?(e=this.chart.scene.getVisibleBounds(),i=e.clone().inflate(1+a/2),n=e.clone().inflate(1+a)):i=n=e=this.data.getProjectedBounds();var o=t.changes.geoChartDataNodesIds?(t.changes.geoChartDataNodesIds[s.id]||{})[this.drilldownId||""]:null,l=r instanceof z&&r.aggregation.enabled;if(this.dataBounds.isEmpty()||o||!e.isInside(this.dataBounds)||t.changes.zoom&&(s.perZoomData||l)){this.loading=!1,this.data.setViewParams(s.aggregationGridSize/this.scene.zoom,this.scene.zoomLevel,e,i,n);var h=this.data.getData(this.drilldownId),u=h.nodes,c=h.links,d=h.hasData,p=h.loading,f=u.length;if(d||f>0){if(this.chart.log("Layer "+this.layerSettings.id+": Updating view rect to "+i+", contains "+f+" objects"),l){var g=new k(r.aggregation,this.scene,this.chart),m=g.aggregate(u,c);u=m.nodes,c=m.links}this.applyVisibleNodes(this.layer,u,c,null),this.dataBounds=i}this.loading=p}else e.area()*(1+a)*(1+a)<this.dataBounds.area()/5&&(i=e.inflate(1+a),this.chart.log("Layer "+this.layerSettings.id+": Shrinking view to "+i),this.shrinkVisibleBounds(i),this.dataBounds=i);if(r.perZoomStyle&&t.changes.zoom){for(var v=0,y=this.layer.nodes();v<y.length;v++)this.layer.touchNode(y[v]);for(var S=0,b=this.layer.links();S<b.length;S++)this.layer.touchLink(b[S])}},t.prototype.updateStyle=function(t){this.layer.setBounds(this.scene.x0,this.scene.y0,this.scene.x0+this.scene.width,this.scene.y0+this.scene.height),this.layer.updateStyle(t)},t.prototype.postprocessStyle=function(t){this.layer.postprocessStyle(t)},t.prototype.remove=function(){},t.prototype.paint=function(t){this.layer.paint(t)},t.prototype.findObjectAt=function(t,e,i){return this.layer.findObjectAt(t,e,i)},t.prototype.findObjectById=function(t){return this.layer.findObjectById(t)},t.prototype.touchObject=function(t){var e=this.layer,i=e.findObjectById(t);i&&e.touchNodeOrLink(i)},t.prototype.setExpandedNode=function(t){this.expandedNode&&(this.expandedNode.expanded=!1,this.layer.touchNode(this.expandedNode),this.expandedNode=null),t&&(this.expandedNode=this.layer.idToNode[t],this.expandedNode&&(this.expandedNode.expanded=!0,this.layer.touchNode(this.expandedNode)))},t.prototype.applyVisibleNodes=function(e,i,n,s){for(var r=e.idToNode,a={},o={},l="shapes"===this.layerSettings.type,h=0;h<i.length;h++){var u=i[h],c=l&&u._coordinates||!l&&u.hasOwnProperty("_x");if(c){var d=u.id;a[d]=!0;var p=e.addNode(d);p.data=u,l&&(p.coordinates=u._coordinates,p.bounds=u._bounds,t.calculateShapeCentroid(p)),p.parentNode=s}}for(var f=0;f<n.length;f++){var g=n[f],m=e.addLink(g.id,g.from,g.to);m.data=g,o[m.id]=!0}for(var d in r){var p=r[d];if(!a.hasOwnProperty(d)){e.removeNode(p);for(var v=0;v<p.links.length;v++)e.removeLink(p.links[v])}}var y=e.idToLink;for(var d in y)o.hasOwnProperty(d)||e.removeLink(y[d])},t.prototype.shrinkVisibleBounds=function(t){for(var e in this.layer.idToNode){var i=this.layer.idToNode[e];i.data._bounds.isOutside(t)&&this.layer.removeNode(i)}},t}(),J=function(){function t(t,e,i,n){this.data=null,this.drilldownId=n,this.layerSettings=i,this.baseLayer=e,this.chart=t,this.scene=t.scene,this.loading=!1,this.layer=this.createLayer()}return t.prototype.createLayer=function(){return"charts"===this.layerSettings.type?new Q(this.scene,this.baseLayer.layer,this.layerSettings,this.chart):null},t.prototype.onSceneChange=function(t){},t.prototype.updateStyle=function(t){this.layer.updateStyle(t)},t.prototype.postprocessStyle=function(t){this.layer.postprocessStyle(t)},t.prototype.setExpandedNode=function(t){},t.prototype.paint=function(t){this.layer.paint(t)},t.prototype.findObjectAt=function(t,e,i){return null},t.prototype.findObjectById=function(t){return null},t.prototype.touchObject=function(t){},t.prototype.remove=function(){this.layer.remove()},t}(),$=function(){function t(t,e,i,n,s){this.firstTime=!0,this.drilldownId=s,this.layerSettings=n,this.data=i,this.baseLayer=e,this.chart=t,this.loading=!0,this.scene=t.scene,this.dataBounds=d.Rect.createEmpty(),this.nodeToAggregated={},this.pendingNodes={}}return t.prototype.onSceneChange=function(t){if(this.firstTime||this.layerSettings.perZoomStyle&&t.changes.zoom||t.changes.data){this.firstTime=!1;for(var e=this.baseLayer.layer,i=0,n=e.nodes();i<n.length;i++)e.touchNode(n[i]);for(var s=0,r=e.links();s<r.length;s++)e.touchLink(r[s])}},t.prototype.updateStyle=function(t){var e=this.data.dataSettings,i=this.layerSettings,n=this.baseLayer.layer.modifiedNodes,s=t.changes.geoChartDataNodesIds?(t.changes.geoChartDataNodesIds[e.id]||{})[this.drilldownId||""]:null;if(d.Helpers.hasProperties(n)||d.Helpers.hasProperties(s)){var r=i.styleFunction;for(var a in n){var o=n[a];this.nodeToAggregated.hasOwnProperty(o.id)?r(o,this.nodeToAggregated[o.id]):this.pendingNodes[a]=o}if(!d.Helpers.hasProperties(this.pendingNodes))return void(this.loading=!1);var l;if(e.perBoundsData){l=d.Rect.createEmpty();for(var a in this.pendingNodes){var o=this.pendingNodes[a];l.addRect(o.data._bounds)}}else l=this.data.getProjectedBounds();this.data.setViewParams(e.aggregationGridSize/this.scene.zoom,this.scene.zoomLevel,l,l,l);var h=this.data.getData(this.drilldownId),u=h.nodes,c=h.loading;if(!c){for(var a in this.pendingNodes){var o=this.pendingNodes[a],p=this.computeAggr(o.data._bounds,o.data._coordinates,u);this.nodeToAggregated[o.id]=p,r&&r(o,p)}this.pendingNodes={}}this.loading=c}},t.prototype.postprocessStyle=function(t){},t.prototype.computeAggr=function(t,e,i){var n=this.layerSettings;if(n.aggregationFunction){for(var s=new Array,r=0;r<i.length;r++){var a=i[r],o=a._x,l=a._y;t.containsPoint(o,l)&&d.Geometry.isInsidePolygon(o,l,e)&&s.push(a)}return n.aggregationFunction(s)}var h=n.aggregation,u=n.aggregationField,c=0,p=function(){for(;c<i.length&&(!t.containsPoint(i[c]._x,i[c]._y)||!d.Geometry.isInsidePolygon(i[c]._x,i[c]._y,e));)c+=1;return c<i.length},f=function(){var t=i[c][u];return c+=1,t};return d.Helpers.aggregate(h,p,f)},t.prototype.setExpandedNode=function(t){},t.prototype.paint=function(t){},t.prototype.findObjectAt=function(t,e,i){return null},t.prototype.findObjectById=function(t){return null},t.prototype.touchObject=function(t){},t.prototype.remove=function(){},t}(),tt=function(){function t(t,e,i,n){this.layers=[],this.firstTime=!0,this.layerSettings=n,this.data=i,this.renderer=e,this.chart=t,this.loading=!0,this.scene=t.scene}return t.prototype.onSceneChange=function(t){if(t.changes.navigation||this.firstTime){this.firstTime=!1;for(var e=this.scene.stack,i=0;i<Math.min(this.layers.length,e.length)&&e[i]===this.layers[i].drilldownId;)i+=1;for(;this.layers.length>i;){var n=this.layers.pop();this.renderer.removeSimpleLayer(n);var s=this.layers.length>0?this.layers[this.layers.length-1]:null;s&&s.setExpandedNode(null)}for(;this.layers.length<e.length;){var r=e[this.layers.length],s=this.layers.length>0?this.layers[this.layers.length-1]:null;s&&s.setExpandedNode(r);var n=this.renderer.createSimpleLayer(this.data,this.layerSettings,r);if(!n)break;this.layers.push(n)}}this.loading=!1;for(var a=0;a<this.layers.length;a++){var o=this.layers[a];o.onSceneChange(t),this.loading=this.loading||o.loading}},t.prototype.updateStyle=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.updateStyle(t)}},t.prototype.postprocessStyle=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.postprocessStyle(t)}},t.prototype.paint=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.paint(t)}},t.prototype.findObjectAt=function(t,e,i){for(var n=this.layers.length-1;n>=0;n--){var s=this.layers[n].findObjectAt(t,e,i);if(s&&s.object)return s}return null},t.prototype.findObjectById=function(t){for(var e=this.layers.length-1;e>=0;e--){var i=this.layers[e].findObjectById(t);if(i)return i}return null},t.prototype.touchObject=function(t){for(var e=0;e<=this.layers.length;e++)this.layers[e].touchObject(t)},t.prototype.remove=function(){for(var t=0;t<this.layers.length;t++){var e=this.layers[t];this.renderer.removeSimpleLayer(e)}this.layers=[]},t}(),et=function(t){function e(e){t.call(this),this.animationOrder=900,this.paintOrder=10,this.updateOrder=10,this.layers=[],this.idToLayer={},this.idToSimpleLayer={},this.drilldownLayer=null,this.chart=e,this.scene=e.scene,this.events=e.events}return n(e,t),e.prototype.createData=function(t){var e=null;return t.id&&(e=this.chart.getData(t.id)),e},e.prototype.createSimpleLayer=function(t,e,i){var n;if(e instanceof O){var s=this.idToSimpleLayer[e.shapesLayer+i];if(!s)return this.chart.error("ItemsOnShape layer: shapesLayer "+e.shapesLayer+" not found, must come first in the layers array."),null;"charts"===e.type?n=new J(this.chart,s,e,i):"aggregateOnShapes"===e.type&&(n=new $(this.chart,s,t,e,i))}else n=new K(this.chart,t,e,i);return this.idToSimpleLayer[e.id+i]=n,n},e.prototype.removeLayer=function(t){t instanceof tt?t.remove():this.removeSimpleLayer(t)},e.prototype.removeSimpleLayer=function(t){t.remove();var e=t.layerSettings.id+t.drilldownId;delete this.idToSimpleLayer[e]},e.prototype.onSceneChange=function(t){var e=!1,i=t.changes,n=i.settingsChanges;if(n&&(n.layers||n.layerTypes)){for(var s in n.layers){var r=this.idToLayer[s];r&&(this.removeLayer(r),delete this.idToLayer[s])}e=!0}else(i.zoom||i.data)&&(e=!0);if(e){var a=this.idToLayer;this.layers=[],this.idToLayer={};var o=this.scene.zoomLevel;this.drilldownLayer=null;for(var l=this.scene.settings.navigation.drilldownLayer,h=0;h<this.chart.settings._computedLayers.length;h++){var u=this.chart.settings._computedLayers[h],c=u.enabled&&u.minZoom<=o&&u.maxZoom>=o,d=a[u.id];if(c){var p=this.createData(u.data),f=!1;if(p&&p.dataSettings.perDrilldownData&&(f=!0),u instanceof O){var g=this.idToLayer[u.shapesLayer];if(!g){this.chart.error("Overlay layer: shapeLayer "+u.shapesLayer+" not found, must come first in the layers array.");continue}d&&d.baseLayer!==g&&(this.removeLayer(d),d=null),f=f||g.data.dataSettings.perDrilldownData}var r=void 0;if(d&&d.data===p)r=d;else if(d&&this.removeLayer(d),f)r=new tt(this.chart,this,p,u);else if(r=this.createSimpleLayer(p,u,null),!r)continue;u.id===l&&(this.drilldownLayer=r),this.layers.push(r),this.idToLayer[u.id]=r}else d&&this.removeLayer(d)}for(var s in a){var r=a[s];this.idToLayer.hasOwnProperty(s)||this.removeLayer(r)}}for(var m=0;m<this.layers.length;m++){var r=this.layers[m];r.onSceneChange(t)}},e.prototype.doAnimations=function(t){for(var e=0;e<this.layers.length;e++){var i=this.layers[e];i.updateStyle(t)}for(var n=!1,e=0;e<this.layers.length;e++){var i=this.layers[e];i.postprocessStyle(t),n=n||i.loading}this.scene.loading=n},e.prototype.paintScene=function(t){d.Graphics.pushClip(t,this.scene.x0,this.scene.y0,this.scene.width,this.scene.height);for(var e=!1,i=0;i<this.layers.length;i++){var n=this.layers[i];n.paint(t),e=e||n.loading}d.Graphics.popClip(t),this.scene.loading=e},e.prototype.findObjectById=function(t){for(var e=this.layers.length-1;e>=0;e--){var i=this.layers[e],n=i.findObjectById(t);if(n)return n}return null},e.prototype.touchObjects=function(t){for(var e=this.layers.length-1;e>=0;e--)for(var i=this.layers[e],n=0;n<t.length;n++)i.touchObject(t[n])},e.prototype.findObjectAt=function(t,e,i){for(var n=this.layers.length-1;n>=0;n--){var s=this.layers[n],r=s.findObjectAt(t,e,i);if(r&&r.object)return r}return null},e}(d.ChartElement);e.Renderer=et;var it=function(t){function e(e){t.call(this),this.animationOrder=1e3,this.paintOrder=5,this.updateOrder=1300,this.chart=e,this.scene=this.chart.scene}return n(e,t),e.prototype.showInitialNodes=function(){var t=this.scene.settings.navigation.initialDrilldown;return this.scene.stack=t,this.chart.events.notifySceneChanges({navigation:!0})},e.prototype.onPanZoom=function(){},e.prototype.onNewDataObject=function(){},e.prototype.expandNode=function(t){var e=t.layer.drilldownId,i=t.id;if(i===this.scene.peek())return!1;for(;this.scene.peek()!==e;)this.scene.pop();return this.scene.push(i),this.chart.events.notifySceneChanges({navigation:!0}),!0},e.prototype.collapseNode=function(t){throw"Not implemented"},e}(d.Navigator);e.Navigator=it;var nt=!1,st=function(t){function e(e,i){t.call(this,new P(e),new j,i),this.events.forceFloating=!0,this._map=this._map||null,this._pendingZoomLevel=null,this._pendingLatitude=null,this._pendingBounds=null,this.navigator=this.events.addElement(new it(this)),this.menu=this.events.addElement(new u.Menu(this)),this.info=this.events.addElement(new u.InfoPopup(this)),this.selection=this.events.addElement(new B(this)),this._map&&(this.renderer=this.events.addElement(new et(this))),this.navigator.showInitialNodes(),this.finalInitialize()}return n(e,t),e.prototype.getMap=function(){return this._map},e.prototype.domLayerCreated=function(){nt||(d.Helpers.compareVersions(L.version,[0,7])||this.error("ZoomCharts requires Leaflet.js version 0.7.0 or newer. The loaded version is "+L.version),nt=!0),this._map||(this._map=this._domLayer.map,null!=this._pendingLatitude?this.setView(this._pendingLatitude,this._pendingLongitude,this._pendingZoomLevel):(null!==this.settings.navigation.initialLat&&this.setView(this.settings.navigation.initialLat,this.settings.navigation.initialLng,this.settings.navigation.initialZoom),null!=this._pendingZoomLevel&&this.setZoomLevel(this._pendingZoomLevel)),null!=this._pendingBounds&&this.setBounds(this._pendingBounds),this.events&&(this.renderer=this.events.addElement(new et(this)),this.events.notifySceneChanges({settings:!0,settingsChanges:this.settings,zoom:!0,bounds:!0})),this.scene.loading=!1)},e.prototype.createDomLayer=function(){return this._domLayer=new T(this),this._domLayer},e.prototype.createDataObj=function(t){return new x(this,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e.prototype.onSettingsChanged=function(t){var e={},i=t.navigation&&t.navigation.initialDrilldown;i&&this.navigator.showInitialNodes(),t.filters&&(e.filters=!0),t.style&&(e.style=!0),this.events.notifySceneChanges(e)},e.prototype.saveNavigation=function(){return this._map?this.scene.getVisibleBoundsLatLon():null},e.prototype.restoreNavigation=function(t){this.setBounds(t)},e.prototype.save=function(){return""},e.prototype.restore=function(t,e){},e.prototype.setZoomLevel=function(t){this._map?this._map.setZoom(t):this._pendingZoomLevel=t},e.prototype.setView=function(t,e,i){this._map?this._map.setView(L.latLng(t,e),i):(this._pendingLatitude=t,this._pendingLongitude=e,this._pendingZoomLevel=i)},e.prototype.setBounds=function(t){if(this._map){var e=t;if(void 0!==e.east)this._map.fitBounds(L.latLngBounds(L.latLng(e.south,e.west),L.latLng(e.north,e.east)));else{var i=t;this._map.fitBounds(L.latLngBounds(L.latLng(i.y1,i.x0),L.latLng(i.y0,i.x1)))}}else this._pendingBounds=t},e.prototype.getNodeDimensions=function(t){var e=t;if(d.Helpers.isString(t)&&(e=this.getNode(t)),!e)return null;var i=this.scene.toDisplay(e.x,e.y),n=i.x,s=i.y,r=e.hHeight*this.scene.zoom,a=e.hWidth*this.scene.zoom;return{x:n,y:s,radius:r,hwidth:a}},e.prototype.expandNode=function(t){var e=null;e=d.Helpers.isString(t)?this.getNode(t):t,this.navigator.expandNode(e)},e.prototype.collapseNode=function(t){var e=null;e=d.Helpers.isString(t)?this.getNode(t):t,this.navigator.collapseNode(e)},e.prototype.getNode=function(t){var e=this.renderer?this.renderer.findObjectById(t):null;return e instanceof u.Node||(e=null),e},e.prototype.getLink=function(t){var e=this.renderer?this.renderer.findObjectById(t):null;return e instanceof u.Link||(e=null),e},e.prototype.hideMenu=function(){this.menu.hideMenu()},e.prototype.defaultClick=function(t,e){var i="drilldown"===this.settings.interaction.mode,n=e.clickNode;i&&n&&n.expandable&&this.navigator.expandNode(n)&&(this.setBounds(this.scene.unprojectRect(n.data._bounds)),t.preventDefault())},e.prototype.defaultRightClick=function(t,e){e.clickNode&&(this.menu.toggleNodeMenu(e.clickNode),t.preventDefault()),e.clickLink&&(this.menu.toggleLinkMenu(t.x,t.y,e.clickLink),t.preventDefault())},e}(u.Impl);e.Impl=st}(s)}(i),function(t){!function(t){t[t.always=2]="always",t[t.disabled=0]="disabled",t[t.hovered=1]="hovered",t[t.selected=3]="selected"}(t.GeoChartSettingsAggregatedShapeStyleMode||(t.GeoChartSettingsAggregatedShapeStyleMode={}));t.GeoChartSettingsAggregatedShapeStyleMode;!function(t){t[t.always=2]="always",t[t.auto=1]="auto",t[t.never=0]="never"}(t.LinearChartSettingsValueAxisBaseLineLabelMode||(t.LinearChartSettingsValueAxisBaseLineLabelMode={}));t.LinearChartSettingsValueAxisBaseLineLabelMode}(e);var s=function(t){function e(n){var s=this;t.call(this),this.typeName="NetChart",e.chartFactoryMethod?this._impl=e.chartFactoryMethod(function(t){return new i.NetChart.Impl(t,s)},n):this._impl=new i.NetChart.Impl(n,this)}return n(e,t),e.prototype.updateSettings=function(e){return t.prototype.updateSettings.call(this,e),this},e.prototype.replaceSettings=function(e){return t.prototype.replaceSettings.call(this,e),this},e.prototype.addData=function(t,e){null==e&&(e="default"),this._impl.addData(t,e)},e.prototype.removeData=function(t,e){null==e&&(e="default"),this._impl.removeData(t,e)},e.prototype.replaceData=function(t,e){null==e&&(e="default"),this._impl.replaceData(t,e)},e.prototype.hideMenu=function(){return this._impl.hideMenu(),this},e.prototype.updateStyle=function(t){t?(this._impl.touchObjects(t),this._impl.events.requestPaint()):this._impl.updateStyle(null)},e.prototype.getNode=function(t){return this._impl.getNode(t)},e.prototype.getLink=function(t){return this._impl.getLink(t)},e.prototype.showNode=function(t){return this._impl.showNode(t)},e.prototype.hideNode=function(t){return this._impl.hideNode(t)},e.prototype.expandNode=function(t){return this._impl.expandNode(t)},e.prototype.addFocusNode=function(t,e){return void 0===e&&(e=-1),null==e&&(e=-1),this._impl.addFocusNode(t,e)},e.prototype.removeFocusNode=function(t){return this._impl.removeFocusNode(t)},e.prototype.clearFocus=function(){return this._impl.clearFocus();
  56. },e.prototype.collapseNode=function(t){return this._impl.collapseNode(t)},e.prototype.closeNode=function(t){return this._impl.closeNode(t)},e.prototype.lockNode=function(t,e,i){return this._impl.lockNode(t,e,i)},e.prototype.unlockNode=function(t){return this._impl.unlockNode(t)},e.prototype.zoom=function(t,e){return void 0===e&&(e=!0),t>0&&this._impl.setZoom(t,!!e),this._impl.scene.zoom},e.prototype.resetLayout=function(){return this._impl.resetLayout()},e.prototype.selection=function(t){return t&&this._impl.setSelection(t),this._impl.scene.selection},e.prototype.zoomIn=function(t,e){return void 0===e&&(e=!0),this.scrollIntoView(t)},e.prototype.nodes=function(){return this._impl.getCurrentNodes()},e.prototype.links=function(){return this._impl.getCurrentLinks()},e.prototype.getNodeDimensions=function(t){return this._impl.getNodeDimensions(t)},e.prototype.exportData=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e=!0),this._impl.exportData(!!t,!!e)},e.prototype.scrollIntoView=function(t,e){this._impl.scrollIntoView(t,e)},e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.themes={flat:i.NetChart.Settings.FlatTheme,dark:i.NetChart.Settings.DarkTheme},e.chartFactoryMethod=null,e}(i.Base.Api);t.NetChart=s,i.Base.Helpers.exportSymbol("NetChart",t.NetChart);var r=function(t){function e(n){var s=this;t.call(this),this._cachedApiCalls=[],this.typeName="TimeChart",e.chartFactoryMethod?this._impl=e.chartFactoryMethod(function(t){return new i.TimeChart.Impl(t,s)},n):this._impl=new i.TimeChart.Impl(n,this)}return n(e,t),e.prototype._notifyAssetsLoaded=function(){var t=this._cachedApiCalls;if(null!==t){this._cachedApiCalls=null;for(var e=0;e<t.length;e++)t[e]()}},e.prototype.updateSettings=function(e){return t.prototype.updateSettings.call(this,e),this},e.prototype.replaceSettings=function(e){return t.prototype.replaceSettings.call(this,e),this},e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.prototype.time=function(t,e,n){var s=this;void 0===n&&(n=!0);var r=this._impl,a=r.scene,o=i.TimeChart.TimeStep.timeUnitDiffs,l=!r.displayUnit||o[r.displayUnit.unit]<o.d;if(null!=t&&null!=e){if(this._cachedApiCalls)return this._cachedApiCalls.push(function(){s.time(t,e,n)}),[null,null];r.setTimeRange(a.timestampToInternal(+t,l),a.timestampToInternal(+e,l),n)}return[a.timestampFromInternal(r.timeStart,l),a.timestampFromInternal(r.timeEnd,l)]},e.prototype.targetTime=function(){var t=this._impl,e=t.scene,n=t.scrolling,s=i.TimeChart.TimeStep.timeUnitDiffs,r=n.targetUnit||t.displayUnit;if(!r)return[null,null];var a=!t.displayUnit||s[t.displayUnit.unit]<s.d;return[e.timestampFromInternal(n.getFrom(),a),e.timestampFromInternal(n.getTo(),a)]},e.prototype.targetDisplayUnit=function(){var t=this._impl,e=t.scrolling.targetUnit||t.displayUnit||t.scene.displayUnit;return e?e.toString():null},e.prototype.addData=function(t,e){null==e&&(e="default"),this._impl.addData(t,e)},e.prototype.replaceData=function(t,e){null==e&&(e="default"),this._impl.replaceData(t,e)},e.prototype.setDisplayPeriod=function(t,e,i){var n=this;return void 0===i&&(i=!0),this._cachedApiCalls?void this._cachedApiCalls.push(function(){n.setDisplayPeriod(t,e,i)}):void this._impl.setDisplayPeriod(t,e,null,i)},e.prototype.displayUnit=function(t,e,n){var s=this;if(void 0===e&&(e=!0),void 0!==n&&i.Base.Helpers.warn("TimeChart.displayUnit() no longer supports the `rescale` parameter."),t){if(this._cachedApiCalls)return this._cachedApiCalls.push(function(){s.displayUnit(t,e)}),null;this._impl.setDisplayUnit(t,e,"api",!0)}return this._impl.displayUnit?this._impl.displayUnit.toString():null},e.prototype.selection=function(t,e){var n=this,s=this._impl,r=s.scene,a=i.TimeChart.TimeStep.timeUnitDiffs,o=!s.displayUnit||a[s.displayUnit.unit]<a.d;if(void 0!==t&&void 0!==e){if(this._cachedApiCalls)return this._cachedApiCalls.push(function(){n.selection(t,e)}),[null,null];s.setSelection(null===t?null:r.timestampToInternal(+t,o),null===e?null:r.timestampToInternal(+e,o))}return[r.timestampFromInternal(s.scene.selectionStart,o),r.timestampFromInternal(s.scene.selectionEnd,o)]},e.prototype.scroll=function(t,e){return void 0===e&&(e=!0),this._impl.scroll(t,e)},e.prototype.zoomOut=function(t,e){var n=this;return void 0===e&&(e=!0),this._cachedApiCalls?void this._cachedApiCalls.push(function(){n.zoomOut(t,e)}):void this._impl.zoomOut(e,"api",i.TimeChart.TimeStep.parse(t))},e.prototype.zoomIn=function(t,e,n){var s=this;if(void 0===e&&(e=null),void 0===n&&(n=!0),this._cachedApiCalls)return void this._cachedApiCalls.push(function(){s.zoomIn(t,e,n)});var r=this._impl,a=i.TimeChart.TimeStep.parse(t);if(null!=e){var o=a||r.displayUnit,l=i.TimeChart.TimeStep.timeUnitDiffs,h=!o||l[o.unit]<l.d;e=r.scene.timestampToInternal(+e,h)}r.zoomIn(a,e,n,"api")},e.prototype.replaceSeries=function(t){return this._impl.deprecated("replaceSeries","replaceSettings"),this.replaceSettings({series:t})},e.prototype.exportVisibleData=function(){return this._impl.exportVisibleData()},e.prototype.showInfoPopup=function(t,e,n){var s=this;if(this._cachedApiCalls)return void this._cachedApiCalls.push(function(){s.showInfoPopup(t,e,n)});var r=this._impl,a=r.scene,o=i.TimeChart.TimeStep.timeUnitDiffs,l=!r.displayUnit||o[r.displayUnit.unit]<o.d;r.showInfoPopup(null==t?null:a.timestampToInternal(+t,l),null==e?null:a.timestampToInternal(+e,l),n)},e.prototype.getEnabledSeries=function(){return this._impl.getEnabledSeries()},e.themes={flat:i.TimeChart.Settings.FlatTheme,round:i.TimeChart.Settings.RoundTheme,gradient:i.TimeChart.Settings.GradientTheme,static:i.TimeChart.Settings.StaticChart,dark:i.TimeChart.Settings.DarkTheme},e.chartFactoryMethod=null,e}(i.Base.Api);t.TimeChart=r,i.Base.Helpers.exportSymbol("TimeChart",t.TimeChart);var a=function(t){function e(n){var s=this;t.call(this),this.typeName="PieChart",e.chartFactoryMethod?this._impl=e.chartFactoryMethod(function(t){return new i.PieChart.Impl(t,s)},n):this._impl=new i.PieChart.Impl(n,this)}return n(e,t),e.prototype.updateSettings=function(e){return t.prototype.updateSettings.call(this,e),this},e.prototype.replaceSettings=function(e){return t.prototype.replaceSettings.call(this,e),this},e.prototype.updateFilter=function(){return this._impl.updateFilter(),this},e.prototype.addData=function(t,e){null==e&&(e="default"),this._impl.addData(t,e)},e.prototype.replaceData=function(t,e){null==e&&(e="default"),this._impl.replaceData(t,e)},e.prototype.selection=function(t){if(t)if(Array.isArray(t)){for(var e=t.slice(),n=0;n<e.length;n++){var s=e[n];s instanceof i.PieChart.Slice?e[n]=s.id:i.Base.Helpers.isString(s)||this._impl.error("PieChart.selection() - the argument must be an array of PieChart.Slice objects or strings.")}this._impl.setSelection(e)}else this._impl.error("PieChart.selection() - the argument must be an array of PieChart.Slice objects or strings.");return this._impl.scene.selection.slice()},e.prototype.getPie=function(){return this._impl.getPie()},e.prototype.getPieOffset=function(){return this._impl.navigator.getPieOffset()},e.prototype.setPie=function(t,e){return void 0===e&&(e=0),null==e&&(e=0),this._impl.setPie(t,e),this},e.prototype.setPieOffset=function(t){return this._impl.setPieOffset(t),this},e.prototype.getActiveSlices=function(){return this._impl.getActiveSlices()},e.prototype.getActivePies=function(){return this._impl.getActivePies()},e.prototype.getActivePie=function(){var t=this._impl.getActivePies();return t[t.length-1]},e.prototype.expandSlice=function(t){return this._impl.expandSlice(t,"api")},e.prototype.getSliceDimensions=function(t,e){return void 0===e&&(e=!1),null==e&&(e=!1),this._impl.getSliceDimensions(t,e)},e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.themes={dark:i.PieChart.Settings.DarkTheme,flat:i.PieChart.Settings.FlatTheme,bevel:i.PieChart.Settings.BevelTheme,gradient:i.PieChart.Settings.GradientTheme,raised:i.PieChart.Settings.CanTheme},e.chartFactoryMethod=null,e}(i.Base.Api);t.PieChart=a,i.Base.Helpers.exportSymbol("PieChart",t.PieChart);var o=function(t){function e(n){var s=this;t.call(this),this.typeName="FacetChart",e.chartFactoryMethod?this._impl=e.chartFactoryMethod(function(t){return new i.FacetChart.Impl(t,s)},n):this._impl=new i.FacetChart.Impl(n,this)}return n(e,t),e.prototype.updateSettings=function(e){return t.prototype.updateSettings.call(this,e),this},e.prototype.replaceSettings=function(e){return t.prototype.replaceSettings.call(this,e),this},e.prototype.addData=function(t,e){null==e&&(e="default"),this._impl.addData(t,e)},e.prototype.replaceData=function(t,e){null==e&&(e="default"),this._impl.replaceData(t,e)},e.prototype.updateFilter=function(){return this._impl.updateFilter(),this},e.prototype.selection=function(t){if(t)if(Array.isArray(t)){for(var e=t.slice(),n=0;n<e.length;n++){var s=e[n];s instanceof i.FacetChart.Item?e[n]=s.id:i.Base.Helpers.isString(s)||this._impl.error("FacetChart.selection() - the argument must be an array of FacetChart.Item objects or strings.")}this._impl.setSelection(e)}else this._impl.error("FacetChart.selection() - the argument must be an array of FacetChart.Item objects or strings.");return this._impl.scene.selection.slice()},e.prototype.setPie=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=null),Array.isArray(t)||(t=[t]),this._impl.setPie(t,e,i),this},e.prototype.getPie=function(){return this._impl.getPie()},e.prototype.getPieOffset=function(){return this._impl.getPieOffset()},e.prototype.getActiveItems=function(){return this._impl.getActiveItems()},e.prototype.getActiveFacets=function(){return this._impl.getActiveFacets()},e.prototype.getActiveFacet=function(){var t=this._impl.getActiveFacets();return t[t.length-1]},e.prototype.expandSlice=function(t){return this._impl.expandItem(t,"api")},e.prototype.replaceSeries=function(t){return this._impl.deprecated("replaceSeries","replaceSettings"),this.replaceSettings({series:t})},e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.prototype.getEnabledSeries=function(){return this._impl.getEnabledSeries()},e.themes={dark:i.FacetChart.Settings.DarkTheme},e.chartFactoryMethod=null,e}(i.Base.Api);t.FacetChart=o,i.Base.Helpers.exportSymbol("FacetChart",t.FacetChart);var l=function(t){function e(n){var s=this;t.call(this),this.typeName="GeoChart",e.chartFactoryMethod?this._impl=e.chartFactoryMethod(function(t){return new i.GeoChart.Impl(t,s)},n):this._impl=new i.GeoChart.Impl(n,this)}return n(e,t),e.prototype.updateSettings=function(e){return t.prototype.updateSettings.call(this,e),this},e.prototype.replaceSettings=function(e){return t.prototype.replaceSettings.call(this,e),this},e.prototype.addData=function(t,e){null==e&&(e="default"),this._impl.addData(t,e)},e.prototype.replaceData=function(t,e){null==e&&(e="default"),this._impl.replaceData(t,e)},e.prototype.hideMenu=function(){return this._impl.hideMenu(),this},e.prototype.getNode=function(t){return this._impl.getNode(t)},e.prototype.updateStyle=function(t){t?this._impl.renderer&&(this._impl.renderer.touchObjects(t),this._impl.events.requestPaint()):this._impl.updateStyle(null)},e.prototype.selection=function(t){return t&&this._impl.setSelection(t),this._impl.scene.selection},e.prototype.bounds=function(t){t&&this._impl.setBounds(t);var e=this._impl.scene.getVisibleBoundsLatLon();return{east:e.x1,north:e.y1,west:e.x0,south:e.y0}},e.prototype.back=function(){return this._impl.back(),this},e.prototype.zoomLevel=function(t){return t&&this._impl.setZoomLevel(t),this._impl.scene.zoomLevel},e.prototype.getNodeDimensions=function(t){return this._impl.getNodeDimensions(t)},e.prototype.leaflet=function(){return this._impl.getMap()},e.prototype.on=function(e,i){t.prototype.on.call(this,e,i)},e.themes={flat:i.GeoChart.Settings.FlatTheme},e.chartFactoryMethod=null,e}(i.Base.Api);t.GeoChart=l,i.Base.Helpers.exportSymbol("GeoChart",t.GeoChart)}(ZoomCharts);