2 lines
30 KiB
JavaScript

"use strict";(self.webpackChunk_am5=self.webpackChunk_am5||[]).push([[2076],{2536:function(e,t,i){i.r(t),i.d(t,{DefaultTheme:function(){return o},FunnelSeries:function(){return T},FunnelSlice:function(){return A},PercentChart:function(){return h},PercentSeries:function(){return m},PictorialStackedSeries:function(){return I},PieChart:function(){return f},PieSeries:function(){return C},PyramidSeries:function(){return L},SlicedChart:function(){return S}});var s=i(5829),a=i(3409),l=i(6245),r=i(2754),n=i(3783);class o extends a.Q{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,t=this.rule.bind(this);t("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:r.U.new(this._root,{}),width:l.AQ,height:l.AQ}),t("PieChart").setAll({radius:(0,l.aQ)(80),startAngle:-90,endAngle:270}),t("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),t("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),t("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),t("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),t("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),t("Slice",["pie"]).states.create("hover",{scale:1.04}),t("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),t("Tick",["pie"]).setAll({location:1}),t("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),t("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),t("FunnelSlice").setAll({interactive:!0,expandDistance:0}),t("FunnelSlice").states.create("hover",{expandDistance:.15}),t("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:l.CI}),t("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:l.CI,rotation:-90}),t("Label",["funnel","vertical"]).setAll({centerY:l.CI,centerX:0}),t("Tick",["funnel"]).setAll({location:1}),t("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),t("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),t("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),t("PyramidSeries").setAll({valueIs:"area"}),t("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),t("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),t("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),t("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),t("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),t("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:l.CI}),t("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:l.CI,rotation:-90}),t("Label",["pyramid","vertical"]).setAll({centerY:l.CI,centerX:0}),t("Tick",["pyramid"]).setAll({location:1}),t("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),t("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:l.CI}),t("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:l.CI,rotation:-90}),t("Label",["pictorial","vertical"]).setAll({centerY:l.CI,centerX:0}),t("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),t("Tick",["pictorial"]).setAll({location:.5});{const i=t("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),(0,n.v)(i,"fill",e,"alternativeBackground")}}}class h extends s.j{_afterNew(){this._defaultThemes.push(o.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(e){super._processSeries(e),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(h,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(h,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:s.j.classNames.concat([h.className])});var c=i(7582),u=i(3399),d=i(8777),g=i(1479),b=i(5071),p=i(5040);class m extends u.F{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(d.W.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(d.W.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(d.W.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(e){const t=this.slicesContainer.children.push(this.slices.make());return t.on("fill",(()=>{this.updateLegendMarker(e)})),t.on("stroke",(()=>{this.updateLegendMarker(e)})),t._setDataItem(e),e.set("slice",t),this.slices.push(t),t}makeLabel(e){const t=this.labelsContainer.children.push(this.labels.make());return t._setDataItem(e),e.set("label",t),this.labels.push(t),t}_shouldMakeBullet(e){return null!=e.get("value")}makeTick(e){const t=this.ticksContainer.children.push(this.ticks.make());return t._setDataItem(e),e.set("tick",t),this.ticks.push(t),t}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const e=this.get("colors");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let e=0,t=0,i=0,s=1/0,a=0;b.each(this._dataItems,(i=>{let s=i.get("valueWorking",0);e+=s,t+=Math.abs(s)})),b.each(this._dataItems,(e=>{let l=e.get("valueWorking",0);l>i&&(i=l),l<s&&(s=l),a++;let r=l/t;0==t&&(r=0),e.setRaw("valuePercentTotal",100*r)})),this.setPrivateRaw("valueLow",s),this.setPrivateRaw("valueHigh",i),this.setPrivateRaw("valueSum",e),this.setPrivateRaw("valueAverage",e/a),this.setPrivateRaw("valueAbsoluteSum",t)}}show(e){const t=Object.create(null,{show:{get:()=>super.show}});return(0,c.mG)(this,void 0,void 0,(function*(){let i=[];i.push(t.show.call(this,e)),i.push(this._sequencedShowHide(!0,e)),yield Promise.all(i)}))}hide(e){const t=Object.create(null,{hide:{get:()=>super.hide}});return(0,c.mG)(this,void 0,void 0,(function*(){let i=[];i.push(t.hide.call(this,e)),i.push(this._sequencedShowHide(!1,e)),yield Promise.all(i)}))}_updateChildren(){super._updateChildren(),this._valuesDirty&&b.each(this._dataItems,(e=>{e.get("label").text.markDirtyText()})),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&b.each(this._dataItems,(e=>{this.updateLegendValue(e)})),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),b.each(this.dataItems,(e=>{this._updateTick(e)}))}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(e){if(super.processDataItem(e),null==e.get("fill")){let t=this.get("colors");t&&e.setRaw("fill",t.next())}}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return(0,c.mG)(this,void 0,void 0,(function*(){const s=[i.showDataItem.call(this,e,t)];p.isNumber(t)||(t=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");let l=e.get("value");const r=e.animate({key:"valueWorking",to:l,duration:t,easing:a});r&&s.push(r.waitForStop());const n=e.get("tick");n&&s.push(n.show(t));const o=e.get("label");o&&s.push(o.show(t));const h=e.get("slice");h&&s.push(h.show(t)),h.get("active")&&h.states.applyAnimate("active"),yield Promise.all(s)}))}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return(0,c.mG)(this,void 0,void 0,(function*(){const s=[i.hideDataItem.call(this,e,t)],a=this.states.create("hidden",{});p.isNumber(t)||(t=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=e.animate({key:"valueWorking",to:0,duration:t,easing:l});r&&s.push(r.waitForStop());const n=e.get("tick");n&&s.push(n.hide(t));const o=e.get("label");o&&s.push(o.hide(t));const h=e.get("slice");h.hideTooltip(),h&&s.push(h.hide(t)),yield Promise.all(s)}))}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("label");t&&(this.labels.removeValue(t),t.dispose());let i=e.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=e.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(e){const t=e.get("slice");t&&!t.isHidden()&&t.hover()}unhoverDataItem(e){const t=e.get("slice");t&&t.unhover()}updateLegendMarker(e){if(e){const t=e.get("slice");if(t){const i=e.get("legendDataItem");if(i){const e=i.get("markerRectangle");b.each(g.u,(i=>{null!=t.get(i)&&e.set(i,t.get(i))}))}}}}_arrangeDown(e){if(e){let t=this._getNextDown();e.sort(((e,t)=>e.y>t.y?1:e.y<t.y?-1:0)),b.each(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.top;e.y+s<t&&(e.y=t-s),e.label.set("y",e.y),t=e.y+i.bottom}))}}_getNextUp(){return this.labelsContainer.maxHeight()}_getNextDown(){return 0}_arrangeUp(e){if(e){let t=this._getNextUp();e.sort(((e,t)=>e.y<t.y?1:e.y>t.y?-1:0)),b.each(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.bottom;e.y+s>t&&(e.y=t-s),e.label.set("y",e.y),t=e.y+i.top}))}}_arrangeRight(e){if(e){let t=0;e.sort(((e,t)=>e.y>t.y?1:e.y<t.y?-1:0)),b.each(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.left;e.y+s<t&&(e.y=t-s),e.label.set("x",e.y),t=e.y+i.right}))}}_arrangeLeft(e){if(e){let t=this.labelsContainer.maxWidth();e.sort(((e,t)=>e.y<t.y?1:e.y>t.y?-1:0)),b.each(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.right;e.y+s>t&&(e.y=t-s),e.label.set("x",e.y),t=e.y+i.left}))}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(e){}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this)}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:u.F.classNames.concat([m.className])});var _=i(7652),y=i(751);class f extends h{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:l.CI,y:l.CI})}_prepareChildren(){super._prepareChildren();const e=this.chartContainer,t=e.innerWidth(),i=e.innerHeight(),s=this.get("startAngle",0),a=this.get("endAngle",0),r=this.get("innerRadius");let n=y.getArcBounds(0,0,s,a,1);const o=t/(n.right-n.left),h=i/(n.bottom-n.top);let c={left:0,right:0,top:0,bottom:0};if(r instanceof l.gG){let e=r.value,l=Math.min(o,h);e=Math.max(l*e,l-Math.min(i,t))/l,c=y.getArcBounds(0,0,s,a,e),this.setPrivateRaw("irModifyer",e/r.value)}n=y.mergeBounds([n,c]);const u=this._maxRadius;this._maxRadius=Math.min(o,h);const d=_.relativeToValue(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-d*(n.bottom+n.top)/2,dx:-d*(n.right+n.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||u!=this._maxRadius)&&this.series.each((e=>{e._markDirtyKey("startAngle")})),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each((e=>{e._markDirtyKey("innerRadius")}))}radius(e){let t=_.relativeToValue(this.get("radius",0),this._maxRadius),i=_.relativeToValue(this.get("innerRadius",0),t);if(e){let s=this.series.indexOf(e),a=this.series.length,l=e.get("radius");return null!=l?i+_.relativeToValue(l,t-i):i+(t-i)/a*(s+1)}return t}innerRadius(e){const t=this.radius();let i=_.relativeToValue(this.get("innerRadius",0),t);if(i<0&&(i=t+i),e){let s=this.series.indexOf(e),a=this.series.length,l=e.get("innerRadius");return null!=l?i+_.relativeToValue(l,t-i):i+(t-i)/a*s}return i}}Object.defineProperty(f,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(f,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:h.classNames.concat([f.className])});var v=i(5769),x=i(5863),w=i(2438),k=i(815),P=i(7144);class C extends m{_makeSlices(){return new P.o(v.YS.new({}),(()=>x.p._new(this._root,{themeTags:_.mergeTags(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template])))}_makeLabels(){return new P.o(v.YS.new({}),(()=>k.x._new(this._root,{themeTags:_.mergeTags(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template])))}_makeTicks(){return new P.o(v.YS.new({}),(()=>w.d._new(this._root,{themeTags:_.mergeTags(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template])))}processDataItem(e){super.processDataItem(e);const t=this.makeSlice(e);t.on("scale",(()=>{this._updateTick(e)})),t.on("shiftRadius",(()=>{this._updateTick(e)})),t.events.on("positionchanged",(()=>{this._updateTick(e)}));const i=this.makeLabel(e);i.events.on("positionchanged",(()=>{this._updateTick(e)})),this.makeTick(e),t.events.on("positionchanged",(()=>{i.markDirty()}))}_getNextUp(){const e=this.chart;return e?e._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const e=this.chart;return e?-e._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const e=this.chart;if(e){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let t=e.get("textType");null!=t&&"aligned"!=t||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const t=this.get("startAngle",e.get("startAngle",-90)),i=this.get("endAngle",e.get("endAngle",270))-t;let s=t;const a=e.radius(this);this.setPrivateRaw("radius",a);let r=e.innerRadius(this)*e.getPrivate("irModifyer",1);r<0&&(r=a+r),b.each(this._dataItems,(e=>{this.updateLegendValue(e);let t=i*e.get("valuePercentTotal")/100;const n=e.get("slice");if(n){n.set("radius",a),n.set("innerRadius",r),n.set("startAngle",s),n.set("arc",t);const i=e.get("fill");n._setDefault("fill",i),n._setDefault("stroke",i)}let o=y.normalizeAngle(s+t/2);const h=e.get("label");if(h&&(h.setPrivate("radius",a),h.setPrivate("innerRadius",r),h.set("labelAngle",o),"aligned"==h.get("textType"))){let e=a+h.get("radius",0),t=a*y.sin(o);o>90&&o<=270?(h.isHidden()||h.isHiding()||this._lLabels.push({label:h,y:t}),e*=-1,e-=this.labelsContainer.get("paddingLeft",0),h.set("centerX",l.AQ),h.setPrivateRaw("left",!0)):(h.isHidden()||h.isHiding()||this._rLabels.push({label:h,y:t}),e+=this.labelsContainer.get("paddingRight",0),h.set("centerX",0),h.setPrivateRaw("left",!1)),h.set("x",e),h.set("y",a*y.sin(o))}s+=t,this._updateTick(e)}))}}}_updateTick(e){const t=e.get("tick"),i=e.get("label"),s=e.get("slice"),a=t.get("location",1);if(t&&i&&s){const e=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*a,l=i.get("labelAngle",0),r=y.cos(l),n=y.sin(l),o=this.labelsContainer,h=o.get("paddingLeft",0),c=o.get("paddingRight",0);let u=0,d=0;if(u=i.x(),d=i.y(),"circular"==i.get("textType")){const e=i.radius()-i.get("paddingBottom",0),t=i.get("labelAngle",0);u=e*y.cos(t),d=e*y.sin(t)}let g=-c;i.getPrivate("left")&&(g=h),t.set("points",[{x:s.x()+e*r,y:s.y()+e*n},{x:u+g,y:d},{x:u,y:d}])}}_positionBullet(e){const t=e.get("sprite");if(t){const i=t.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),a=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*e.get("locationX",.5),r=s+(a-s)*e.get("locationY",.5);t.setAll({x:y.cos(l)*r,y:y.sin(l)*r})}}}}Object.defineProperty(C,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(C,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:m.classNames.concat([C.className])});class A extends g.T{constructor(){super(...arguments),Object.defineProperty(this,"_projectionDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tlx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tly",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_trx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_try",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_blx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_bly",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_brx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_bry",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cprx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cplx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cpry",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cply",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){super._afterNew(),this.set("draw",(e=>{e.moveTo(this._tlx,this._tly),e.lineTo(this._trx,this._try),e.quadraticCurveTo(this._cprx,this._cpry,this._brx,this._bry),e.lineTo(this._blx,this._bly),e.quadraticCurveTo(this._cplx,this._cply,this._tlx,this._tly)}))}getPoint(e,t){let i=this.width(),s=this.height();const a=this.get("topWidth",0),l=this.get("bottomWidth",0);if("vertical"==this.get("orientation")){let i=-a/2,r=a/2,n=i+(-l/2-i)*t;return{x:n+(r+(l/2-r)*t-n)*e,y:s*t}}{let s=-a/2,r=a/2,n=s+(-l/2-s)*e;return{x:i*e,y:n+(r+(l/2-r)*e-n)*t}}}_changed(){if(this.isDirty("topWidth")||this.isDirty("bottomWidth")||this.isDirty("expandDistance")||this.isDirty("orientation")||this.isDirty("width")||this.isDirty("height")){const e=this.width(),t=this.height(),i=this.get("topWidth",0),s=this.get("bottomWidth",0);this._clear=!0;let a=this.get("expandDistance",0);"vertical"==this.get("orientation")?(this._tlx=-i/2,this._tly=0,this._trx=i/2,this._try=0,this._brx=s/2,this._bry=t,this._blx=-s/2,this._bly=t,this._cprx=this._trx+(this._brx-this._trx)/2+a*t,this._cpry=this._try+.5*t,this._cplx=this._tlx+(this._blx-this._tlx)/2-a*t,this._cply=this._tly+.5*t):(this._tly=-i/2,this._tlx=0,this._try=i/2,this._trx=0,this._bry=s/2,this._brx=e,this._bly=-s/2,this._blx=e,this._cpry=this._try+(this._bry-this._try)/2+a*e,this._cprx=this._trx+.5*e,this._cply=this._tly+(this._bly-this._tly)/2-a*e,this._cplx=this._tlx+.5*e)}super._changed()}}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"FunnelSlice"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:g.T.classNames.concat([A.className])});var D=i(962);class T extends m{constructor(){super(...arguments),Object.defineProperty(this,"_tag",{enumerable:!0,configurable:!0,writable:!0,value:"funnel"}),Object.defineProperty(this,"links",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLinks()}),Object.defineProperty(this,"_total",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_nextCoord",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_opposite",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_makeSlices(){return new P.o(v.YS.new({}),(()=>A._new(this._root,{themeTags:_.mergeTags(this.slices.template.get("themeTags",[]),[this._tag,"series","slice",this.get("orientation")])},[this.slices.template])))}_makeLabels(){return new P.o(v.YS.new({}),(()=>D._._new(this._root,{themeTags:_.mergeTags(this.labels.template.get("themeTags",[]),[this._tag,"series","label",this.get("orientation")])},[this.labels.template])))}_makeTicks(){return new P.o(v.YS.new({}),(()=>w.d._new(this._root,{themeTags:_.mergeTags(this.ticks.template.get("themeTags",[]),[this._tag,"series","tick",this.get("orientation")])},[this.ticks.template])))}_makeLinks(){return new P.o(v.YS.new({}),(()=>A._new(this._root,{themeTags:_.mergeTags(this.links.template.get("themeTags",[]),[this._tag,"series","link",this.get("orientation")])},[this.links.template])))}makeLink(e){const t=this.slicesContainer.children.push(this.links.make());return t._setDataItem(e),e.set("link",t),this.links.push(t),t}_afterNew(){super._afterNew();const e=this.slicesContainer;e.setAll({isMeasured:!0,position:"relative",width:(0,l.aQ)(100),height:(0,l.aQ)(100)}),e.onPrivate("width",(()=>{this.markDirtySize()})),e.onPrivate("height",(()=>{this.markDirtySize()})),"vertical"==this.get("orientation")?this.set("layout",this._root.horizontalLayout):this.set("layout",this._root.verticalLayout)}processDataItem(e){super.processDataItem(e);const t=this.makeSlice(e);t._setDataItem(e),e.set("slice",t),this.makeLink(e);const i=this.makeLabel(e);i.on("x",(()=>{this._updateTick(e)})),i.on("y",(()=>{this._updateTick(e)})),this.makeTick(e),t.events.on("positionchanged",(()=>{i.markDirty()})),t.events.on("boundschanged",(()=>{const e=t.dataItem;e&&this._updateTick(e)}))}_updateChildren(){this._opposite=!1,0==this.children.indexOf(this.labelsContainer)&&(this._opposite=!0);let e=0,t=0;if(b.each(this.dataItems,(i=>{const s=i.get("value");p.isNumber(s)&&(t++,s>0?e+=Math.abs(i.get("valueWorking",s)/s):this.get("ignoreZeroValues",!1)||i.isHidden()?t--:e+=1)})),this._total=1/t*e,this._count=t,this.isDirty("alignLabels")&&this._fixLayout(),this._total>0&&(this._valuesDirty||this._sizeDirty)){const e=this.slicesContainer;let t;t="vertical"==this.get("orientation")?e.innerHeight():e.innerWidth(),this._nextCoord=this.get("startLocation",0)*t,this.markDirtyBounds();let i=0;b.each(this._dataItems,(e=>{this.updateLegendValue(e),e.set("index",i),i++;const t=e.get("slice"),s=e.get("tick"),a=e.get("label"),l=e.get("link"),r=e.get("fill");t._setDefault("fill",r),t._setDefault("stroke",r),l._setDefault("fill",r),l._setDefault("stroke",r);const n=e.get("value");p.isNumber(n)&&(0==n&&this.get("ignoreZeroValues")?(t.setPrivate("visible",!1),s.setPrivate("visible",!1),a.setPrivate("visible",!1)):(t.setPrivate("visible",!0),s.setPrivate("visible",!0),a.setPrivate("visible",!0),this.decorateSlice(e),this.isLast(e)?l.setPrivate("visible",!1):e.isHidden()||l.setPrivate("visible",!0)))}))}super._updateChildren()}_fixLayout(){const e=this.get("orientation"),t=this.labelsContainer,i=this.labels.template;this.get("alignLabels")?(t.set("position","relative"),t.setAll({isMeasured:!0}),"vertical"==e?(this.set("layout",this._root.horizontalLayout),i.setAll({centerX:l.AQ,x:l.AQ})):(this.set("layout",this._root.verticalLayout),i.setAll({centerX:0,x:0}))):(t.setAll({isMeasured:!1,position:"absolute"}),"vertical"==e?(t.setAll({x:l.CI}),i.setAll({centerX:l.CI,x:0})):(t.setAll({y:l.CI}),i.setAll({centerX:l.CI,y:0}))),this.markDirtySize()}getNextValue(e){let t=e.get("index"),i=e.get("valueWorking",0);if(t<this.dataItems.length-1){let e=this.dataItems[t+1];if(i=e.get("valueWorking",0),e.isHidden()||0==e.get("value")&&this.get("ignoreZeroValues"))return this.getNextValue(e)}return i}isLast(e){let t=e.get("index");if(t==this.dataItems.length-1)return!0;for(let e=t+1;e<this.dataItems.length;e++)if(!this.dataItems[e].isHidden())return!1;return!0}decorateSlice(e){const t=this.get("orientation"),i=e.get("slice"),s=e.get("label"),a=e.get("link"),l=this.slicesContainer;let r=l.innerWidth(),n=l.innerHeight(),o=r;"horizontal"==t&&(o=n);const h=this.getNextValue(e),c=e.get("value",0),u=Math.abs(e.get("valueWorking",c)),d=this.get("bottomRatio",0),g=this.getPrivate("valueHigh",0);let b=1;0!=c?b=u/Math.abs(c):e.isHidden()&&(b=1e-6),this._nextCoord==1/0&&(this._nextCoord=0);let p=u/g*o,m=(u-(u-h)*d)/g*o;i.setAll({topWidth:p,bottomWidth:m,orientation:t}),a.setAll({topWidth:m,bottomWidth:(u-(u-h))/g*o,orientation:t});const _=this.get("startLocation",0),y=this.get("endLocation",1);if("vertical"==t){let e=a.height()*b;n=n*(y-_)+e,i.set("y",this._nextCoord);let t=Math.min(1e5,Math.max(0,n/this._count*b/this._total-e));i.setAll({height:t,x:r/2});let l=this._nextCoord+t/2;s.set("y",l),this._nextCoord+=t+e,a.setAll({y:this._nextCoord-e,x:r/2})}else{let e=a.width()*b;r=r*(y-_)+e,i.set("x",this._nextCoord);let t=Math.min(1e5,Math.max(0,r/this._count*b/this._total-e));i.setAll({width:t,y:n/2});const l=this._nextCoord+t/2;s.set("x",l),this._nextCoord+=t+e,a.setAll({x:this._nextCoord-e,y:n/2})}}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return(0,c.mG)(this,void 0,void 0,(function*(){return e.get("link").hide(t),i.hideDataItem.call(this,e,t)}))}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return(0,c.mG)(this,void 0,void 0,(function*(){return e.get("link").show(t),i.showDataItem.call(this,e,t)}))}_updateTick(e){if(this.get("alignLabels")){const t=e.get("tick"),i=e.get("label"),s=e.get("slice");if(t&&s&&i){const e=this.labelsContainer,a=this.slicesContainer;let l=t.get("location",.5);const r=e.width(),n=e.height(),o=e.get("paddingLeft",0),h=e.get("paddingRight",0),c=e.get("paddingTop",0),u=e.get("paddingBottom",0);let d={x:0,y:0},g={x:0,y:0},b={x:0,y:0};this._opposite&&(l=1-l),"vertical"==this.get("orientation")?(d=s.getPoint(l,.5),d.x+=s.x()+a.x(),d.y+=s.y()+a.y(),this._opposite?(g.x=r,g.y=i.y(),b.x=r-o,b.y=g.y):(g.x=a.x()+a.width(),g.y=i.y(),b.x=g.x+r-i.width()-h,b.y=g.y)):(d=s.getPoint(.5,l),d.x+=s.x()+a.x(),d.y+=s.y()+a.y(),this._opposite?(g.y=n,g.x=i.x(),b.y=n-c,b.x=g.x):(g.y=a.y()+a.height(),g.x=i.x(),b.y=g.y+n-i.height()-u,b.x=g.x)),t.set("points",[d,g,b])}}}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("link");t&&(this.links.removeValue(t),t.dispose())}_positionBullet(e){const t=e.get("sprite");if(t){const i=t.dataItem.get("slice");if(i){const s=i.width(),a=i.height(),l=e.get("locationX",.5),r=e.get("locationY",.5);let n=0,o=0;"horizontal"==this.get("orientation")?o=a/2:n=s/2,t.setAll({x:i.x()+s*l-n,y:i.y()-o+a*r})}}}}Object.defineProperty(T,"className",{enumerable:!0,configurable:!0,writable:!0,value:"FunnelSeries"}),Object.defineProperty(T,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:m.classNames.concat([T.className])});class L extends T{constructor(){super(...arguments),Object.defineProperty(this,"_tag",{enumerable:!0,configurable:!0,writable:!0,value:"pyramid"}),Object.defineProperty(this,"_nextSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_prepareChildren(){super._prepareChildren(),this._nextSize=void 0}decorateSlice(e){const t=this.get("orientation"),i=this.slicesContainer,s=e.get("slice"),a=e.get("label"),r=e.get("link"),n=this.get("valueIs","area"),o=this.getPrivate("valueAbsoluteSum",0);if(0==o)return;const h=this.get("startLocation",0),c=this.get("endLocation",1),u=this.get("topWidth",0),d=this.get("bottomWidth",l.AQ),g=Math.abs(e.get("valueWorking",0)),b=e.get("value",0);let m,y,f=i.innerHeight(),v=i.innerWidth(),x=r.width(),w=r.height();"horizontal"==t&&([v,f]=[f,v],[x,w]=[w,x]);const k=v/2;let P=1;0!=b?P=g/Math.abs(b):e.isHidden()&&(P=1e-6),w*=P,f=f*(c-h)-w*(this._count*this._total-1);let C=_.relativeToValue(u,v);p.isNumber(this._nextSize)||(this._nextSize=C);let A=_.relativeToValue(d,v),D=this._nextSize,T=Math.atan2(f,C-A),L=Math.tan(Math.PI/2-T);if(0==L&&(L=1e-8),"area"==n){let e=(C+A)/2*f*g/o,t=Math.abs(D*D-2*e*L);m=(D-Math.sqrt(t))/L,y=m>0?(2*e-m*D)/m:D}else m=f*g/o,y=D-m*L;let I=this._nextCoord+m/2,S=k,N=this._nextCoord,O=k,j=N+m;"vertical"==t?(a.set("y",I),a.get("opacity")>0&&this._rLabels.push({label:a,y:I}),s.set("height",m)):(a.set("x",I),a.get("opacity")>0&&this._hLabels.push({label:a,y:I}),[S,N]=[N,S],[O,j]=[j,O],s.set("width",m)),s.setAll({orientation:t,bottomWidth:y,topWidth:D,x:S,y:N}),r.setAll({orientation:t,x:O,y:j,topWidth:y,bottomWidth:y}),this._nextSize=y,this._nextCoord+=m+w}}Object.defineProperty(L,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PyramidSeries"}),Object.defineProperty(L,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:T.classNames.concat([L.className])});class I extends L{constructor(){super(...arguments),Object.defineProperty(this,"_tag",{enumerable:!0,configurable:!0,writable:!0,value:"pictorial"}),Object.defineProperty(this,"seriesMask",{enumerable:!0,configurable:!0,writable:!0,value:g.T.new(this._root,{position:"absolute",x:l.CI,y:l.CI,centerX:l.CI,centerY:l.CI})}),Object.defineProperty(this,"seriesGraphics",{enumerable:!0,configurable:!0,writable:!0,value:this.slicesContainer.children.push(g.T.new(this._root,{themeTags:["pictorial","background"],position:"absolute",x:l.CI,y:l.CI,centerX:l.CI,centerY:l.CI}))})}_afterNew(){super._afterNew(),this.set("topWidth",l.AQ),this.set("bottomWidth",l.AQ),this.set("valueIs","height"),this.slicesContainer.set("mask",this.seriesMask)}_updateScale(){let e=this.slicesContainer,t=e.innerWidth(),i=e.innerHeight(),s=this.seriesMask,a=this.seriesGraphics,l=s.get("scale",1);const r=s.localBounds();let n=r.right-r.left,o=r.bottom-r.top;l="horizontal"==this.get("orientation")?t/n:i/o,l!=1/0&&NaN!=l&&(s.set("scale",l),s.set("x",t/2),s.set("y",i/2),a.set("scale",l),a.set("x",t/2),a.set("y",i/2))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("svgPath")){const e=this.get("svgPath");this.seriesMask.set("svgPath",e),this.seriesGraphics.set("svgPath",e)}this._updateScale()}}Object.defineProperty(I,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PictorialStackedSeries"}),Object.defineProperty(I,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:L.classNames.concat([I.className])});class S extends h{_afterNew(){super._afterNew(),this.seriesContainer.setAll({isMeasured:!0,layout:this._root.horizontalLayout})}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SlicedChart"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:h.classNames.concat([S.className])})},8685:function(e,t,i){i.r(t),i.d(t,{am5percent:function(){return s}});const s=i(2536)}},function(e){var t=(8685,e(e.s=8685)),i=window;for(var s in t)i[s]=t[s];t.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})}]);
//# sourceMappingURL=percent.js.map