/*
 FusionCharts JavaScript Library - Gantt Chart
 Copyright FusionCharts Technologies LLP
 License Information at <http://www.fusioncharts.com/license>

 @version 3.5.0
*/
FusionCharts.register("module",["private","modules.renderer.js-gantt",function(){var ea=this,E=ea.hcLib,Na=ea.window,ua=/msie/i.test(Na.navigator.userAgent)&&!Na.opera,rb=E.chartAPI,Oa=E.chartAPI,eb=E.extend2,e=E.pluck,d=E.pluckNumber,oa=E.getFirstColor,Ja=E.graphics,S=Ja.convertColor,fb=Ja.getDarkColor,hc=Ja.parseColor,Da=E.parseUnsafeString,Ea=E.getFirstValue,Zb=E.getValidValue,ka=E.Raphael,ic=E.COMMASTRING,Pa=E.setLineHeight,Eb=E.getDashStyle,Fb=E.toRaphaelColor,Qa=E.each,jc=E.FC_CONFIG_STRING,
Ka="rgba(192,192,192,"+(ua?.002:1E-6)+")",$b=Ja.mapSymbolName,ua=Math,La=ua.ceil,va=ua.round,W=ua.max,Ca=ua.min,ac=ua.abs,Ra=parseInt,Gb=parseFloat,kc={pageX:0,pageY:0},T=E.plotEventHandler,ha,ca,sb=E.hasTouch=void 0!==Na.document.documentElement.ontouchstart,lc=E.addEvent,mc=E.removeEvent,Sa=function(b){return void 0!==b&&null!==b},Ta={left:"start",right:"end",center:"middle"},gb={left:0,right:1,center:.5,undefined:.5},tb={top:1,bottom:0,middle:.5,undefined:.5},Ua={left:5,right:-5,center:0,undefined:0},
Fa=function(b,a){this.min=b.min;this.max=d(b.visibleMax,b.max);this.pixelValueRatio=a/(this.max-this.min);this.startPixel=b.chart.marginLeft+b.chart.ganttStartX};Fa.prototype={getPixel:function(b){return this.startPixel+(b-this.min)*this.pixelValueRatio}};Fa.prototype.constructor=Fa;rb("gantt",{friendlyName:"Gantt Chart",rendererId:"gantt",standaloneInit:!0,defaultSeriesType:"gantt",canvasborderthickness:1,defaultPlotShadow:1,creditLabel:!1,fireGroupEvent:!0,defaultPaletteOptions:function(){var b=
arguments;return E.extend2(E.extend2(E.extend2(E.extend2({},b[0]),b[1]),b[2]),b[3])}(eb({},E.defaultGaugePaletteOptions),{paletteColors:["AFD8F8 F6BD0F 8BBA00 FF8E46 008E8E D64646 8E468E 588526 B3AA00 008ED6 9D080D A186BE CC6600 FDC689 ABA000 F26D7D FFF200 0054A6 F7941C CC3300 006600 663300 6DCFF6".split(" "),"AFD8F8 F6BD0F 8BBA00 FF8E46 008E8E D64646 8E468E 588526 B3AA00 008ED6 9D080D A186BE CC6600 FDC689 ABA000 F26D7D FFF200 0054A6 F7941C CC3300 006600 663300 6DCFF6".split(" "),"AFD8F8 F6BD0F 8BBA00 FF8E46 008E8E D64646 8E468E 588526 B3AA00 008ED6 9D080D A186BE CC6600 FDC689 ABA000 F26D7D FFF200 0054A6 F7941C CC3300 006600 663300 6DCFF6".split(" "),
"AFD8F8 F6BD0F 8BBA00 FF8E46 008E8E D64646 8E468E 588526 B3AA00 008ED6 9D080D A186BE CC6600 FDC689 ABA000 F26D7D FFF200 0054A6 F7941C CC3300 006600 663300 6DCFF6".split(" "),"AFD8F8 F6BD0F 8BBA00 FF8E46 008E8E D64646 8E468E 588526 B3AA00 008ED6 9D080D A186BE CC6600 FDC689 ABA000 F26D7D FFF200 0054A6 F7941C CC3300 006600 663300 6DCFF6".split(" ")],bgColor:["FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF"],bgAngle:[270,270,270,270,270],bgRatio:["100","100","100","100","100"],bgAlpha:["100","100","100",
"100","100"],canvasBgColor:["FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF"],canvasBgAngle:[0,0,0,0,0],canvasBgAlpha:["100","100","100","100","100"],canvasBgRatio:["","","","",""],canvasBorderColor:["545454","545454","415D6F","845001","68001B"],canvasBorderAlpha:[100,100,100,90,100],gridColor:["DDDDDD","D8DCC5","99C4CD","DEC49C","FEC1D0"],gridResizeBarColor:["999999","545454","415D6F","845001","D55979"],categoryBgColor:["F1F1F1","EEF0E6","F2F8F9","F7F0E6","FFF4F8"],dataTableBgColor:["F1F1F1","EEF0E6",
"F2F8F9","F7F0E6","FFF4F8"],toolTipBgColor:["FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF"],toolTipBorderColor:["545454","545454","415D6F","845001","68001B"],baseFontColor:["555555","60634E","025B6A","A15E01","68001B"],borderColor:["767575","545454","415D6F","845001","68001B"],borderAlpha:[50,50,50,50,50],legendBgColor:["ffffff","ffffff","ffffff","ffffff","ffffff"],legendBorderColor:["666666","545454","415D6F","845001","D55979"],plotBorderColor:["999999","8A8A8A","6BA9B6","C1934D","FC819F"],plotFillColor:["EEEEEE",
"D8DCC5","BCD8DE","E9D8BE","FEDAE3"],scrollBarColor:["EEEEEE","D8DCC5","99C4CD","DEC49C","FEC1D0"]}),charttopmargin:10,chartbottommargin:20,series:function(){var b=this.dataObj,a=b.chart,J=(J=b.categories)||[],c=J.length,q=this.hcJSON,k=q.chart,s=q[jc],y=this.smartLabel,f=this.colorManager,g=q.categories={},u=[],n=this.inCanvasStyle,r=this.numberFormatter,C=Infinity,l=-Infinity,t=k.origW-k.marginLeft-k.marginRight,D=k.origH-k.marginTop-k.marginBottom,m=b.processes||{},h=m&&m.process,x=h&&h.length,
v=Ra(n.fontSize,10),P=b.datatable,pa=P&&P.datacolumn,G=pa&&pa.length,Y=b.connectors,L=Y&&Y.length,M=q.connectors=[],N=b.milestones&&b.milestones.milestone,B=N&&N.length,Z=q.milestone=[],H=b.tasks,$=H&&H.task,K=$&&$.length,w=0,p=0,bc=d(a.forceganttwidthpercent,0),aa=0,T=0,ca=!1,ka={top:"top",bottom:"bottom"},A={top:"top",bottom:"bottom",undefined:"middle"},Q={right:"right",left:"left"},ba={right:"right",left:"left",undefined:"center"},F=q.dataTable={},hb=Infinity,ib=-Infinity,ha=q.processIDMap=[],
ea,ua,La=d(a.dateintooltip,1),Ja=b.legend&&b.legend.item,Fa=q.tasksMap||(q.tasksMap={}),Na=0,Oa=0,ub,za,Hb,Ib,jb,vb,Qa,Jb,Kb,qa,wa,Aa,Ta,gb,Ua,Qb,wb,rb,xa,na,kb,R,Lb,Va,Wa,Mb,Nb,Ba,la,ma,Xa,Ya,Za,lb,$a,ab,Ga,Ha,fa,sb,Rb,ga,ia,da,mb,nb,bb,U,I,Sb,cb,xb,Ia,yb,Tb,Ob,ob,Ub,zb,Ab,Bb,Cb,Db,Pb,pb,tb,cc,dc,ec,Ma,V,fc,sa,O,ya,ra,qb,ja,Vb,Wb,Xb,Yb,ta,db,gc,z,X;if(x){q.tasks=[];delete q.yAxis;delete q.xAxis;k.backgroundColor=S(e(a.bgcolor,"FFFFFF"),e(a.bgalpha,f.getColor("bgAlpha")));d(a.showborder,0)||(k.borderWidth=
0);k.plotBorderColor=S(e(a.canvasbordercolor,f.getColor("canvasBorderColor")),0===d(a.showcanvasborder,1)?0:e(a.canvasborderalpha,100));k.backgroundColor={FCcolor:{color:e(a.bgcolor,"FFFFFF"),alpha:e(a.bgalpha,f.getColor("bgAlpha")),angle:e(a.bgangle,f.getColor("bgAngle")),ratio:e(a.bgratio,f.getColor("bgRatio"))}};k.plotBackgroundColor={FCcolor:{color:e(a.canvasbgcolor,f.getColor("canvasBgColor")),alpha:e(a.canvasbgalpha,f.getColor("canvasBgAlpha")),angle:e(a.canvasbgangle,f.getColor("canvasBgAngle")),
ratio:e(a.canvasbgratio,f.getColor("canvasBgRatio"))}};k.plotBorderWidth=d(a.canvasborderthickness,1);k.outputDateFormat=e(a.outputdateformat,k.dateFormat);k.extendCategoryBg=d(a.extendcategorybg,0);k.ganttLineColor=S(e(a.ganttlinecolor,f.getColor("gridColor")),d(a.ganttlinealpha,100));k.ganttLineThickness=d(a.ganttlinethickness,1);k.ganttLineDashStyle=d(a.ganttlinedashed,0)?Eb(d(a.ganttlinedashlen,1),a.ganttlinedashgap,k.ganttLineThickness):void 0;k.gridBorderColor=S(e(a.gridbordercolor,f.getColor("gridColor")),
d(a.gridborderalpha,100));k.gridBorderThickness=d(a.gridborderthickness,1);k.gridBorderDashStyle=d(a.gridborderdashed,0)?Eb(d(a.gridborderdashlen,1),a.gridborderdashgap,k.gridborderThickness):void 0;k.showSlackAsFill=d(a.showslackasfill,1);k.slackFillColor=oa(e(a.slackfillcolor,"FF5E5E"));k.gridResizeBarColor=S(e(a.gridresizebarcolor,f.getColor("gridResizeBarColor")),d(a.gridresizebaralpha,100));k.gridResizeBarThickness=d(a.gridresizebarthickness,1);k.taskBarRoundRadius=d(a.taskbarroundradius,0);
k.taskBarFillMix=a.taskbarfillmix;k.taskBarFillRatio=a.taskbarfillratio;void 0===k.taskBarFillMix&&(k.taskBarFillMix="{light-10},{dark-20},{light-50},{light-85}");void 0===k.taskBarFillRatio&&(k.taskBarFillRatio="0,8,84,8");k.connectorExtension=d(a.connectorextension,10);k.clickURL=e(a.clickurl,"");k.annRenderDelay=a.annrenderdelay;k.taskDatePadding=d(a.taskdatepadding,3);k.taskLabelPadding=d(a.tasklabelspadding,2);k.ganttStartX=d(a.ganttwidthpercent,65);100<k.ganttStartX&&(k.ganttStartX=100);Aa=
k.ganttStartX=.01*(100-k.ganttStartX)*t;k.gridWidth=t-k.ganttStartX;gc=d(a.showfulldatatable,1);bb=m.width;bb=d(k.ganttStartX*(/\%/g.test(bb)&&.01*Gb(bb,10))||bb);Aa-=d(bb,0);ea=va(bb);T+=1;for(z=0;z<G;z+=1)Jb=pa[z].width,Kb=d(k.ganttStartX*(/\%/g.test(Jb)&&.01*Gb(Jb,10))||Jb),Aa-=d(Kb,0),Kb=pa[z].width=va(Kb),T+=1;0<=Aa?Aa/=T:(ca=!0,Aa=k.ganttStartX/T);if(bc||!gc)for((isNaN(ea)||ca)&&(ea=Aa),z=0;z<G;z+=1)(isNaN(pa[z].width)||ca)&&(pa[z].width=Aa);for(z=0;z<c;z+=1){ia=J[z];C=Infinity;l=-Infinity;
mb=e(ia.bgcolor,f.getColor("categoryBgColor"));nb=d(ia.bgalpha,100);Xa=e(ia.font,n.fontFamily);Ya=d(ia.fontsize,v+1);Za=e(ia.fontcolor,n.color);lb=d(ia.isbold,1);$a=d(ia.isitalic,0);ab=d(ia.isunderline,0);d(ia.verticalpadding,3);Ga=e(ia.align,"center").toLowerCase();Ha=e(ia.valign,"middle").toLowerCase();sb=(Rb=ia.category)&&Rb.length;Ma=0;ja={};for(X=0;X<sb;X+=1)ga=Rb[X],la=r.getDateValue(ga.start).ms,ma=r.getDateValue(ga.end).ms,isNaN(la)&&(la=void 0),la>l&&(l=la),la<=C&&(C=la),isNaN(ma)&&(ma=void 0),
ma>l&&(l=ma),ma<=C&&(C=ma),fa=Da(e(ga.label,ga.name)),V={color:oa(e(ga.fontcolor,Za)),fontFamily:e(ga.font,Xa),fontSize:d(ga.fontsize,Ya)+"px",fontWeight:d(ga.isbold,lb)&&"bold"||"normal",fontStyle:d(ga.isitalic,$a)&&"italic"||"normal",textDecoration:d(ga.isunderline,ab)&&"underline"||"none"},Pa(V),y.setStyle(V),qa=y.getOriSize(fa),Ma=W(Ma,qa.height),O="FCCAT_"+z+"_"+X,Hb=e(ga.hoverbandcolor,ia.hoverbandcolor,a.categoryhoverbandcolor,a.hoverbandcolor,f.getColor("gridColor")),Ib=d(ga.hoverbandalpha,
ia.hoverbandalpha,a.categoryhoverbandalpha,a.hoverbandalpha,30),jb=d(ga.showhoverband,ia.showhoverband,a.showcategoryhoverband,a.showhoverband,a.showhovereffect,1),g[O]={text:fa,style:V,start:la,end:ma,index:X,isLast:z===c-1,bgColor:S(e(ga.bgcolor,mb),d(ga.bgalpha,nb)),dimension:ja,link:ga.link,align:ba[[e(ga.align,Ga).toLowerCase()]],vAlign:A[ka[e(ga.valign,Ha).toLowerCase()]],hoverColor:S(Hb,Ib),useHover:jb,usePlotHover:d(ga.showganttpanehoverband,ia.showganttpanehoverband,a.showganttpaneverticalhoverband,
jb)},g[ya]&&(g[ya].nextCol=g[O],g[O].prevCol=g[ya]),ya=O;if(xb=g["FCCAT_"+z+"_0"])g[O].first=xb,xb.last=g[O],g[cb]&&(g[cb].nextRow=xb,xb.prevRow=g[cb]);cb=O;ja.h=Ma+5+2*d(ia.verticalpadding,3);ja.y=p;ja.min=C;ja.max=l;ja.numCat=X;p+=ja.h;ib=W(ib,l);hb=Ca(hb,C)}g.min=hb;g.max=ib;if(x){Ma=wa=0;db="right"===e(m.positioningrid,"left").toLowerCase();V={color:oa(e(m.headerfontcolor,n.color)),fontFamily:e(m.headerfont,n.fontFamily),fontSize:d(m.headerfontsize,v+3)+"px",fontWeight:d(m.headerisbold,1)&&"bold"||
"normal",fontStyle:d(m.headerisitalic,0)&&"italic"||"normal",textDecoration:d(m.headerisunderline,0)&&"underline"||"none"};Pa(V);fa=Da(m.headertext);y.setStyle(V);qa=y.getOriSize(fa);wa=W(wa,qa.width);Ga=ba[Q[e(m.headeralign,"center").toLowerCase()]];Ha=A[ka[e(m.headervalign,"middle").toLowerCase()]];ja={};O=ra=cb="processHeader";F.processHeader={text:fa,style:V,align:Ga,vAlign:Ha,isHeader:!0,link:e(m.headerlink),dimension:{x:0,w:0,h:W(qa.height,p)},bgColor:S(e(m.headerbgcolor,f.getColor("dataTableBgColor")),
d(m.headerbgalpha,100)),key:O,isLast:db,drawResizer:!db&&G,prevCol:null,nextCol:null,prevRow:null,nextRow:null};mb=e(m.bgcolor,f.getColor("dataTableBgColor"));nb=d(m.bgalpha,100);Xa=e(m.font,n.fontFamily);Ya=d(m.fontsize,v);Za=e(m.fontcolor,n.color);lb=d(m.isbold,0);$a=d(m.isitalic,0);ab=d(m.isunderline,0);Ga=e(m.align,"center").toLowerCase();Ha=e(m.valign,"middle").toLowerCase();for(z=0;z<x;z+=1)da=h[z],Hb=e(da.hoverbandcolor,m.hoverbandcolor,a.processhoverbandcolor,a.hoverbandcolor,f.getColor("gridColor")),
Ib=d(da.hoverbandalpha,m.hoverbandalpha,a.processhoverbandalpha,a.hoverbandalpha,30),jb=d(da.showhoverband,m.showhoverband,a.showprocesshoverband,a.showhoverband,a.showhovereffect,1),V={color:oa(e(da.fontcolor,Za)),fontSize:d(da.fontsize,Ya)+"px",fontFamily:e(da.font,Xa),fontWeight:d(da.isbold,lb)&&"bold"||"normal",fontStyle:d(da.isitalic,$a)&&"italic"||"normal",textDecoration:d(da.isunderline,ab)&&"underline"||"none"},Pa(V),fa=Da(e(da.label,da.name)),y.setStyle(V),qa=y.getOriSize(fa),Ma=W(Ma,qa.height),
wa=W(wa,qa.width),ya=O,O=e(da.id,"__FCDPID__"+z).toUpperCase(),F[O]&&(O="__FCDPID__"+z),ha[z]=O,Sa(ub=d(da.height,a.rowheight))&&(ub=ac(ub),Na+=ub||0,Oa+=1),F[O]={text:qa.text,style:V,link:da.link,id:O,processHeight:ub,labelHeight:qa.height,align:ba[[e(da.align,Ga).toLowerCase()]],vAlign:A[ka[e(da.valign,Ha).toLowerCase()]],bgColor:S(e(da.bgcolor,mb),d(da.bgalpha,nb)),prevCol:F[ya],dimension:{},hoverColor:S(Hb,Ib),useHover:jb,usePlotHover:d(da.showganttpanehoverband,m.showganttpanehoverband,a.showganttpanehorizontalhoverband,
jb),isLast:db,nextCol:null,prevRow:null,nextRow:null},F[ya]&&(F[ya].nextCol=F[O]);F[O].first=F[ra];F[ra].last=F[O];F[ra].processCount=x;F[ra].countDefinedHeight=Oa;F[ra].totalHeight=Na;ua=F[ra].maxProcessHeight=Ma+8;isNaN(ea)&&(ea=wa+10);aa+=ea;ja.x=0;F[ra].dimension.w=ja.w=ea;ja.h=ua=W((D-F[ra].dimension.h)/x,ua)}db&&(aa=0);if(G)for(q.datacolumns=[],z=0;z<G;z+=1){U=pa[z];wa=0;mb=oa(e(U.bgcolor,P.bgcolor,f.getColor("dataTableBgColor")));nb=d(U.bgalpha,P.bgalpha,100);Xa=e(U.font,P.font,n.fontFamily);
Za=oa(e(U.fontcolor,P.fontcolor,n.color));Ya=d(U.fontsize,P.fontsize,v);lb=d(U.isbold,P.isbold,0);$a=d(U.isitalic,P.isitalic,0);ab=d(U.isunderline,P.isunderline,0);Ga=ba[Q[e(U.align,P.align,"center").toLowerCase()]];Ha=A[ka[e(U.valign,P.valign,"middle").toLowerCase()]];V={color:oa(e(U.headerfontcolor,P.headerfontcolor,Za)),fontFamily:e(U.headerfont,P.headerfont,Xa),fontSize:d(U.headerfontsize,P.headerfontsize,Ya+3)+"px",fontWeight:d(U.headerisbold,P.headerisbold,1)&&"bold"||"normal",fontStyle:d(U.headerisitalic,
P.headerisitalic,$a)&&"italic"||"normal",textDecoration:d(U.headerisunderline,P.headerisunderline,ab)&&"underline"||"none"};Pa(V);fa=Da(U.headertext);y.setStyle(V);qa=y.getOriSize(fa);wa=W(wa,qa.width);O=ra="_FCDtHeader_"+z;kb=F[O]={text:fa,style:V,align:ba[Q[e(U.headeralign,P.headeralign,Ga).toLowerCase()]],vAlign:A[ka[e(U.headervalign,P.headervalign,Ha).toLowerCase()]],link:e(U.headerlink),drawResizer:db||z<G-1,dimension:{x:0+aa,w:U.width,h:F.processHeader&&F.processHeader.dimension.h},isHeader:!0,
key:O,bgColor:S(e(U.headerbgcolor,P.headerbgcolor,f.getColor("dataTableBgColor")),d(U.headerbgalpha,P.headerbgalpha,100))};kb.data=[];fc=U.text||[];qb=F.processHeader;Ia=F[cb];Ia.nextRow=F[O];F[O].prevRow=Ia;qb=qb.nextCol;Ia=Ia.nextCol;ja={};cb=ra;for(X=0;qb;qb=qb.nextCol,Ia=Ia.nextCol,X+=1)ya=O,O="_FCDt_"+z+"_"+X,(sa=fc[X])?(V={fontFamily:e(sa.font,Xa),color:oa(e(sa.fontcolor,Za)),fontSize:d(sa.fontsize,Ya)+"px",fontWeight:d(sa.isbold,lb)&&"bold"||"normal",fontStyle:d(sa.isitalic,$a)&&"italic"||
"normal",textDecoration:d(sa.isunderline,ab)&&"underline"||"none"},Pa(V),y.setStyle(V),fa=Da(sa.label),qa=y.getOriSize(fa),wa=W(wa,qa.width),F[O]={text:fa,style:V,link:e(sa.link,""),bgColor:S(e(sa.bgcolor,mb),d(sa.bgalpha,nb)),align:ba[Q[e(sa.align,Ga).toLowerCase()]],vAlign:A[ka[e(sa.valign,Ha).toLowerCase()]],prevCol:F[ya],dimension:ja,nextCol:null,nextRow:null,prevRow:null}):F[O]={prevCol:F[ya],dimension:ja,isNaN:!0,nextCol:null,nextRow:null,prevRow:null},F[ya].nextCol=F[O],F[O].prevRow=Ia,Ia.nextRow=
F[O],F[O].hoverColor=F[ha[X]].hoverColor,F[O].useHover=F[ha[X]].useHover,F[O].usePlotHover=F[ha[X]].usePlotHover;F[O].first=F[ra];F[ra].last=F[O];isNaN(U.width)?kb.width=wa+10:kb.width=U.width;ja.x=0+aa;aa+=F[ra].dimension.w=ja.w=kb.width;ja.h=ua;q.datacolumns.push(kb)}db&&(da=F.processHeader,da.dimension.x=da.nextCol.dimension.x=aa,aa+=ea);bc||(k.ganttStartX=Ca(k.ganttStartX,aa));k.totalGridWidth=aa;Wb=b.trendlines||{};q.trendlines=[];for(z=0;z<Wb.length;z+=1)for(B=(Xb=Wb[z].line)&&Xb.length,X=0;X<
B;X+=1)ta=Xb[X],Yb=d(ta.istrendzone,0),Ba=e(ta.color,f.getColor("legendBorderColor")),V=eb({},s.trendStyle),V.color=S(Ba),Pa(V),q.trendlines.push({start:r.getDateValue(ta.start).ms,end:r.getDateValue(ta.end).ms,displayValue:Da(e(ta.displayvalue,ta.start)),color:S(Ba,d(ta.alpha,Yb?40:99)),style:V,isTrendZone:Yb,dashedStyle:d(ta.dashed,0)?Eb(d(ta.dashlen,3),d(ta.dashgap,3),d(ta.thickness,1)):void 0,thickness:d(ta.thickness,1)});if(K){C=Infinity;l=-Infinity;d(a.taskbarroundradius,0);Wa=a.taskbarfillmix;
Mb=a.taskbarfillratio;void 0===Wa&&(Wa="{light-10},{dark-20},{light-50},{light-85}");void 0===Mb&&(Mb="0,8,84,8");k.shadow=d(a.showshadow,1);Qa=d(a.showslackasfill,1);for(z=0;z<K;z+=1)I=$[z],Sb=w%x,la=r.getDateValue(I.start).ms,ma=r.getDateValue(I.end).ms,O=e(F[Ea(I.processid,"").toUpperCase()],F["__FCDPID__"+Sb],F[ha[Sb]]).id.toUpperCase(),yb=d(I.alpha,H.alpha,100),Ba=e(I.color,H.color,f.getColor("plotFillColor")),Ob=d(I.borderalpha,H.borderalpha,100),Tb=e(I.bordercolor,H.bordercolor,f.getColor("plotBorderColor")),
isNaN(la)&&(la=void 0),la>l&&(l=la),la<=C&&(C=la),isNaN(ma)&&(ma=void 0),ma>l&&(l=ma),ma<=C&&(C=ma),V={color:oa(e(I.fontcolor,H.fontcolor,n.color)),fontSize:d(I.fontsize,H.fontsize,v)+"px",fontFamily:e(I.font,H.font,n.fontFamily)},Pa(V),w+=1,ob=f.parseColorMix(Ba,Wa),Ub=f.parseAlphaList(yb.toString(),ob.length),zb=f.parseRatioList(Mb,ob.length),Ab=d(I.angle,H.angle,270),Pb=f.parseColorMix(e(I.slackfillcolor,H.slackfillcolor,a.slackfillcolor,"FF5E5E"),Wa),pb=Ca(d(I.percentcomplete,-1),100),fa=Ea(e(I.label,
I.name),""),Db="",d(I.showlabel,I.showname,H.showlabels,H.showname,a.showtasklabels,a.showtasknames,0)&&(Db=fa),d(I.showpercentlabel,H.showpercentlabel,a.showpercentlabel,0)&&-1!==pb&&(Db+=" "+pb+"%"),tb={FCcolor:{color:ob.join(),alpha:Ub,ratio:zb,angle:Ab}},Pb=Qa?{FCcolor:{color:Pb.join(),alpha:Ub,ratio:zb,angle:Ab}}:Ka,cc={FCcolor:{color:f.parseColorMix(e(I.hoverfillcolor,H.hoverfillcolor,a.taskhoverfillcolor,fb(Ba,80)),Wa).join(),alpha:f.parseAlphaList(e(I.hoverfillalpha,H.hoverfillalpha,a.taskhoverfillalpha,
yb).toString(),ob.length),ratio:zb,angle:Ab}},dc=S(e(I.hoverbordercolor,H.hoverbordercolor,a.taskhoverbordercolor,fb(Tb,80)),e(I.hoverborderalpha,H.hoverborderalpha,a.taskhoverborderalpha,Ob)),ec=Qa?{FCcolor:{color:f.parseColorMix(fb(e(I.slackhoverfillcolor,H.slackhoverfillcolor,a.slackhoverfillcolor,a.slackfillcolor,"FF5E5E"),80),Wa).join(),alpha:f.parseAlphaList(e(I.slackhoverfillalpha,H.slackhoverfillalpha,a.slackhoverfillalpha,yb).toString(),ob.length),ratio:zb,angle:Ab}}:Ka,Bb=r.getFormattedDate(la),
Cb=r.getFormattedDate(ma),za=Zb(Da(e(I.tooltext,I.hovertext,H.plottooltext,s.tooltext))),za=void 0!==za?E.parseTooltext(za,[3,28,29,30,31],{end:Cb,start:Bb,label:fa,percentComplete:-1!==pb?r.percentValue(pb):"",processName:F[O]&&F[O].text},I):(""!==fa?fa+(La?", ":""):"")+(La?Bb+" - "+Cb:""),Va=Ea(I.id,"").toUpperCase(),Fa[Ea(Va,z)]={dataObj:{processId:O,label:Db,labelAlign:ba[[e(I.labelalign,a.tasklabelsalign,"center").toLowerCase()]],link:I.link,start:la,end:ma,id:Ea(I.id,"").toUpperCase(),showAsGroup:d(I.showasgroup,
0),animation:d(I.animation,a.animation,a.defaultanimation,1),style:V,percentComplete:pb,color:Fb(tb),slackColor:Fb(Pb),hoverFillColor:Fb(cc),hoverBorderColor:dc,slackHoverColor:Fb(ec),showHoverEffect:d(I.showhovereffect,H.showhovereffect,a.showtaskhovereffect,a.showhovereffect,1),shadow:{opacity:W(yb,Ob)/100,inverted:!0},borderColor:S(Tb,Ob),borderThickness:d(I.showborder,H.showborder,1)?d(I.borderthickness,H.borderthickness,1):0,height:e(I.height,"35%"),topPadding:e(I.toppadding,"35%"),showPercentLabel:d(I.showpercentlabel,
H.showpercentlabel,a.showpercentlabel,0),startDate:d(I.showstartdate,H.showstartdate,a.showtaskstartdate)?Bb:void 0,endDate:d(I.showenddate,H.showenddate,a.showtaskenddate)?Cb:void 0,toolText:za,_start:I.start,_end:I.end,_formatSDate:Bb,_formatEDate:Cb,_label:fa}},u.push(Fa[Ea(Va,z)].dataObj);ib=W(ib,l);hb=Ca(hb,C)}q.series.push({showInLegend:!1,data:u});B=N&&N.length;for(z=0;z<B;z+=1)R=N[z],Va=Ea(R.taskid,"").toUpperCase(),Nb=e(R.shape,"polygon").toLowerCase(),Lb=d(R.numsides,5),Vb=0,"star"===Nb?
Vb=.4:(Nb=$b(Lb),Nb=$b(Lb).split("-")[0]),Ba=e(R.color,f.getColor("legendBorderColor")),za=Zb(Da(e(R.tooltext,R.hovertext,a.milestonetooltext))),void 0!==za&&Fa[Va]?(I=Fa[Va].dataObj,za=E.parseTooltext(za,[28,32,33,34,35,36],{date:r.getFormattedDate(R.date),taskStartDate:I._formatSDate,taskEndDate:I._formatEDate,taskLabel:I._label,taskPercentComplete:-1!==I.percentComplete?r.percentValue(I.percentComplete):"",processName:F[I.processId]&&F[I.processId].text},R)):za=r.getFormattedDate(R.date),Z.push({numSides:Lb,
startAngle:d(R.startangle,90),radius:R.radius,origDate:R.date,date:r.getDateValue(R.date),fillColor:oa(Ba),fillAlpha:.01*d(R.fillalpha,R.alpha,100),borderColor:oa(e(R.bordercolor,Ba)),borderAlpha:.01*d(R.borderalpha,R.alpha,100),hoverFillColor:oa(e(R.hoverfillcolor,a.milestonehoverfillcolor,fb(Ba,80))),hoverFillAlpha:.01*d(R.hoverfillalpha,a.milestonehoverfillalpha,R.fillalpha,R.alpha,100),hoverBorderColor:oa(e(R.hoverbordercolor,a.milestonehoverbordercolor,fb(e(R.bordercolor,Ba),80))),hoverBorderAlpha:.01*
d(R.hoverborderalpha,a.milestonehoverborderalpha,R.borderalpha,R.alpha,100),showHoverEffect:d(R.showhovereffect,a.showmilestonehovereffect,a.showhovereffect,1),depth:Vb,taskId:Va,borderThickness:d(R.borderthickness,1),link:R.link,toolText:za});for(z=0;z<L;z+=1)if(gb=(Ta=(xa=Y[z])&&xa.connector)&&Ta.length)for(X=0;X<gb;X+=1)na=Ta[X],Ua=e(na.color,xa.color,f.getColor("plotBorderColor")),Qb=d(na.alpha,xa.alpha,100),wb=d(na.thickness,xa.thickness,1),rb=d(na.isdashed,xa.isdashed,1),M.push({fromTaskId:Ea(na.fromtaskid,
"").toUpperCase(),toTaskId:Ea(na.totaskid,"").toUpperCase(),fromTaskConnectStart:d(na.fromtaskconnectstart,0),toTaskConnectStart:d(na.totaskconnectstart,1),color:S(Ua),alpha:.01*Qb,link:na.link,showHoverEffect:d(na.showhovereffect,xa.showhovereffect,a.showconnectorhovereffect,a.showhovereffect,1),hoverColor:S(e(na.hovercolor,xa.hovercolor,a.connectorhovercolor,fb(Ua,80)),d(na.hoveralpha,xa.hoveralpha,a.connectorhoveralpha,Qb)),hoverThickness:d(na.hoverthickness,xa.hoverthickness,a.connectorhoverthickness,
wb),thickness:wb,dashedStyle:rb?Eb(d(na.dashlen,xa.dashlen,5),d(na.dashgap,xa.dashgap,wb),wb):void 0});q.legend.enabled=Boolean(d(a.showlegend,1));q.legend.interactiveLegend=!1;q.legend.itemStyle.cursor="default";q.legend.itemHoverStyle={cursor:"inherit"};B=Ja&&Ja.length;for(z=0;z<B;z+=1)vb=Ja[z],Sa(vb.label)&&""!==vb.label&&q.series.push({name:Da(vb.label),showInLegend:!0,type:!1,color:hc(e(vb.color,f.getPlotColor()))});q.max=ib;q.min=hb;q.chart.hasScroll=!0;return q}},spaceManager:function(b,a,
J,c){this.titleSpaceManager(b,a,J,.3*c);var q=this.numberFormatter,k=b.chart,s=a.chart,y=b.dataTable,f=b.categories,g=b.scrollOptions={},u=y.__scrollOptions={},n=y.processHeader;c=c-k.marginTop-k.marginBottom;J=J-k.marginLeft-k.marginRight;var r=k.totalGridWidth,C=b.verticalScroll={enabled:d(s.useverticalscrolling,1)},l=d(s.ganttpaneduration,-1),t=e(s.ganttpanedurationunit,"s").toLowerCase(),D=q.getDateValue(s.scrolltodate).ms,m=n&&n.maxProcessHeight,h,x,q=0;if(n){h=n.processCount-n.countDefinedHeight;
b.legend.enabled&&(c-=this.placeLegendBlockBottom(b,a,J,c/2));c-=n.dimension.h;g.padding=d(s.scrollpadding,b.chart.plotBorderWidth/2);g.height=d(s.scrollheight,16);g.showButtons=!!d(s.scrollshowbuttons,1);g.buttonPadding=d(s.scrollbtnpadding,0);g.flatScrollBars=d(s.flatscrollbars,0);g.color=oa(e(s.scrollcolor,this.colorManager.getColor("altHGridColor")));a=g.height+g.padding;r>k.ganttStartX&&(u.enabled=!0,u.startPercent=Boolean(d(s.scrolltoend,0)));J-=k.ganttStartX;f.scroll={};g=new Date(f&&f.min);
if(-1!==l){switch(t){case "y":g.setYear(g.getFullYear()+l);break;case "m":g.setMonth(g.getMonth()+l);break;case "d":g.setDate(g.getDate()+l);break;case "h":g.setHours(g.getHours()+l);break;case "mn":g.setMinutes(g.getMinutes()+l);break;default:g.setSeconds(g.getSeconds()+l)}g=g.getTime();g>b.min&&g<b.max&&(b.visibleMax=g,f.scroll.enabled=!0)}if(u.enabled||f.scroll.enabled)c-=a;u=c-n.totalHeight;g=u/(h?h:n.processCount);!d(s.forcerowheight,0)&&!h&&n.totalHeight<c&&(g=c/n.processCount,u=c,x=!0);m>g&&
(m=3>m-g?g:u/va(u/m));n.maxProcessHeight=m;C.enabled&&g<m&&h||0>g?(u=m,C.startPercent=Boolean(d(s.scrolltoend,0)),J-=a):(C.enabled=!1,u=g);f.scroll.startPercent=d(s.scrolltoend,0);if(Infinity===b.min||-Infinity===b.max||b.min===b.max)b.min=f.min=0,b.max=f.max=1;if(Infinity===f.min||-Infinity===f.max)f.min=b.min,f.max=b.max;f.axis=new Fa(b,J);f.startX=f.axis.getPixel(Ca(f.min,b.min));f.endX=f.axis.getPixel(W(f.max,b.max));f.visibleW=J;D&&D>f.min&&D<f.max&&(f.scroll.startPercent=Ca((f.axis.getPixel(D)-
f.startX)/(f.endX-f.startX-f.visibleW),1));for(n=n.nextCol;n;){q+=n.dimension.h=x?u:n.processHeight||u;if(b=n.nextRow)for(;b;)b.dimension.h=n.dimension.h,b=b.nextRow;n=n.nextCol}y.processHeader.totalPH=q;k.processHeight=c+y.processHeader.dimension.h}}},rb.gaugebase);Oa("renderer.gantt",{drawProcess:function(b){var a=this,d=a.options,c=d.chart,q=a.paper,k=a.logic,s=k.smartLabel,y=a.canvasTop,f=a.canvasLeft,g=a.layers,u=g.gridLayer,n=g.gridHeaderLayer,r=c.gridBorderThickness,C=.5*r,l=c.gridBorderColor,
t=c.gridBorderDashStyle,D=0,m=0,h=[],x=y,v=b.dimension.w||16,P=b.dimension.x||0,pa=d.dataTable.processHeader,G=pa.nextCol.dimension.h,Y=pa.totalPH,k=S(e(k.dataObj.chart.rolloverbandcolor,"#FF0000"),e(k.dataObj.chart.rolloverbandalpha,30)),L=pa.items||(pa.items={}),d=d.categories||{},M,N,B,Z,H,$,K,w,p,E,aa;L.hoverEle||(L.hoverEle=q.rect(d.startX,0,d.endX,G,0,g.dataset).attr({fill:k,visibility:"hidden","stroke-width":0}));p=function(b){T.call(this,a,b,"ProcessClick")};E=function(b){ha=clearTimeout(ha);
if(!ca||ca.removed)ca=null;ca&&a.gridOutHandler.call(ca);a.gridHoverHandler.call(this);T.call(this,a,b,"ProcessRollOver")};for(aa=function(b){ca=this;ha=clearTimeout(ha);ha=setTimeout(function(){a.gridOutHandler.call(ca)},500);T.call(ca,a,b,"ProcessRollOut")};b;)w=b.dimension,K=f+P,B=b.text,B=b.align,L=b.items||(b.items={}),G=b.link,N=b.isHeader?n:u,Z=L.background,d=La(x+m)-.5,B={x:La(K+D)-.5,y:d,width:v+.5,height:w.h+C+.5,radius:0,fill:b.bgColor||Ka,"stroke-dasharray":t,stroke:l,cursor:G?"pointer":
"","stroke-width":0},Z?Z.attr(B):(L.background=q.rect(N).attr(B).hover(E,aa),M={isHeader:b.isHeader,label:b.text,vAlign:b.vAlign,align:b.align,link:b.link,id:b.id},L.background.click(p).data("dataObj",b).data("eventArgs",M).data("data",{y:d,gridObj:b,rollOverColor:k,useHover:!0,useNext:!0,height:w.h+C+.5,hoverEle:pa.items.hoverEle})),b.isNaN||(w=b.dimension,B=b.text,B=b.align,Z=L.label,B=b.text,Sa(B)&&""!==B&&($=b.style,s.setStyle($),H=s.getSmartText(B,v-8,W(Ra($.lineHeight,10),w.h)),$.title=H.oriText,
B=b.align,B={text:H.text,x:K+v*gb[B]+Ua[B],y:x+w.h-w.h*tb[b.vAlign],"text-anchor":Ta[B],cursor:G?"pointer":"","vertical-align":b.vAlign},Z?Z.attr(B):L.label=q.text(N).attr(B).css($).hover(E,aa).click(p).data("eventArgs",M).data("dataObj",b).data("data",{y:d,gridObj:b,rollOverColor:k,useHover:!0,height:w.h+C+.5,useNext:!0,hoverEle:pa.items.hoverEle}))),b.xPos=K,b.yPos=La(x+w.h)-r%2*.5,h.push("M",K,b.yPos,"h",v),(Z=L.hBorder)?Z.attr("path",h):L.hBorder=q.path(h,N).attr({"stroke-dasharray":t,stroke:l,
"stroke-width":r}),x+=w.h,b.nextCol||(D=C,m-=0,Z=b.first.items.vBorder,B=["M",La(K+v)-r%2*.5,y,"v",Y],Z?Z.attr("path",B):b.first.items.vBorder=q.path(B,n).attr({"stroke-dasharray":t,stroke:l,"stroke-width":r}),b.nextRow&&!b.isLast&&(b.first.items.dragEle||(b.first.items.dragEle=q.path(B,g.gridTracker).attr({stroke:c.gridResizeBarColor,"stroke-width":c.gridResizeBarThickness,visibility:"hidden"})),b.first.items.tracker||(b.first.items.tracker=q.path(B,g.gridTracker).attr({stroke:Ka,ishot:!0,"stroke-width":30}).css("cursor",
ka.svg&&"ew-resize"||"e-resize").drag(this.dragMove,this.dragStart,this.dragUp).data("drag-options",{grid:b.first,xPos:La(K+v)-r%2*.5,chart:a})))),b=b.nextCol},dragStart:function(){var b=this.data("drag-options"),a=b.grid,J=a.items,c=a.nextRow,e={style:{lineHeight:16}},k=a.nextCol.style||e,s=c&&c.nextCol&&c.nextCol.style||e,y=b.chart,f=y.canvasLeft,g=a.dimension,k=W(Ra(a.style.lineHeight,10),Ra(k.lineHeight,10))+2,e=W(Ra((c||e).style.lineHeight,10),Ra(s.lineHeight,10))+2;b.leftSideLimit=f+d(a.dimension.x,
0)+k;b.rightSideLimit=f+d(c&&c.dimension.x+c.dimension.w,g.x+g.w)-e;b.origX=b.lastX||(b.lastX=0);J.dragEle.show();y.trackerClicked=!0;b.draged=!1},dragMove:function(b){var a=this.data("drag-options"),d=a.grid.items,c=a.xPos+b,e=a.leftSideLimit,k=a.rightSideLimit;c<e&&(b=e-a.xPos);c>k&&(b=k-a.xPos);c={transform:"t"+(a.origX+b)+ic+0};this.attr(c);d.dragEle.attr(c);a.draged=!0;a.lastX=b},dragUp:function(){var b=this.data("drag-options"),a=b.chart,d=b.grid,c=d.nextRow,e=a.canvasLeft,k=d.dimension,s=c&&
c.dimension,y=d.items,f={hcJSON:{dataTable:{}}};a.trackerClicked=!1;y.dragEle.hide();b.draged&&(k.w=b.xPos+b.lastX-e-k.x,d.nextCol&&(d.nextCol.dimension.w=k.w),f.hcJSON.dataTable[d.key]={dimension:k},c&&(s.w+=s.x-k.x-k.w,s.x=k.x+k.w,c.dimension.w=s.w,c.dimension.x=s.x,a.drawProcess(c),f.hcJSON.dataTable[c.key]={dimension:s}),a.drawProcess(d),eb(a.logic.chartInstance.jsVars._reflowData,f,!0),b.xPos+=b.lastX,b.lastX+=b.origX)},drawCategories:function(){var b=this,a=b.options,e=a.chart,c=b.paper,q=b.layers,
k=b.logic.smartLabel,s=b.canvasTop,y=a.categories,f=a.dataTable.processHeader,g=y.FCCAT_0_0,u=y.axis,n=y.endX,r=y.startX,C=n-r,l=e.ganttLineThickness,t=f.totalPH+f.dimension.h,D=[],m=[],h=q.dataset,q=q.ganttHeaderLayer,x,v,P,E,G,Y,L,M,N,B,Z,H,$,K,w;$=function(a){T.call(this,b,a,"CategoryClick")};K=function(a){ha=clearTimeout(ha);if(!ca||ca.removed)ca=null;ca&&b.gridOutHandler.call(ca);b.gridHoverHandler.call(this);T.call(this,b,a,"CategoryRollOver")};w=function(a){ca=this;ha=clearTimeout(ha);ha=setTimeout(function(){b.gridOutHandler.call(ca)},
500);T.call(ca,b,a,"CategoryRollOut")};E=y.items||(y.items={});f=a.dataTable.processHeader;for(E.hoverEle=c.rect(0,s+f.dimension.h,50,f.totalPH,0,h).attr({fill:Ka,visibility:"hidden","stroke-width":0});g;)v=C/g.dimension.numCat,G=r+v*(g.index+1),N=G-v,M=g.dimension.h,B=N,H=s+g.dimension.y,Y=g.align,L=g.vAlign,P=g.link,E=g.items||(g.items={}),v=!(!g.nextRow&&g.nextCol),Z=a.verticalScroll.enabled&&v?a.scrollOptions.height:0,x={align:g.align,vAlign:g.vAlign,link:g.link,text:g.text},N=B=d(u.getPixel(g.start),
N),G=d(u.getPixel(!v&&g.nextCol.start||(v?W(g.end||0,a.max):void 0)),G),v=G-N,B=va(B)+.5,H=va(H)+.5,g.isLast&&(D.push("M",B,H,"v",t-g.dimension.y),H-=.5*l,M-=l,e.extendCategoryBg&&c.rect(B,H,v,t,0,h).attr({fill:g.bgColor,"stroke-width":0,stroke:e.ganttLineColor}).toBack()),E.background=c.rect(B,H,v+Z,M,0,q).attr({fill:g.bgColor,"stroke-width":0,cursor:P?"pointer":"",stroke:e.ganttLineColor}).click($).data("eventArgs",x).data("dataObj",g).hover(K,w).data("data",{x:B,width:v,gridObj:g,hoverEle:y.items.hoverEle}),
m.push("M",B,H,"v",M),g.nextRow&&m.push("M",r,H+M,"H",n+Z),k.setStyle(g.style),G=k.getSmartText(g.text,v-5,M),g.style.title=G.oriText,E.label=c.text(q).attr({text:G.text,x:B+v*gb[Y]+Ua[Y],y:H+M-M*tb[L],"text-anchor":Ta[Y],cursor:P?"pointer":"","vertical-align":L}).css(g.style).hover(K,w).click($).data("eventArgs",x).data("dataObj",g).data("data",{x:B,width:v,gridObj:g,hoverEle:y.items.hoverEle}),g=g.nextCol;for(;f;)D.push("M",y.startX,f.yPos,"H",n),f=f.nextCol;E=y.items||(y.items={});E.headerGrid=
c.path(m,q).attr({"stroke-dasharray":e.ganttLineDashStyle,"stroke-width":l,stroke:e.ganttLineColor});E.processGrid=c.path(D,h).attr({"stroke-dasharray":e.ganttLineDashStyle,"stroke-width":e.ganttLineThickness,stroke:e.ganttLineColor})},drawScroller:function(){var b=this,a=b.options,e=b.paper,c=b.layers,q=b.canvasTop,k=b.canvasHeight,s=a.scrollOptions,y=a.categories,f=y.startX,g=y.endX-f,u=s.flatScrollBars,n={hcJSON:{categories:{scroll:{}}}},r=c.dataset,C=c.datalabels,l=c.ganttTracker,t=c.ganttHeaderLayer,
D=b.logic.chartInstance&&b.logic.chartInstance.jsVars._reflowData||{},m=a.chart,h=c.gridLayer,x=(f=a.dataTable)&&f.processHeader,v=b.canvasLeft,P=b.canvasWidth,E=m.gridBorderThickness,G=m.totalGridWidth,Y=Ca(m.ganttStartX,G)+E,L=y.scroll,M=f&&f.__scrollOptions,N=a.verticalScroll,B={hcJSON:{dataTable:{__scrollOptions:{}},verticalScroll:{}}},Z=B.hcJSON.dataTable.__scrollOptions,H=x.totalPH,$=c.gridHeaderLayer,K=c.gridTracker,w,p,f=d(y.startX,m.ganttStartX),c=c.scroll=c.scroll||e.group("scroll").insertAfter(l);
L.enabled&&(a=y.visibleW/g,L.scroller=e.scroller(f,q+k-s.height,y.visibleW,s.height,!0,{showButtons:s.showButtons,displayStyleFlat:u,buttonWidth:s.buttonWidth,scrollRatio:a,scrollPosition:L.startPercent},c).attr({"scroll-display-style":u,fill:s.color}).scroll(function(a){p=-va(a*(g-y.visibleW));r&&r.transform(["T",p,r.data("vOffset")]);C&&C.transform(["T",p,C.data("vOffset")]);l&&l.transform(["T",p,l.data("vOffset")]);t&&t.transform(["T",p,0]);r&&r.data("hOffset",p);C&&C.data("hOffset",p);l&&l.data("hOffset",
p);n.hcJSON.categories.scroll.startPercent=a;eb(D,n,!0)}),function(){var a;ka.eve.on("raphael.scroll.start."+L.scroller.id,function(c){a=c;ea.raiseEvent("scrollstart",{scrollPosition:c},b.logic.chartInstance)});ka.eve.on("raphael.scroll.end."+L.scroller.id,function(c){ea.raiseEvent("scrollend",{prevScrollPosition:a,scrollPosition:c},b.logic.chartInstance)})}(),L.startPercent&&(p=-va(L.startPercent*(g-y.visibleW)),r&&r.data("hOffset",p),C&&C.data("hOffset",p),l&&l.data("hOffset",p),t&&t.transform(["T",
p,0]),r&&r.transform(["T",p,r.data("vOffset")]),C&&C.transform(["T",p,r.data("vOffset")]),l&&l.transform(["T",p,r.data("vOffset")])));M.enabled&&(M.scroller=e.scroller(v,q+k-s.height,Y,s.height,!0,{showButtons:s.showButtons,displayStyleFlat:u,buttonWidth:s.buttonWidth,scrollRatio:Y/G,scrollPosition:M.startPercent},c).attr({"scroll-display-style":u,fill:s.color}).scroll(function(a){p=-va(a*(G-Y));h&&h.transform(["T",p,h.data("vOffset")]);$&&$.transform(["T",p,0]);K&&K.transform(["T",p,K.data("vOffset")]);
h.data("hOffset",p);$.data("hOffset",p);K.data("hOffset",p);Z.startPercent=a;eb(D,B,!0)}),function(){var a;ka.eve.on("raphael.scroll.start."+M.scroller.id,function(c){a=c;ea.raiseEvent("scrollstart",{scrollPosition:c},b.logic.chartInstance)});ka.eve.on("raphael.scroll.end."+M.scroller.id,function(c){ea.raiseEvent("scrollend",{prevScrollPosition:a,scrollPosition:c},b.logic.chartInstance)})}(),M.startPercent&&(p=-va(M.startPercent*(G-Y)),h&&h.transform(["T",p,0]),K&&K.transform(["T",p,0]),$&&$.transform(["T",
p,0]),h.data("hOffset",p),K.data("hOffset",p)));N.enabled&&(w=m.processHeight-x.dimension.h,N.scroller=e.scroller(v+P-s.height,q+x.dimension.h,s.height,m.processHeight-x.dimension.h,!1,{showButtons:s.showButtons,displayStyleFlat:u,buttonWidth:s.buttonWidth,scrollRatio:w/H,scrollPosition:N.startPercent},c).attr({"scroll-display-style":u,fill:s.color}).scroll(function(a){p=-va(a*(H-w));h&&h.transform(["T",h.data("hOffset"),p]);r&&r.transform(["T",r.data("hOffset"),p]);C&&C.transform(["T",C.data("hOffset"),
p]);l&&l.transform(["T",l.data("hOffset"),p]);K&&K.transform(["T",K.data("hOffset"),p]);h.data("vOffset",p);K.data("vOffset",p);r.data("vOffset",p);l.data("vOffset",p);C.data("vOffset",p);B.hcJSON.verticalScroll.startPercent=a;eb(D,B,!0)}),function(){var a;ka.eve.on("raphael.scroll.start."+N.scroller.id,function(c){a=c;ea.raiseEvent("scrollstart",{scrollPosition:c},b.logic.chartInstance)});ka.eve.on("raphael.scroll.end."+N.scroller.id,function(c){ea.raiseEvent("scrollend",{prevScrollPosition:a,scrollPosition:c},
b.logic.chartInstance)})}(),N.startPercent&&(p=-va(N.startPercent*(H-w)),h&&h.transform(["T",h.data("hOffset"),p]),r&&r.transform(["T",r.data("hOffset"),p]),C&&C.transform(["T",C.data("hOffset"),p]),l&&l.transform(["T",l.data("hOffset"),p]),K&&K.transform(["T",K.data("hOffset"),p]),h.data("vOffset",p),K.data("vOffset",p),r.data("vOffset",p),C.data("vOffset",p),l.data("vOffset",p)))},finalizeScrollPlots:function(){var b=this,a=b.options,d=b.canvasTop,c=a.categories,e=c.endX,k=c.startX,s=c.scroll,y=
a.chart,f=a.dataTable,g=f&&f.processHeader,u=b.canvasLeft,n=y.gridBorderThickness,r=y.totalGridWidth,C=Ca(y.ganttStartX,r)+n,l,t,D,m,h,x=e-k-c.visibleW,e=b.container,v=f&&f.__scrollOptions,P=a.verticalScroll,T=g.totalPH,G=y.processHeight-g.dimension.h,Y,L,M,N,B,s=c.scroll,a=function(a){var e=b.elements.canvas,f=N.left,n=N.top,q=a.type,p=sb&&E.getTouchEvent(a)||kc,f=a.layerX||p.layerX||(a.pageX||p.pageX)-f;a=a.layerY||p.layerY||(a.pageY||p.pageY)-n;switch(q){case "dragstart":B=e.isPointInside(f,a);
Y=f>k&&f<k+c.visibleW;M=f>u&&f<k+c.visibleW&&a>d+g.dimension.h;L=f<k;l=B&&f||null;t=B&&a||null;break;case "dragend":B=!1;h=m=D=t=l=void 0;break;default:if(!B||b.trackerClicked)break;e=f-l;q=a-t;l=f;t=a;Y&&s&&s.scroller&&(D=s.scroller.attrs["scroll-position"]-e/x,s.scroller.attr({"scroll-position":D}));M&&P&&P.scroller&&(m=P.scroller.attrs["scroll-position"]-q/(T-G),P.scroller.attr({"scroll-position":m}));L&&v&&v.scroller&&(h=v.scroller.attrs["scroll-position"]-e/(r-C),v.scroller.attr({"scroll-position":h}))}};
sb&&(N=E.getPosition(e),e&&(mc(e,"dragstart drag dragend",a),lc(e,"dragstart drag dragend",a)))},gridHoverHandler:function(){var b=this.data("data"),a=b.gridObj,d=!!a.prevRow,c={};if(!a.isHeader)if(b.x&&(c.x=b.x),b.y&&(c.y=b.y),b.width&&(c.width=b.width),b.height&&(c.height=b.height),a.hoverColor&&(c.fill=a.hoverColor),a.usePlotHover&&b.hoverEle.attr(c).show(),b.useNext&&a.useHover){for(;a&&d;)a=a.prevRow,d=!!a.prevRow;for(;a;)a.items.background.attr("fill",a.hoverColor),a=a.nextRow}else a.useHover&&
a.items.background.attr("fill",a.hoverColor)},gridOutHandler:function(){var b=this.data("data"),a=b.gridObj,d=!!a.prevRow;if(!a.isHeader)if(a.usePlotHover&&b.hoverEle.hide(),b.useNext&&a.useHover){for(;a&&d;)a=a.prevRow,d=!!a.prevRow;for(;a;)a.items.background.attr("fill",a.bgColor||Ka),a=a.nextRow}else a.useHover&&a.items.background.attr("fill",a.bgColor)},drawAxes:function(){if(this.options.dataTable){Oa["renderer.cartesian"].drawAxes.call(this,arguments);var b=this.options,a=b.chart,e=this.paper,
c=this.layers,q=c.layerBelowDataset,k=c.layerAboveDataset,s=c.gridLayer,y=c.dataset,f=b.dataTable,g=b.categories,f=f&&f.processHeader,u=this.canvasTop,y=this.canvasLeft,s=a.gridBorderThickness,n=Ca(a.ganttStartX,a.totalGridWidth)+s,r=f.dimension,C=r.h,r=a.processHeight-r.h,l=d(g.startX,a.ganttStartX),g=g.visibleW,a=.5*a.ganttLineThickness,s=.5*s,s=c.gridLayer=c.gridLayer||e.group("grid",q).attr({"clip-rect":[y,u+C+s,n,r-s]});c.gridHeaderLayer=c.gridHeaderLayer||e.group("grid-header",q).attr({"clip-rect":[y,
u,n,C+r]});q=c.gridTracker=c.gridTracker||e.group("grid-tracker",q).attr({"clip-rect":[y,u,n,C+r]});s.data("vOffset",0);s.data("hOffset",0);q.data("vOffset",0);q.data("hOffset",0);c.ganttHeaderLayer=c.ganttHeaderLayer||e.group("gantt",k).attr({"clip-rect":[l,u,g+(b.verticalScroll.enabled?b.scrollOptions.height:0),this.chartHeight]});y=c.dataset.attr({"clip-rect":[l,u+C-a,g,r+a]});b=c.datalabels.attr({"clip-rect":[l,u+C-a-10,g,r+a+10]});e=c.ganttTracker=e.group("gantt-hot",c.tracker).attr({"clip-rect":[l,
u+C-a,g,r+a]});y.data("vOffset",0);y.data("hOffset",0);b.data("vOffset",0);b.data("hOffset",0);e.data("vOffset",0);for(e.data("hOffset",0);f;)this.drawProcess(f),f=f.nextRow;this.drawCategories()}},drawPlotGantt:function(b){var a=this,J=a.options,c=J.chart,q=a.paper,k=a.layers,s=b.data,y=b.items,f=s.length,g=k.dataset,u=k.datalabels,n=J.dataTable,r=n.processHeader,C=J.categories,l=C.axis,t=a.canvasTop,D=c.taskBarRoundRadius,f=J.plotOptions.series,m=isNaN(+f.animation)&&f.animation.duration||1E3*f.animation,
h=J.tasksMap||(J.tasksMap={}),x=J.milestone,v=J.trendlines,E=r.dimension.h,ca=c.taskDatePadding,G,Y,L,M,N,B,Z,H,$,K,w,p,S,aa,ea,W,ha,A,Q,ba,F;b.graphics=[];ea=g.shadows||(g.shadows=q.group("shadows",g));f=v&&v.length;for(b=0;b<f;b+=1)w=v[b],w.end||(w.end=w.start),w.end&&(Q=l.getPixel(w.start),W=l.getPixel(w.end),ba=w.thickness,J=w.items||(w.items={}),G=void 0,w.isTrendZone?(K=["M",Q+.5*(W-Q),t+E,"v",t+r.totalPH],ba=W-Q):(K=["M",Q,t+E,"L",W,t+E+r.totalPH],G=w.dashedStyle),J.trendLine=q.path(K,g).attr({stroke:w.color,
"stroke-width":ba,"stroke-dasharray":G}),Sa(w.displayValue)&&""!==w.displayValue&&(J.label=q.text(k.ganttHeaderLayer).attr({text:w.displayValue,x:K[1],y:0}).css(w.style),G=J.label._getBBox().height,w=t+c.processHeight+(!C.scroll.enabled||c.marginBottom<G?.5*G:-(.5*G)-5),J.label.attr("y",w)));u.hide();k=function(){u.show()};v=r=function(b){T.call(this,a,b)};C=function(b){T.call(this,a,b,"DataPlotRollOver")};t=function(b){T.call(this,a,b,"DataPlotRollOut")};E=function(b){b&&b.click(function(b){T.call(this,
a,b)}).hover(function(b){var c=this.data("dataObj");T.call(this,a,b,"DataPlotRollOver");c.showHoverEffect&&a.taskHoverHandler.call(this,a)},function(b){var c=this.data("dataObj");T.call(this,a,b,"DataPlotRollOut");c.showHoverEffect&&a.taskHoverOutHandler.call(this,a)}).data("dataObj",A).data("eventArgs",Y)};f=s.length;for(b=0;b<f;b+=1)A=s[b],J=A.processId,w=n[J],W=ha=A.color,J=A.items||(A.items={}),K=A.animation?m||1E3:0,w&&(F=A.borderThickness,Q=va(l.getPixel(A.start)),ba=ac(M=l.getPixel(A.end)-
Q),Q&&ba&&(L=w.dimension.h,w=w.yPos-L,G=L*(/%/g.test(A.height)&&.01*Gb(A.height,10))||d(A.height,L),p=L*(/%/g.test(A.topPadding)&&.01*Gb(A.topPadding,10))||d(A.topPadding,L),w+=Ca(p,L-G),aa=.5*G,S=A.toolText,p=A.link,(L=y[b])||(L=y[b]={index:b,dataLabel:null,start:A.start,end:A.end,startLabel:null,endLabel:null,tracker:null}),A.index=b,N=e(A.id,b),""!==N&&h[N]&&(h[N].items=L,h[N].x=Q,h[N].y=w,h[N].h=G,h[N].w=ba),M=N=B=Z=H=$=null,A.showAsGroup?(K?(M=q.path(["M",Q,w],g),M.animate({path:["M",Q,w,"v",
G,"L",Q+aa,w+aa,"H",Q+ba-aa,"L",Q+ba,w+G,"v",-G,"H",Q]},K,"normal",k)):(M=q.path(["M",Q,w,"v",G,"L",Q+aa,w+aa,"H",Q+ba-aa,"L",Q+ba,w+G,"v",-G,"H",Q],g),k&&k()),M.attr({fill:W,stroke:A.borderColor,cursor:p?"pointer":"",ishot:!0,"stroke-width":A.borderThickness}).tooltip(S).shadow(c.shadow&&A.shadow,ea)):(-1!==A.percentComplete&&(M=ba*A.percentComplete*.01,W=Ka,N=J.taskFill=q.rect(Q,w,0,G,0,g).attr({fill:ha,cursor:p?"pointer":"",ishot:!0,"stroke-width":0,width:K?0:M||1}).tooltip(S),K&&N.animate({width:M||
1},K,"normal"),B=q.rect(Q,w,0,G,0,g).attr({fill:A.slackColor,cursor:p?"pointer":"",ishot:!0,"stroke-width":0,x:K?Q:Q+M||1,width:K?0:ba-M||1}).tooltip(S),K&&B.animate({x:Q+M||1,width:ba-M||1},K,"normal")),J=ka.crispBound(Q,w,ba,G,F),M=q.rect(J.x,J.y,0,J.height,D,g).attr({fill:W,stroke:A.borderColor,cursor:p?"pointer":"",ishot:!0,"stroke-width":A.borderThickness,width:K?0:J.width||1}).tooltip(S).shadow(c.shadow&&A.shadow,ea),K?M.animate({width:J.width||1},K,"normal",k):k&&k()),Sa(A.label)&&""!==A.label&&
(J=A.labelAlign,Z=q.text().attr({text:A.label,x:Q+ba*gb[J]+Ua[J],"text-anchor":Ta[J],cursor:p?"pointer":"",ishot:!0,y:w-.5*Ra(A.style.lineHeight,10)-c.taskLabelPadding}).css(A.style),u.appendChild(Z)),Sa(A.startDate)&&""!==A.startDate&&(H=q.text().attr({text:A.startDate,x:Q-2-ca,y:w+.5*G,cursor:p?"pointer":"",ishot:!0,"text-anchor":"end"}).css(A.style),u.appendChild(H)),Sa(A.endDate)&&""!==A.endDate&&($=q.text().attr({text:A.endDate,x:Q+ba+2+ca,y:w+.5*G,cursor:p?"pointer":"",ishot:!0,"text-anchor":"start"}).css(A.style),
u.appendChild($)),L.graphic=M,L.percentCompleteGraphic=N,L.slackGraphic=B,L.dataLabel=Z,L.startLabel=H,L.endLabel=$,Y={processId:A.processId,taskId:A.id,start:A._start,end:A._end,showAsGroup:A.showAsGroup,link:A.link,sourceType:"task",percentComplete:-1!==A.percentComplete&&A.percentComplete},N&&N.click(r).hover(C,t).data("eventArgs",Y),B&&B.click(v).data("eventArgs",Y),Qa([M,Z,H,$],E)));y=function(b){T.call(this,a,b,"MilestoneClick")};n=function(b){var c=this.data("dataObj");T.call(this,a,b,"MilestoneRollOver");
c.showHoverEffect&&c.items.graphic.attr({fill:c.hoverFillColor,stroke:c.hoverBorderColor,"fill-opacity":c.hoverFillAlpha,"stroke-opacity":c.hoverBorderAlpha})};D=function(b){var c=this.data("dataObj");T.call(this,a,b,"MilestoneRollOut");c.showHoverEffect&&c.items.graphic.attr({fill:c.fillColor,stroke:c.borderColor,"fill-opacity":c.fillAlpha,"stroke-opacity":c.borderAlpha})};this.drawConnectors();J=null;f=x&&x.length;for(b=0;b<f;b+=1)c=x[b],w=h[c.taskId],J=c.items||(c.items={}),w&&(s=ka.animation({"fill-opacity":c.fillAlpha,
"stroke-opacity":c.borderAlpha},m,"normal"),Y={sides:c.sides,date:c.origDate,radius:c.radius,taskId:c.taskId,toolText:c.toolText,link:c.link,numSides:c.numSides},J.graphic=q.polypath(c.numSides,l.getPixel(c.date.ms),w.y+.5*w.h,d(c.radius,.6*w.h),c.startAngle,c.depth,g).attr({fill:c.fillColor,"fill-opacity":m?0:c.fillAlpha,stroke:c.borderColor,"stroke-opacity":m?0:c.borderAlpha,ishot:!0,cursor:c.link?"pointer":"","stroke-width":c.borderThickness}).tooltip(c.toolText).click(y).data("eventArgs",Y).data("dataObj",
c),m&&J.graphic.animate(s.delay(m)),J.graphic.hover(n,D))},taskHoverOutHandler:function(b){var a=b.options.tasksMap;b=this.data("dataObj");var a=a[e(b.id,b.index)].items,d={fill:b.color,stroke:b.borderColor,"stroke-width":b.borderThickness,"stroke-dasharray":b.dashedStyle};-1===b.percentComplete||b.showAsGroup||(a.slackGraphic.attr({fill:b.slackColor}),a.percentCompleteGraphic.attr({fill:b.color}),delete d.fill);a.graphic.attr(d)},taskHoverHandler:function(b){var a=b.options.tasksMap;b=this.data("dataObj");
var a=a[e(b.id,b.index)].items,d={fill:b.hoverFillColor,stroke:b.hoverBorderColor};-1===b.percentComplete||b.showAsGroup||(a.slackGraphic.attr({fill:b.slackHoverColor}),a.percentCompleteGraphic.attr({fill:b.hoverFillColor}),delete d.fill);a.graphic.attr(d)},drawConnectors:function(){var b=this,a=b.paper,d=b.options,c=d.chart.connectorExtension,e=d.connectors,k=d.tasksMap,s=e.length,y=b.layers.dataset,f=[],d=d.plotOptions.series,d=isNaN(+d.animation)&&d.animation.duration||1E3*d.animation,g,u,n,r,
C,l,t,D,m,h,x,v,E,S,G;E=function(a){T.call(this,b,a,"ConnectorClick")};S=function(a){var c=this.data("dataObj"),d=k[c.fromTaskId],e=k[c.toTaskId],f={stroke:c.hoverColor,"stroke-dasharray":c.dashedStyle,"stroke-width":c.hoverThickness};T.call(this,b,a,"ConnectorRollOver");c.showHoverEffect&&(Qa([d,e],function(a){var b={fill:a.dataObj.hoverFillColor,stroke:a.dataObj.hoverBorderColor};-1===a.dataObj.percentComplete||a.dataObj.showAsGroup||(a.items.slackGraphic.attr({fill:a.dataObj.slackHoverColor}),
a.items.percentCompleteGraphic.attr({fill:a.dataObj.hoverFillColor,stroke:a.dataObj.hoverBorderColor}),delete b.fill);a.items.graphic.attr(b)}),c.items.connector.attr(f))};G=function(a){var c=this.data("dataObj"),d=k[c.fromTaskId],e=k[c.toTaskId],f={stroke:c.color,"stroke-width":c.thickness,"stroke-dasharray":c.dashedStyle};T.call(this,b,a,"ConnectorRollOut");c.showHoverEffect&&(Qa([d,e],function(a){var b={fill:a.dataObj.color,stroke:a.dataObj.borderColor,"stroke-width":a.dataObj.borderThickness,
"stroke-dasharray":a.dataObj.dashedStyle};-1===a.dataObj.percentComplete||a.dataObj.showAsGroup||(a.items.slackGraphic.attr({fill:a.dataObj.slackColor}),a.items.percentCompleteGraphic.attr({fill:a.dataObj.color}),delete b.fill);a.items.graphic.attr(b)}),c.items.connector.attr(f))};for(g=0;g<=s;g+=1)if(n=e[g]||{},l=n.fromTaskId,r=n.toTaskId,u=k[l],m=k[r],r=n.items||(n.items={}),u&&m){h=u.y+.5*u.h;x=m.y+.5*m.h;C=h==x;l=u.x;t=u.x+u.w;D=m.x;m=m.x+m.w;v=v=0;0===n.fromTaskConnectStart&&1===n.toTaskConnectStart&&
(v=1);0===n.fromTaskConnectStart&&0===n.toTaskConnectStart&&(v=2);1===n.fromTaskConnectStart&&1===n.toTaskConnectStart&&(v=3);1===n.fromTaskConnectStart&&0===n.toTaskConnectStart&&(v=4);if(C)switch(u=u.height,v){case 1:v=(D-t)/10;f=["M",t,h,t+v,h,"L",t+v,h,t+v,h-u,"L",t+v,h-u,D-v,h-u,"L",D-v,h-u,D-v,h,"L",D-v,h,D,x,"L",m+c,x,m,x];break;case 2:f=["M",t,h,t+c,h,"L",t+c,h,t+c,h-u,"L",t+c,h-u,m+c,h-u,"L",m+c,x-u,m+c,x];break;case 3:f=["M",l,h,l-c,h,"L",l-c,h,l-c,h-u,"L",l-c,h-u,D-c,h-u,"L",D-c,h-u,D-
c,h,"L",D-c,h,D,h];break;case 4:f=["M",l,h,l-c,h,"L",l-c,h,l-c,h-u,"L",l-c,h-u,m+c,h-u,"L",m+c,h-u,m+c,h,"L",m+c,h,m,h]}else switch(v){case 1:f=["M",t,h,t+(D-t)/2,h,"L",t+(D-t)/2,h,t+(D-t)/2,x,"L",t+(D-t)/2,x,D,x];f=t<=D?["M",t,h,t+(D-t)/2,h,"L",t+(D-t)/2,h,t+(D-t)/2,x,"L",t+(D-t)/2,x,D,x]:["M",t,h,t+c,h,"L",t+c,h,t+c,h+(x-h)/2,"L",t+c,h+(x-h)/2,D-c,h+(x-h)/2,"L",D-c,h+(x-h)/2,D-c,x,"L",D-c,x,D,x];break;case 2:v=0>m-t?0:m-t;f=["M",t,h,t+c+v,h,"L",t+c+v,h,t+c+v,x,"L",t+c+v,x,m,x];break;case 3:v=0>
l-D?0:l-D;f=["M",l,h,l-c-v,h,"L",l-c-v,h,l-c-v,x,"L",l-c-v,x,D,x];break;case 4:f=l>m?["M",l,h,l-(l-m)/2,h,"L",l-(l-m)/2,h,l-(l-m)/2,x,"L",l-(l-m)/2,x,m,x]:["M",l,h,l-c,h,"L",l-c,h,l-c,h+(x-h)/2,"L",l-c,h+(x-h)/2,m+c,h+(x-h)/2,"L",m+c,h+(x-h)/2,m+c,x,"L",m+c,x,m,x]}r.connector?r.connector.animate({path:f}):(l=ka.animation({"stroke-opacity":n.alpha},d,"normal"),r.connector=a.path(f,y).attr({stroke:n.color,"stroke-opacity":0,"stroke-width":n.thickness,"stroke-dasharray":n.dashedStyle}).animate(l.delay(d)));
l={fromTaskId:n.fromTaskId,toTaskId:n.toTaskId,fromTaskConnectStart:n.fromTaskConnectStart,toTaskConnectStart:n.toTaskConnectStart,link:n.link,sourceType:"connector"};r.tracker=a.path(f,y).attr({stroke:Ka,"stroke-width":W(n.thickness,10),ishot:!0,cursor:n.link?"pointer":""}).data("dataObj",n).data("eventArgs",l).click(E);r.tracker.hover(S,G)}}},Oa["renderer.cartesian"])}]);
