if(!_.wordtree){_.wordtree=1;(function($){var Z4=function(){$.Yq.call(this);$.T(this.ua,Qma)},$4=function(a,b){$.gx.call(this);$.eu(this,this,this.rg,this.Gg,this.Fv,this.rg,null,null);this.pr=null;this.ou=[];this.hh=[];this.VN=this.gL=null;this.jg=[];this.Ss=[];$.T(this.ua,[["minFontSize",4,1],["maxFontSize",4,1],["postfix",4,1],["fontFamily",4,1],["fontStyle",16,1],["fontWeight",4,1],["fontColor",16,1],["fontOpacity",16,1],["fontDecoration",16,1]]);this.data(a,b)},Rma=function(a,b){var c=b.getParent();if(c){for(var d=0;d<c.Zb();d++){var e=
c.od(d);e!=b&&e.o("hidden",!0)}Rma(a,c)}},Sma=function(a){for(var b=0;b<a.hh.length;b++)a.hh[b].o("hidden",!1)},Tma=function(a,b,c){if(c.length){for(var d=b.Al(),e=!1,f=0;f<b.Zb();f++)if(d[f].get("value")==c[0]){e=!0;break}e?(c.shift(),b=d[f]):(b=b.fc({value:c[0]}),c.shift());return Tma(a,b,c)}return b},Uma=function(a){a=a.split(/\s*(.+?(?:[?!]+|$|\.(?=\s+[A-Z]|$)))\s*/);return a=(0,$.Ye)(a,function(a){return!!a.length})},a5=function(a){a=a.split(/([!?,;:.&"-]+|\S*[A-Z]\.|\S*(?:[^!?,;:.\s&-]))/);
return a=(0,$.Ye)(a,function(a){return a.length&&" "!=a})},Vma=function(a,b){null!=a.oa&&($.Zq(a.oa,a.Id,a),a.oa.cd());a.oa=b;$.L(a.oa,a.Id,a);a.B(4100,1)},Wma=function(a,b,c){if(b){var d=b.get("fontSize");if(null==d){if((d=b.getParent())&&(1==d.Zb()||c))return d=Wma(a,d,c),b.o("fontSize",d),d;c=a.i("maxFontSize");a=a.i("minFontSize");d=b.o("height")/1.5;d=$.Za(d,a,c);b.o("fontSize",d)}return d}return 0},Xma=function(a,b){if(b){var c=b.Zb(),d=0;if(c)for(var e=0;e<c;e++)d+=Xma(a,b.od(e));else d=b.get("weight")||
1;b.o("leafCount",d).o("weight",d);return d}return 0},Yma=function(a,b,c,d,e,f){if(b){b.o("connectorInXPosition",c[0]).o("connectorInYPosition",c[1]).o("connectorOutXPosition",c[0]+a.pV(b)).o("connectorOutYPosition",c[1]);var h=a.Xf.$a();if(d<h){c=a.Sn();var k=b.Zb(),l=c.i("length"),m=c.i("offset");c=c.i("curveFactor");var p=a.i("minFontSize");if(k){if(1<k){var q=p/10;e+=q;f-=q}q=e;for(var r=!1,t,u=0;u<k;u++)if(t=b.od(u),t.o("hidden")){r=!0;break}if((f-e)/k<1.5*p&&1<k){k="+"+b.o("leafCount")+" "+
a.i("postfix");var v=(f+e)/2;m=d;d=a.yx(m,v,k,b.o("fontSize")||p,a.i("fontFamily"),a.i("fontWeight"));v-=d.DG()/2;d.y(v);d.tag.node=b;d.tag.O1=!0;k=d.gT();m+k>=h&&d.visible(!1);a.rC(b.o("connectorOutXPosition"),b.o("connectorOutYPosition"),b.o("connectorOutXPosition")+20,(f+e)/2,c)}else for(r&&(d-=l+m),u=0;u<k;u++)if(t=b.od(u),!t.o("hidden")){m=t.o("leafCount");h=b.o("leafCount");h=r?f-e:(f-e)*Math.max(1,m)/Math.max(1,h);p=q;var w=0;q=p+h;m=d;v=p+h/2;var x=[m,v];t.o("height",h).o("nodePositionX",
m).o("nodePositionY",v);a.bL(t,r);v=b.o("textHeight")/2;x[1]-=v;1!=t.Zb()&&(w+=l);m=a.pV(t);v=[x[0],x[1]+v];w+=x[0]+m;Yma(a,t,v,w,p,p+h);1<b.Zb()&&!r&&a.rC(b.o("connectorOutXPosition"),b.o("connectorOutYPosition"),t.o("connectorInXPosition"),t.o("connectorInYPosition"),c)}}}}},Zma=function(a,b){var c=new $4(a,b);c.Fa("wordtree");return c};$.H(Z4,$.Yq);var b5={};$.hq(b5,[[0,"curveFactor",$.Tq],[0,"offset",$.Qq],[0,"length",$.Qq],[1,"stroke",$.Dq]]);$.U(Z4,b5);Z4.prototype.qa=8201;
var Qma=[["curveFactor",0,8],["offset",0,8],["length",0,8],["stroke",0,8192]];Z4.prototype.F=function(){var a=Z4.u.F.call(this);$.Hq(this,b5,a);return a};Z4.prototype.X=function(a,b){Z4.u.X.call(this,a,b);$.zq(this,b5,a,b)};$.H($4,$.gx);$4.prototype.qa=$.gx.prototype.qa;$4.prototype.sa=$.gx.prototype.sa|4112;var c5=function(){var a={};$.hq(a,[[0,"minFontSize",$.Qq],[0,"maxFontSize",$.Qq],[0,"fontFamily",$.oq],[0,"fontStyle",$.Xk],[0,"fontWeight",$.lq],[0,"fontColor",$.pq],[0,"fontOpacity",$.qq],[0,"fontDecoration",$.Wk],[0,"postfix",function(a){if($.n(a))return null===a&&(a=this.mf("postfix")),String(a)}]]);return a}();$.U($4,c5);$.g=$4.prototype;$.g.Na=function(){return"wordtree"};
$.g.Ej=function(){return!(this.oa&&(!this.oa||this.oa.Zb()))};$.g.Te=function(){return[]};$.g.At=function(){return[this]};$.g.dU=function(a,b){return function(c){return a*(1-c)+b*c}};$.g.qk=function(a,b){return $.cu(this.data(),b)};$.g.Sn=function(a){this.xm||(this.xm=new Z4,$.W(this,"connectors",this.xm),$.L(this.xm,this.sga,this));return a?(this.xm.K(a),this):this.xm};
$.g.fC=function(a){this.wl||(this.wl=new $.rw);var b={};a&&(b.value={value:a.get("value"),type:"string"},b.weight={value:a.o("weight"),type:"number"});this.wl.Ag(a);return $.av(this.wl,b)};$.g.Pq=function(a){if(a){"array"==$.ka(a)&&(a=a[0]);if(!$.K(a,$.Qt)&&(a=this.data().op("value",a)[0],!a))return;this.gL=a;Rma(this,a);this.B(20,1)}};$.g.zx=function(){Sma(this);this.gL&&this.gL.getParent()&&this.Pq(this.gL.getParent());return this};
$.g.sga=function(a){var b=0;$.X(a,8192)&&(b|=16);$.X(a,8)&&(b|=4);this.B(b,1)};$.g.Id=function(a){$.X(a,16)&&this.B(4100,9)};$.g.Fv=function(a){a.button==$.Mi&&(a=a.domTarget.tag)&&a.node&&(Sma(this),this.Pq(a.node))};$.g.rg=function(a){var b=a.domTarget.tag;if(b&&b.node&&!b.O1){var c=b.node;b=this.Xa();$.Aw(b,a.clientX,a.clientY,this.fC(c))}else this.Xa().Oc()};$.g.Gg=function(){this.Xa().Oc()};
$.g.vX=function(a){if("implicit"==this.je){if($.n(a)){if(this.VN!=a||this.e0){this.e0=!1;if(null===a||/^[\s\xa0]*$/.test(a))a=this.Ov[0][0];this.VN=a;for(var b=[],c=0;c<this.Ov.length;c++){var d=(0,$.za)(this.Ov[c],a);-1!=d&&b.push($.Ja(this.Ov[c],d))}b.length||(b[0]=[a]);a=b[0][0];$.V(this.data());this.data().Zb()&&this.data().jj(0);c={value:a};c=this.data().og(c,0);for(d=0;d<b.length;d++){var e=b[d];e[0]==a&&(e.shift(),Tma(this,c,e))}this.data().da(!0)}return this}return this.VN}return this};
$.g.data=function(a,b){if($.n(a)){if($.K(a,$.Nt)||$.K(a,$.Kt))this.oa!=a&&(this.oa&&$.Zq(this.oa,this.Id,this),this.oa=a,$.L(this.oa,this.Id,this),this.je="explicit",this.B(4100,1));else if("array"==$.ka(a)&&"object"==$.ka(a[0]))this.data($.au(a,b));else if(null===a)this.oa&&($.Zq(this.oa,this.Id),this.oa.cd()),this.oa=null,this.B(4100,1);else{this.je="implicit";this.jg=a;if("array"==$.ka(a)&&a.length)if(this.Ov=[],"array"==$.ka(a[0]))for(var c=0;c<a.length;c++)this.Ov.push(a5(a[c][0]));else{if("string"==
$.ka(a[0]))for(c=0;c<a.length;c++)this.Ov.push(a5(a[c]))}else if("string"==$.ka(a)){c=Uma(a);for(var d=[],e=0;e<c.length;e++)d.push(a5(c[e]));this.Ov=d}else this.Ov=[[a.toString()]];this.oa||Vma(this,$.au());this.e0=!0;this.vX(this.Ov[0][0])}return this}return this.oa};$.g.ii=function(){var a;0<this.Ss.length?a=this.Ss.pop():a=new $.Mh;return a};$.g.pV=function(a){if(a){var b=a.o("textWidth"),c=this.Sn().i("offset"),d=a.getParent();d&&1<d.Zb()&&(b+=c);1<a.Zb()&&(b+=c);return b}return 0};
$.g.depth=function(a){if(a){var b=a.Zb(),c=0,d=a.getParent();d&&(c=d.o("depth")+1);a.o("depth",c);for(c=0;c<b;c++)this.depth(a.od(c))}};$.g.yx=function(a,b,c,d,e,f){var h=this.ii();h.tag||(h.tag={});h.text(c);h.y(b);h.x(a);h.fontSize(d);h.fontFamily(e);h.fontWeight(f);h.width(null);h.visible(!0);this.ou.push(h);return h};$.g.rC=function(a,b,c,d,e){var f=this.cC,h=this.dU(a,c),k=h(e);e=h(1-e);f.moveTo(a,b).yk(k,b,e,d,c,d)};
$.g.bL=function(a,b){var c=0,d=a.getParent();d&&1<d.Zb()&&(c+=this.Sn().i("offset"));var e=a.get("value");1==a.Zb()&&(e+=" ");c=a.o("nodePositionX")+c;d=a.o("nodePositionY");var f=a.get("fontFamily")||this.i("fontFamily");var h=a.get("fontWeight")||this.i("fontWeight");var k=Wma(this,a,b);f=this.yx(c,d,e,k,f,h);f.tag={node:a,type:"node",O1:!1};h=f.DG();e=f.gT();a.o("textHeight",h).o("textWidth",e);d-=h/2;h=c+e;k=this.Xf.$a();h>k&&f.width(e-(h-k)-.05*e);f.x(c).y(d)};
$.g.ei=function(a){if(!this.ef())if(this.va||(this.va=this.La.Dd(),this.cC=new $.zg,this.va.zIndex(30)),this.Ej())this.va.Ki();else{var b=this.pr=this.oa.od(0);this.J(4096)&&(Xma(this,this.pr),this.depth(this.pr),this.hh.length=0,this.hh=this.data().Av().LB(),this.I(4096));if(this.J(4)){this.va.Ki();var c=a.left;var d=a.top;a=a.height;for(var e=this.Sn(),f=e.i("offset"),h=0;h<this.ou.length;h++){var k=this.ou[h];this.Ss.push(k)}this.ou.length=0;this.cC.clear();this.va.suspend();k=[c+f,d+a/2];b.o("nodePositionX",
k[0]).o("nodePositionY",k[1]).o("height",a);this.bL(b,!1);c=c+f+this.pV(b)+(1<b.Zb()?e.i("length"):0);Yma(this,b,k,c,d,d+a);this.cC.parent(this.va);this.I(4);for(h=0;h<this.ou.length;h++)this.ou[h].parent(this.va);this.va.resume();this.B(16)}if(this.J(16)){this.va.suspend();this.cC.stroke(this.Sn().i("stroke"));d=this.i("fontColor");c=this.i("fontDecoration");a=this.i("fontStyle");e=this.i("fontOpacity");for(f=0;f<this.ou.length;f++){b=this.ou[f];if(b.tag&&b.tag.node){var l=b.tag.node;var m=l.get("fontColor")||
d;var p=l.get("fontDecoration")||c;var q=l.get("fontStyle")||a;l=l.get("fontOpacity")||e}b.color(m);b.Lq(p);b.fontStyle(q);b.opacity(l);b.rm(!1)}this.va.resume();this.I(16)}}};$.g.F=function(){var a=$4.u.F.call(this);$.Hq(this,c5,a);"implicit"==this.je&&(a.wordTreeRawData=JSON.stringify(this.jg),a.word=this.VN);a.treeData=this.data().OA(["hidden"]);a.connectors=this.Sn().F();return{chart:a}};
$.g.X=function(a,b){$4.u.X.call(this,a,b);$.zq(this,c5,a,b);"wordTreeRawData"in a?(this.data(JSON.parse(a.wordTreeRawData)),"word"in a&&this.vX(a.word),"treeData"in a&&Vma(this,$.Pt(a.treeData))):"treeData"in a&&this.data($.Pt(a.treeData));"connectors"in a&&this.Sn().ia(!!b,a.connectors)};$.g.R=function(){$4.u.R.call(this);$.td(this.xm,this.cC,this.ou,this.Ss,this.oa,this.va);this.oa=this.cC=this.xm=null;this.ou.length=0;this.Ss.length=0;this.va=null};var d5=$4.prototype;d5.connectors=d5.Sn;
d5.word=d5.vX;d5.getType=d5.Na;d5.drillTo=d5.Pq;d5.drillUp=d5.zx;d5.toCsv=d5.qk;d5.noData=d5.Pm;$.Jp.wordtree=Zma;$.F("anychart.wordtree",Zma);}).call(this,$)}
