/**
 * @license
 * Copyright (c) 2018 amCharts (Antanas Marcelionis, Martynas Majeris)
 *
 * This sofware is provided under multiple licenses. Please see below for
 * links to appropriate usage.
 *
 * Free amCharts linkware license. Details and conditions:
 * https://github.com/amcharts/amcharts4/blob/master/LICENSE
 *
 * One of the amCharts commercial licenses. Details and pricing:
 * https://www.amcharts.com/online-store/
 * https://www.amcharts.com/online-store/licenses-explained/
 *
 * If in doubt, contact amCharts at contact@amcharts.com
 *
 * PLEASE DO NOT REMOVE THIS COPYRIGHT NOTICE.
 * @hidden
 */
am4internal_webpackJsonp(["1b9f"],{ntkx:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={};r.d(a,"SunburstDataItem",function(){return v}),r.d(a,"Sunburst",function(){return b}),r.d(a,"SunburstSeriesDataItem",function(){return c}),r.d(a,"SunburstSeries",function(){return p});var s=r("m4/l"),i=r("quKg"),n=r("Puh1"),o=r("Mtpk"),u=r("aCit"),l=r("MIZb"),c=function(e){function t(){var t=e.call(this)||this;return t.className="SunburstSeriesDataItem",t.applyTheme(),t}return s.c(t,e),Object.defineProperty(t.prototype,"sunburstDataItem",{get:function(){return this._dataContext},enumerable:!0,configurable:!0}),t.prototype.hide=function(t,r,a,s){var i=this.sunburstDataItem;return i&&i.series&&i.series.dataItems.each(function(e){e.hide(t,r,a,s)}),e.prototype.hide.call(this,t,r,a,s)},t.prototype.show=function(t,r,a){var s=this.sunburstDataItem;return s&&s.series&&s.series.dataItems.each(function(e){e.show(t,r,a)}),e.prototype.show.call(this,t,r,a)},Object.defineProperty(t.prototype,"value",{get:function(){var e=0,t=this.sunburstDataItem;return t.series?t.series.dataItems.each(function(t){var r=t.value;o.isNumber(r)&&(e+=r)}):e=this.values.value.value,e},set:function(e){this.setValue("value",e)},enumerable:!0,configurable:!0}),t.prototype.getActualWorkingValue=function(e){var t=0,r=this.sunburstDataItem;return r.series?r.series.dataItems.each(function(r){var a=r.getWorkingValue(e);o.isNumber(a)&&(t+=a)}):t=this.values[e].workingValue,t},t}(n.b),p=function(e){function t(){var t=e.call(this)||this;t.className="SunburstSeries",t.dataFields.category="name",t.dataFields.value="value";var r=new l.a;t.stroke=r.getFor("background"),t.strokeOpacity=1,t.alignLabels=!1,t.ticks.template.disabled=!0,t.slices.template.hiddenState.properties.visible=!0;var a=t.labels.template;a.relativeRotation=90,a.radius=10,a.inside=!0,a.strokeOpacity=0,a.fillOpacity=1,a.fill=r.getFor("background"),a.padding(0,0,0,0),a.interactionsEnabled=!1;var s=t.slices.template;s.stroke=r.getFor("background");var i=s.states.getKey("active");return i&&(i.properties.shiftRadius=0),t.applyTheme(),t}return s.c(t,e),t.prototype.createDataItem=function(){return new c},t.prototype.processDataItem=function(t,r){r.seriesDataItem=t,e.prototype.processDataItem.call(this,t,r)},t.prototype.handleDataItemValueChange=function(t,r){e.prototype.handleDataItemValueChange.call(this,t,r),t.sunburstDataItem.setValue(r,t.getValue(r))},t.prototype.handleDataItemWorkingValueChange=function(t,r){e.prototype.handleDataItemWorkingValueChange.call(this,t,r);for(var a=t.sunburstDataItem.parent.parent;void 0!=a;)a.series.invalidateProcessedData(),a=a.parent},t}(n.a);u.b.registeredClasses.SunburstSeries=p,u.b.registeredClasses.SunburstSeriesDataItem=c;var h=r("Wglt"),d=r("v9UT"),f=r("DHte"),m=r("+qIf"),v=function(e){function t(){var t=e.call(this)||this;return t.className="SunburstDataItem",t.values.value={},t.hasChildren.children=!0,t.applyTheme(),t}return s.c(t,e),Object.defineProperty(t.prototype,"value",{get:function(){var e=0;return this.children&&0!=this.children.length?h.each(this.children.iterator(),function(t){var r=t.value;o.isNumber(r)&&(e+=r)}):e=this.values.value.workingValue,e},set:function(e){this.setValue("value",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"percent",{get:function(){return this.parent?this.value/this.parent.value*100:100},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.properties.name},set:function(e){this.setProperty("name",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties.children},set:function(e){this.setProperty("children",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this.parent?this.parent.level+1:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var e=this.properties.color;return void 0==e&&this.parent&&(e=this.parent.color),void 0==e&&this.component&&(e=this.component.colors.getIndex(this.component.colors.step*this.index)),e},set:function(e){this.setProperty("color",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"series",{get:function(){return this._series},set:function(e){e!=this._series&&(this._series&&(this.component.series.removeValue(this._series),this._series.dispose()),this._series=e,this._disposers.push(e))},enumerable:!0,configurable:!0}),t}(i.b),b=function(e){function t(){var t=e.call(this)||this;t.className="Sunburst",t.colors=new f.a;var r=new p;return t.seriesTemplates=new m.c(r),t._disposers.push(new m.b(t.seriesTemplates)),t._disposers.push(r),t.applyTheme(),t}return s.c(t,e),t.prototype.createSeries=function(){return new p},t.prototype.createDataItem=function(){return new v},t.prototype.validateData=function(){this.series.clear(),e.prototype.validateData.call(this),this._homeDataItem&&this._homeDataItem.dispose();var t=this.dataItems.template.clone();this._homeDataItem=t,h.each(this.dataItems.iterator(),function(e){e.parent=t}),t.children=this.dataItems,this._levelCount=0,this.createSunburstSeries(t)},t.prototype.createSunburstSeries=function(e){if(e.children){this.initSeries(e);for(var t=0;t<e.children.length;t++){var r=e.children.getIndex(t);r.children&&this.createSunburstSeries(r)}}},t.prototype.initSeries=function(e){if(!e.series){var t,r=this.seriesTemplates.getKey(e.level.toString());r?(t=r.clone(),this.series.moveValue(t)):t=this.series.create(),t.name=e.name,t.parentDataItem=e,e.series=t;var a=e.level;t.level=a,this._levelCount<a+1&&(this._levelCount=a+1);var s=e.dataContext;s&&(t.config=s.config),this.dataUsers.removeValue(t),t.data=e.children.values,t.fill=e.color,t.slices.template.adapter.add("fill",function(e,t){var r=t.dataItem;if(r){var a=r.sunburstDataItem;if(a)return t.fill=a.color,t.adapter.remove("fill"),a.color}}),t.adapter.add("startAngle",function(e,t){var r=t.parentDataItem;if(r){var a=r.seriesDataItem;a&&(e=a.slice.startAngle)}return e}),t.adapter.add("endAngle",function(e,t){var r=t.parentDataItem;if(r){var a=r.seriesDataItem;a&&(e=a.slice.startAngle+a.slice.arc)}return e}),t.validateData(),e.seriesDataItem&&e.seriesDataItem.slice.events.on("propertychanged",function(e){"startAngle"!=e.property&&"arc"!=e.property||t.invalidate()})}},t.prototype.updateRadius=function(){e.prototype.updateRadius.call(this);var t=this._chartPixelRadius,r=this._chartPixelInnerRadius,a=(t-r)/this._levelCount;h.each(h.indexed(this.series.iterator()),function(e){var s=e[1],i=r+d.relativeRadiusToValue(s.radius,t-r),n=r+d.relativeRadiusToValue(s.innerRadius,t-r);o.isNumber(i)||(i=r+a*(s.level+1)),o.isNumber(n)||(n=r+a*s.level),s.pixelRadius=i,s.pixelInnerRadius=n})},t.prototype.applyInternalDefaults=function(){e.prototype.applyInternalDefaults.call(this),o.hasValue(this.readerTitle)||(this.readerTitle=this.language.translate("Sunburst chart"))},t}(i.a);u.b.registeredClasses.Sunburst=b,u.b.registeredClasses.SunburstDataItem=v,window.am4plugins_sunburst=a}},["ntkx"]);
//# sourceMappingURL=sunburst.js.map