function AdfPivotTableUtils(a,b,c){0<arguments.length&&this.Init(a,b,c)}A_h("AdfPivotTableUtils",AdfPivotTableUtils);AdfObject.createSubclass(AdfPivotTableUtils);
AdfPivotTableUtils.InitClass=function(){this.D=-1;this.n=0;this.l=1;this.Uc=this.tf=2;this.pd=3;this.iQ="::";this.rl=-1;this.Pz=this.Nz=1;this.Oz=[this.Nz,this.Pz];this.AC=this.yC=1;this.zC=[this.yC,this.AC];this.VA=this.TA=0;this.UA=[this.TA,this.VA];this.gB=[this.Oz,this.zC];this.gB["-1"]=this.UA;this.qi=3;AdfPivotTableUtils.Ky();this.CC=[0,0];this.BC=[1,1];this.RQ=this.SQ=this.iC=1;this.Zo=0;this.$o=1;this.Bt=2;this.uf=[[],[]];this.Og=[[],[]];this.Fi=[[],[]];this.Pg=[[],[]];this.uf[0][0]=0;this.uf[0][1]=
1;this.uf[1][0]=2;this.uf[1][1]=3;this.Og[0][0]=4;this.Og[0][1]=5;this.Og[1][0]=6;this.Og[1][1]=7;this.Fi[0][0]=8;this.Fi[0][1]=9;this.Fi[1][0]=10;this.Fi[1][1]=11;this.Pg[0][0]=12;this.Pg[0][1]=13;this.Pg[1][0]=14;this.Pg[1][1]=15;this.aB=this.bB=0;this.dB=20;this.cB=200;this.dO=10;this.Ha=!AdfAssert.DEBUG;this.cy=A_b;this.Ae="_st_dbc";this.Vd="_st_dbc_s";this.ze="_st_dbc_f";this.Mi="_st_rhc";this.Li="_st_rhc_s";this.Ki="_st_rhc_f";this.ui="_st_chc";this.ti="_st_chc_s";this.si="_st_chc_f";this.To=
"_st_rp_icl";this.Yo="_st_rpsdt";this.ao="_st_cpsdt";this.Uo="_st_rp_icr";this.So="_st_rp_icc";this.Xo="_st_rp_lc";this.Vo="_st_rp_ihc";this.Wo="_st_rp_iph";this.eo="_st_cp_ict";this.fo="_st_cp_lc";this.co="_st_cp_icc";this.bo="_st_cp_icb";this.Zn="_st_cp_ihc";this.$n="_st_cp_iph";this.ap="st_sel";this.Qz="af_dvt-pivotTable_column-sizing-cell"};AdfPivotTableUtils.InitClass=AdfPivotTableUtils.InitClass;
AdfPivotTableUtils.Ky=function(){AdfPivotTableUtils.bt=[2,2];AdfPivotTableUtils.et=[1,1];AdfPivotTableUtils.wo=[1,1];AdfPivotTableUtils.jt=[0,0];AdfPivotTableUtils.kt=[33,67]};
AdfPivotTableUtils.prototype.Init=function(a,b,c){AdfPivotTableUtils.superclass.Init.call(this);this.ic=c.id;this.DH=a;this.Ba=b;this.ac=c;a=this.ac.id+"::";this.Aa=AdfDhtmlPivotTablePeer.O(c,a+"Inner");c=AdfDhtmlPivotTablePeer.O(this.Aa,a+"RowHeader0");var d=AdfDhtmlPivotTablePeer.O(this.Aa,a+"RowHeader1"),e=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ColHeader0"),f=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ColHeader1"),g=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Databody00"),h=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Databody01"),
l=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Databody10"),m=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Databody11");if(AdfPivotTableUtils.F())var n=g.childNodes[0],p=h.childNodes[0],q=l.childNodes[0],v=m.childNodes[0];var u=AdfDhtmlPivotTablePeer.O(this.Aa,a+"DatabodyScroller01"),w=u.childNodes[0],r=AdfDhtmlPivotTablePeer.O(this.Aa,a+"DatabodyScroller10"),x=r.childNodes[0],s=AdfDhtmlPivotTablePeer.O(this.Aa,a+"DatabodyScroller11"),z=s.childNodes[0],A=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ColHeaderScrollbarSpacer0"),
G=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ColHeaderScrollbarSpacer1"),B=AdfDhtmlPivotTablePeer.O(this.Aa,a+"RowHeaderScrollbarSpacer0"),D=AdfDhtmlPivotTablePeer.O(this.Aa,a+"RowHeaderScrollbarSpacer1");this.Tb=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Corner");this.Kb=[c,d];this.fb=[e,f];this.xc=[this.fb,this.Kb];this.kb=[[g,h],[l,m]];this.he=[[A_,u],[r,s]];this.Rv=[[A_,w],[x,z]];AdfPivotTableUtils.F()&&(this.lj=[[n,p],[q,v]]);this.Ne=[[l,m],[h,m]];this.Ad=[[r,s],[u,s]];this.gr=AdfDhtmlPivotTablePeer.O(this.Aa,
a+"StatusBar");this.tq=this.gr!=A_;this.br=[[B,D],[A,G]];this.Lv=AdfDhtmlPivotTablePeer.O(this.Aa,a+"CornerScrollbarSpacer");b.Fa&&(this.wa=[[],[]],this.wa[0][0]=AdfDhtmlPivotTablePeer.O(this.ac,a+"hPc").childNodes[1],this.wa[0][1]=AdfDhtmlPivotTablePeer.O(this.ac,a+"hPc").childNodes[0],this.wa[1][0]=AdfDhtmlPivotTablePeer.O(this.ac,a+"vPc1").childNodes[0],this.wa[1][1]=AdfDhtmlPivotTablePeer.O(this.ac,a+"vPc").childNodes[0],this.Mj=[[],[]],this.Mj[0][0]=":hPIc1",this.Mj[0][1]=":hPIc",this.Mj[1][0]=
":vPIc1",this.Mj[1][1]=":vPIc");this.yh=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ri");this.pj=AdfDhtmlPivotTablePeer.O(this.Aa,a+"FetchStatus");this.Zw=AdfDhtmlPivotTablePeer.O(this.Aa,a+"pdt");this.XH=AdfDhtmlPivotTablePeer.O(this.Aa,a+"ScrollbarTesterParent");this.oI=AdfDhtmlPivotTablePeer.O(this.Aa,a+"Summary");this.ax=AdfDhtmlPivotTablePeer.O(this.Aa,a+"PivotStatus");this.R=AdfPage.PAGE.getLocaleContext().isRightToLeft();this.Lm=[[0,0],[0,0]];this.ke=[[0,0],[0,0]];AdfPivotTableUtils.F()&&!b.Fa&&(this.Wm=
A_c);this.bk=[0.5,0.5];this.Nk=["offsetWidth","offsetHeight"];this.tM=["width","height"];this.Bh=["_width","_height"];this.nr=["_usableWidth","_usableHeight"];this.$f=["_horizPos","_top"];this.lh=["_canvasHorizPos","_canvasTop"];this.Qk=["scrollLeft","scrollTop"];this.mz=["column","row"];A_Bi(this)};AdfPivotTableUtils.qs=function(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("mobile")&&-1!=a.indexOf("safari")};
AdfPivotTableUtils.F=function(){return AdfAgent.guessOS()==AdfAgent.ANDROID_OS||AdfPivotTableUtils.qs()};
AdfPivotTableUtils.MT=function(a){var b=a.getSource(),c=b.getParent().getPeer(),d=b.getClientId().indexOf("vPIc");if(-1!=d)var e=AdfPivotTableUtils.l,d=d==b.getClientId().length-4?1:0;else e=AdfPivotTableUtils.n,d=b.getClientId().indexOf("hPIc")==b.getClientId().length-4?1:0;if(!c.uh[e][d]&&!c.en){var f=a.getNewValue();a=a.getOldValue();a!=f&&(c.uh[e][d]=A_b,b.setValue(a))}else if(c.en){c.en=A_c;var g=A_b,f=a.getNewValue();a=a.getOldValue();var h=c.b.o[e];if(f>(1==d&&-1!=h?h:0)&&f<=c.b.pm[e]&&!(f>
a&&c.b.aa(e,d)==c.b.ke[e][d])){g=e;f-=1;a:{var l=c.b,h=A_sf(l.Ba,g,f,1);if(-1!=h)for(var m=l.T[g][1][h],n=m.firstChild.rows,h=m[l.$f[g]],n=g?n:n[0].cells,p=l.Nk[g],l=l.getIntAttribute(m,"_startSlice"),m=1;m<n.length;m++){if(l+m-1==f)break a;h+=n[m][p]}h=A_a}h!=A_?(f=c.b.aa(g,1),c.b.setScrollPos(g,1,f+h,A_b),c.Bb(c.getComponent())):AdfPivotTableUtils.l==g?c.zg(f,A__g(c,AdfPivotTableUtils.n)):c.zg(A__g(c,AdfPivotTableUtils.l),f);g=A_c}g&&(c.uh[e][d]=A_b,b.setValue(a))}else c.uh[e][d]&&(c.uh[e][d]=A_c)};
AdfPivotTableUtils.prototype.ya=function(a,b){return AdfPivotTableUtils.F()?this.kb[a][b]:this.he[a][b]};function A_Ci(a,b,c){return AdfPivotTableUtils.F()?a.Ne[b][c]:a.Ad[b][c]}function A_Xa(a,b,c){c||(c=b.childNodes);for(var d=c.length-1;0<=d;--d){var e=c[d];e instanceof Array?A_Xa(a,b,e):e.parentNode==b&&(a.Xe(e),b.removeChild(e))}}AdfPivotTableUtils.prototype.Xe=function(a){AdfPage.PAGE.removeComponentsInSubtree(a);AdfAgent.AGENT.elementsRemoved(a)};
function A_Ag(a,b){for(var c=[[],[]],d=a.i,e=1;0<=e;--e)for(var f=d[e];2>f;++f){var g=a.T[e][f][0],h=1==e?0<a.o[0]?[a.N[f][0][0][0],a.N[f][1][0][0]]:[a.N[f][1][0][0]]:0<a.o[1]?[a.N[0][f][0][0],a.N[1][f][0][0]]:[a.N[1][f][0][0]],l=a.getIntAttribute(g,"_startSlice"),m=a.Rf[e][f],n=a.xd[e][f],p=A_3g(a.Ba,e,f,A_c),q=c[e],v=f,u=a,w=e,r=f,x=a.ke[e][f],s=e?b.Hy[f]:b.sz[f],z=A_b,l=(l-m)*a.jm[e];p>=n?(AdfAssert.assert(AdfPivotTableUtils.Ha||g.getAttribute("_lastBlock"),"In scrollToEnd case, the block must be the last block."),
p=x,n=l-p):(p=-s,n=Math.max(p,l-x),n==p&&(z=A_c),p=l-n);m=AdfPivotTableUtils.F()?l:n;for(x=0;x<h.length;++x)A_4(u,w,m,h[x]);A_4(u,w,n,g);for(x=0;x<h.length;++x)A_Qg(w,l,h[x]);A_Qg(w,l,g);z&&A_Rg(u,w,r);q[v]=p}if(a.Ba.Ja)for(e=0;2>e;++e)for(f=d[e];2>f;++f)A_rg(a.Ba,"positionInitialBlocks calling setScrollPos("+e+", "+f+", "+c[e][f]+")");q=[[],[]];for(e=0;2>e;++e)for(f=d[e];2>f;++f)q[e][f]=a.setScrollPos(e,f,c[e][f]);if(!AdfPivotTableUtils.Ha){v=A_c;e=0;a:for(;2>e;++e)for(f=d[e];2>f;++f)if(c[e][f]!=
q[e][f]){v=A_b;break a}if(v){v="positionInitialBlocks: scrollPoses out of bounds.  ";for(e=0;2>e;++e)for(f=d[e];2>f;++f)v+="edge "+e+", pane "+f+", scrollPos "+c[e][f]+", scrollPos2 "+q[e][f];AdfAssert.assert(A_c,v)}}}
function A_Rg(a,b,c){if(b===A_a)for(b=0;2>b;++b)for(c=a.i[b];2>c;++c)A_Rg(a,b,c);else viewportStartSliceObj=A_Yg(a,b,c,0),viewportStartSlice=viewportStartSliceObj.slice,-1!=viewportStartSlice&&(viewportStartPixel=viewportStartSliceObj.lc,A_2g(a.Ba,b,c,A_c,viewportStartSlice),A_2g(a.Ba,b,c,A_b,viewportStartPixel))}
function A_Di(a,b){if(b===A_a)A_Di(a,AdfPivotTableUtils.n),A_Di(a,AdfPivotTableUtils.l);else{var c;a:if(c=-a.xc[b][1][a.Qk[1-b]],0==c)c={Fc:0,lc:0};else{for(var d=a.T[b][1][0].firstChild.rows,d=b==AdfPivotTableUtils.l?d[0].cells:d,e=a.Nk[1-b],f=1;f<d.length;++f){var g=d[f][e];c+=g;if(0<c){c={Fc:f-1,lc:g-c};break a}}AdfAssert.assert(AdfPivotTableUtils.Ha||A_c,"firstLayerInViewport completed without finding a first layer, which shouldn't happen");c=A_a}d=c.Fc;e=1==b?AdfRichPivotTable.Zi:AdfRichPivotTable.Xi;
a.Ba.getComponent().setProperty(e,d);c=c.lc;d=1==b?AdfRichPivotTable.$i:AdfRichPivotTable.Yi;a.Ba.getComponent().setProperty(d,c)}}function A_Gg(a,b,c){c=a.T[b][c][0];return c[a.lh[b]]-c[a.$f[b]]}
function A_jg(a,b){for(var c=a.N,d=1;0<=d;--d)for(var e=1-d,f=a.T[d],g=a.T[e],h=a.i[d];2>h;++h){var l=a.aa(d,h);if(b||0!=l-A_Gg(a,d,h)||0==d&&a.R){for(var m=f[h],n=0;n<m.length;n++){var p=m[n];if(!p._placeholder){var q=p[a.lh[d]]-l;A_4(a,d,q,p)}for(p=a.i[e];2>p;++p)for(var v=g[p].length,u=1==d?c[h][p]:c[p][h],w=0;w<v;w++){var r=1==d?u[n][w]:u[w][n];r&&(q=AdfPivotTableUtils.F()?r[a.lh[d]]:r[a.lh[d]]-l,A_4(a,d,q,r))}}A_Rg(a,d,h)}}}
function A_xh(a,b,c,d){var e=a.Ga[b],f=e.length;for(i=c;i<f;i++){var g=e[i];!g._placeholder&&!g._new&&(A_Qg(1,g._canvasTop+d,g),A_4(a,1,g._top+d,g))}for(e=a.i[0];2>e;++e){var h=a.N[b][e],f=h.length;for(i=c;i<f;i++){var l=h[i],m=l.length;for(j=0;j<m;j++)if((g=l[j])&&!g._new)A_Qg(1,g._canvasTop+d,g),A_4(a,1,g._top+d,g)}}}function A_Bi(a){a.N=[[[],[]],[[],[]]];a.na=[[],[]];a.Ga=[[],[]];a.T=[a.na,a.Ga];a.T[AdfPivotTableUtils.D]=a.N}
function A_Jg(a,b,c,d,e){var f=a.xc[b][c],g=a.T[b][c].splice(d,e);A_Xa(a,f,g);f=AdfPivotTableUtils.F()?a.lj:a.kb;for(g=a.i[1-b];2>g;++g){if(b)var h=c,l=g;else h=g,l=c;var m=a.N[h][l],h=f[h][l];if(b)l=a,m=m.splice(d,e),A_Xa(l,h,m);else for(l=0;l<m.length;++l){var n=a,p=h,q=m[l].splice(d,e);A_Xa(n,p,q)}}}function A_ug(a){A_Bi(a);for(var b=AdfPivotTableUtils.F()?a.lj:a.kb,c=0;2>c;++c)for(var d=0;2>d;++d)A_Xa(a,a.xc[c][d]),A_Xa(a,b[c][d])}
function A_wg(a){for(var b=a.Ga,c=a.N,d=0<a.o[0]?[a.na[0].length,a.na[1].length]:[a.na[1].length],e=a.o[1],f=A_qg(AdfDhtmlPivotTablePeer.oh(a.ac),a.ic,AdfPivotTableUtils.l),g=f.length,h=0;h<g;++h){var l=f[h],m=a.getIntAttribute(l,"_startSlice"),n=a.getIntAttribute(l,"_numSlices"),p=m<e?0:1,q=b[p],v=0<a.o[0]?c[p]:[c[p][1]];A_vg(a,a.Kb[p],l);p=q.length;if(0==p){q[0]=l;for(var u=0;u<v.length;++u)v[u][0]=Array(d[u])}else if(u=a.getIntAttribute(q[0],"_startSlice"),m<u)if(n=m+n,n==u){q.unshift(l);for(u=
0;u<v.length;++u)v[u].unshift(Array(d[u]))}else{m=u-n;p={qe:n,me:m,ne:A_b};q.unshift(l,p);for(u=0;u<v.length;++u)v[u].unshift(Array(d[u]),Array(d[u]))}else{var w=q[p-1],u=a.getIntAttribute(w,"_startSlice"),w=a.getIntAttribute(w,"_numSlices");if(m>u)if(n=u+w,n==m){q.push(l);for(u=0;u<v.length;++u)v[u].push(Array(d[u]))}else{m-=n;p={qe:n,me:m,ne:A_b};q.push(p,l);for(u=0;u<v.length;++u)v[u].push(Array(d[u]),Array(d[u]))}else for(u=0;u<p;++u){var w=q[u],r=a.getIntAttribute(w,"_startSlice"),x=a.getIntAttribute(w,
"_numSlices"),w=r+x;if(m==r){q[u]=l;if(n<x){p={qe:m+n,me:x-n,ne:A_b};q.splice(u+1,0,p);for(l=0;l<v.length;++l)v[l].splice(u+1,0,Array(d[l]))}break}if(m<w){q[u]=l;p={qe:r,me:m-r,ne:A_b};q.splice(u,0,p);for(l=0;l<v.length;++l)v[l].splice(u,0,Array(d[l]));l=m+n;if(l<w){p={qe:l,me:w-l,ne:A_b};q.splice(u+2,0,p);for(l=0;l<v.length;++l)v[l].splice(u+2,0,Array(d[l]))}break}}}}for(p=0;2>p;++p){u=0;for(c=b[p].length;u<c;++u)if(b[p][u]._placeholder)throw Error("Attempting to add one or more placeholder rows!");
}b=a.na;d=a.o[0];e=A_qg(AdfDhtmlPivotTablePeer.oh(a.ac),a.ic,AdfPivotTableUtils.n);f=e.length;for(g=0;g<f;++g)if(q=e[g],l=a.getIntAttribute(q,"_startSlice"),m=a.getIntAttribute(q,"_numSlices"),c=l<d?0:1,h=b[c],A_vg(a,a.fb[c],q),v=h.length,0==v)h[0]=q,A_Ei(a,c,0);else if(n=a.getIntAttribute(h[0],"_startSlice"),l<n)m=l+m,m==n?h.unshift(q):(l=n-m,p={qe:m,me:l,ne:A_b},h.unshift(q,p),A_Ei(a,c,0)),A_Ei(a,c,0);else if(u=h[v-1],n=a.getIntAttribute(u,"_startSlice"),u=a.getIntAttribute(u,"_numSlices"),l>n)m=
n+u,m==l?h.push(q):(l-=m,p={qe:m,me:l,ne:A_b},h.push(p,q),A_Ei(a,c,v)),A_Ei(a,c,v);else for(n=0;n<v;++n){u=h[n];p=a.getIntAttribute(u,"_startSlice");w=a.getIntAttribute(u,"_numSlices");u=p+w;if(l==p){h[n]=q;m<w&&(p={qe:l+m,me:w-m,ne:A_b},h.splice(n+1,0,p),A_Ei(a,c,n+1));break}if(l<u){h[n]=q;p={qe:p,me:l-p,ne:A_b};h.splice(n,0,p);A_Ei(a,c,n);q=l+m;q<u&&(p={qe:q,me:u-q,ne:A_b},h.splice(n+2,0,p),A_Ei(a,c,n+2));break}}for(c=0;2>c;++c){n=0;for(d=b[c].length;n<d;++n)if(b[c][n]._placeholder)throw Error("Attempting to add one or more placeholder cols!");
}b=A_qg(AdfDhtmlPivotTablePeer.oh(a.ac),a.ic,AdfPivotTableUtils.D);c=b.length;for(d=0;d<c;++d){e=b[d];f=a.getIntAttribute(e,"_startRow");g=a.getIntAttribute(e,"_startCol");n=f<a.o[1]?0:1;u=g<a.o[0]?0:1;h=a.Ga[n];q=a.na[u];v=a.N[n][u];l=h.length;m=q.length;AdfPivotTableUtils.F()?A_vg(a,a.lj[n][u],e):A_vg(a,a.kb[n][u],e);for(u=n=0;n<l&&!(p=a.getIntAttribute(h[n],"_startSlice"),f==p);++n);for(;u<m&&!(p=a.getIntAttribute(q[u],"_startSlice"),g==p);++u);AdfAssert.assert(AdfPivotTableUtils.Ha||!v[n][u],
"adding databody block to non-empty buffer slot.");v[n][u]=e}A_Xa(a,AdfDhtmlPivotTablePeer.oh(a.ac))}function A_vg(a,b,c){b.appendChild(c);c._new=A_b;c.style.top=b==a.fb[0]||b==a.fb[1]||b==a.Tb?"0px":a.Ba.je+1E3+"px";b==a.Kb[0]||b==a.Kb[1]||b==a.Tb?a.R?c.style.right="0px":c.style.left="0px":c.style.left=a.Ba.le+1E3+"px"}
function A_Bg(a){for(var b,c,d,e=a.i,f=0;2>f;++f){b=a.T[f];for(var g=e[f];2>g;++g){c=b[g];for(var h=0;h<c.length;++h)d=c[h],d._new=A_c}}b=a.N;for(f=e[1];2>f;++f)for(var g=b[f],l=e[0];2>l;++l){c=g[l];for(h=0;h<c.length;++h)for(var m=c[h],n=0;n<m.length;++n)d=m[n],d._new=A_c}a.qa&&(a.qa._new=A_c)}function A_Ei(a,b,c){for(var d=a.i[1];2>d;++d)for(var e=a.N[d][b],f=e.length,g=0;g<f;++g)e[g].splice(c,0,A_)}
function A_kg(a,b,c,d){if(d==A_a){d=[[],[]];for(var e=1;0<=e;--e)for(var f=a.i[e];2>f;++f)d[e][f]=A_Hg(a,e,f,c?c[e][f]:0)}c=[];for(var e={},f={},g=a.i[1];2>g;++g)for(var h=d[1][g],l=a.i[0];2>l;++l){var m=d[0][l];a.findBlocksInRangeNeedingFetch(c,e,f,l,m.start,m.end,g,h.start,h.end)}if(0<c.length){d=[];for(var n in f)f.hasOwnProperty(n)&&d.push(f[n]);for(n in e)e.hasOwnProperty(n)&&d.push(e[n]);n=A_Eh(a);e=A_Fh(a);b?(b="initialFillViewport",f=AdfPivotTableUtils.aB):(b="shortScroll",f=AdfPivotTableUtils.dB);
A_mg(a.Ba,b,f,c,A_,d,n,e);return A_b}return A_c}function A_Ig(a,b,c,d){var e=d.start;return!(e==d.end&&(-1==e||e==a.T[b][c].length))}
function A_Hg(a,b,c,d){d==A_a&&(d=0);var e=a.$f[b],f=a.Bh[b],g=a.T[b][c],h=a.xd[b][c],l=d;b=d+a.Ne[b][c][f];c=g.length;d=-2;var m=c,n=g[0][e];if(n>l)d=-1;else for(var p=0;p<c;++p){var q=g[p],v=q[e],q=q[f],q=v+q;if(l<q){d=p;break}}if(-2==d)return{start:c,end:c};if(-1==d){if(b<=n)return{start:-1,end:-1};l=0;q=g[0];startSlice=a.getIntAttribute(q,"_startSlice");0==startSlice&&(d=0)}else l=d;for(p=l;p<c;++p)if(q=g[p],v=q[e],q=q[f],q=v+q,b<=q){m=p;break}m==c&&(q=g[c-1],startSlice=a.getIntAttribute(q,"_startSlice"),
numSlices=a.getIntAttribute(q,"_numSlices"),startSlice+numSlices>=h&&--m);return{start:d,end:m}}
function A_Yg(a,b,c,d,e){e==A_a&&(e=A_Hg(a,b,c,d));c=a.T[b][c];e=e.start;if(-1==e||e==c.length)return{slice:-1,lc:-1,Ag:-1};e=c[e];c=e.firstChild.rows;d=e[a.$f[b]]-d;c=b?c:c[0].cells;b=a.Nk[b];for(var f=1;f<c.length;++f){var g=c[f][b];d+=g;if(0<d)return{slice:a.getIntAttribute(e,"_startSlice")+f-1,lc:g-d,Ag:d}}AdfAssert.assert(AdfPivotTableUtils.Ha||A_c,"firstSliceInShiftedViewport completed without finding a first slice, which shouldn't happen")}
function A_Zg(a,b,c){var d;d==A_a&&(d=A_Hg(a,b,c,0));var e=a.T[b][c];d=d.end;if(-1==d||d==e.length)return{slice:-1,Ag:-1,fi:-1};e=e[d];d=e.firstChild.rows;c=a.Ad[b][c];c=(b?c._usableHeight:c._usableWidth)-(e[a.$f[b]]-0+e[a.Bh[b]]);d=b?d:d[0].cells;b=a.Nk[b];for(var f=d.length-1;1<=f;--f){var g=d[f][b];c+=g;if(0<c)return{slice:a.getIntAttribute(e,"_startSlice")+f-1,Ag:c,fi:g-c}}AdfAssert.assert(AdfPivotTableUtils.Ha||A_c,"lastSliceInShiftedViewport completed without finding a last slice, which shouldn't happen")}
AdfPivotTableUtils.prototype.findBlocksInRangeNeedingFetch=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,v,u;if(0==this.pe||0==this.fc)return A_c;var w=this.Ga[g],r=this.na[d],x=this.N[g][d],s=w.length,z=r.length,A={},G={},B=A_c,D=A_c,y=A_c,C=A_c;-1==e&&(e=0,B=A_b);-1==h&&(h=0,y=A_b);f==z&&(f-=1,D=A_b);l==s&&(l-=1,C=A_b);s=Array(z);for(z=e;z<=f;++z){var H=r[z],F={};F.di=H._placeholder?A_b:A_c;F.Fb=this.getIntAttribute(H,"_startSlice");F.Mk=this.getIntAttribute(H,"_numSlices");s[z]=F}B&&(q=A_b,v=Math.min(this.Hv,
s[0].Fb-this.Rf[0][d]),u=s[0].Fb-v);D&&(m=A_b,n=(s[f].Fb?s[f].Fb:0)+(s[f].Mk?s[f].Mk:0),p=Math.min(this.Hv,this.xd[0][d]-n));for(H=h;H<=l;++H){F=w[H];d=F._placeholder?A_b:A_c;var t=this.getIntAttribute(F,"_startSlice");h=this.getIntAttribute(F,"_numSlices");for(var E=x[H],z=e;z<=f;++z)if(E[z]==A_){var K=s[z],I=A_Bh(K.Fb,t,K.di,d,K.Mk,h);a.push(I);d||(A[t]=F);K.di||(G[K.Fb]=r[z])}B&&(I=A_Bh(u,t,q,d,v,h),a.push(I),d||(A[t]=F));D&&(I=A_Bh(n,t,m,d,p,h),a.push(I),d||(A[t]=F))}if(y){d=A_b;t=this.getIntAttribute(w[0],
"_startSlice");h=Math.min(this.kx,t-this.Rf[1][g]);t-=h;for(z=e;z<=f;++z)K=s[z],I=A_Bh(K.Fb,t,K.di,d,K.Mk,h),a.push(I),K.di||(G[K.Fb]=r[z]);B&&(I=A_Bh(u,t,A_c,A_c,v,h),a.push(I));D&&(I=A_Bh(n,t,A_c,A_c,p,h),a.push(I))}if(C){d=A_b;l=w[l];t=this.getIntAttribute(l,"_startSlice");l=this.getIntAttribute(l,"_numSlices");t+=l;h=Math.min(this.kx,this.xd[1][g]-t);for(z=e;z<=f;++z)K=s[z],I=A_Bh(K.Fb,t,K.di,d,K.Mk,h),a.push(I),K.di||(G[K.Fb]=r[z]);B&&(I=A_Bh(u,t,A_c,A_c,v,h),a.push(I));D&&(I=A_Bh(n,t,A_c,A_c,
p,h),a.push(I))}for(t in A)A.hasOwnProperty(t)&&(a=A_Ch(A_c,A[t]),a=A_Dh(A_b,A_c,t,a),c[t]=a);for(t in G)G.hasOwnProperty(t)&&(a=A_Ch(A_b,G[t]),a=A_Dh(A_c,A_b,t,a),b[t]=a)};AdfPivotTableUtils.prototype.findBlocksInRangeNeedingFetch=AdfPivotTableUtils.prototype.findBlocksInRangeNeedingFetch;
function A_qg(a,b,c){switch(c){case AdfPivotTableUtils.D:b+="::DatabodyBlock";break;case AdfPivotTableUtils.n:b+="::ColHeaderBlock";break;case AdfPivotTableUtils.l:b+="::RowHeaderBlock";break;default:throw Error("bad edge passed to AdfPivotTableUtils.getArrivingBlocks");}return A_tg(a,b)}function A_tg(a,b){for(var c=[],d=a.childNodes,e=0;e<d.length;e++){var f=d[e],g=f.id;g&&0==g.indexOf(b)&&c.push(f)}return c}
function A_4(a,b,c,d,e){b==AdfPivotTableUtils.n?e?(d._left=c,d.style.left=c+"px"):A_th(a,c,d):(d._top=c,d.style.top=c+"px")}function A_th(a,b,c){if(a.R){var d=c.parentNode,e=d._width;d==a.fb[1]&&(e-=a.fb[1]._height<a.na[1][0]._height?a.fb[1].offsetWidth-a.fb[1].clientWidth-AdfPivotTableUtils.wo[0]:0);a=e-c._width-b}else a=b;c._horizPos=b;c._left=a;c.style.left=a+"px"}function A_Qg(a,b,c){a==AdfPivotTableUtils.n?A_uh(b,c):c._canvasTop=b}function A_uh(a,b){b._canvasHorizPos=a}
AdfPivotTableUtils.prototype.aa=function(a,b){var c;if(a==AdfPivotTableUtils.n){var d=AdfPivotTableUtils.n;c=A_Ci(this,d,b).scrollLeft;if(this.R&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&!(8<=AdfAgent.AGENT.getVersion())){var e=this.ke[d][b];if(!AdfPivotTableUtils.Ha){var f=A_yh(this,d,b),d=this.Ne[d][b]._width+1;AdfAssert.assert(AdfPivotTableUtils.Ha||e-c==(f<d?0:f-d-c))}c=e-c}}else c=A_Ci(this,a,b).scrollTop;return c};
AdfPivotTableUtils.prototype.setScrollPos=function(a,b,c,d){if(!(0<this.ke[a][b]))return 0;var e=this.ke[a][b];c=Math.min(c,e);c=Math.max(c,0);this.R&&a==AdfPivotTableUtils.n&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&!(8<=AdfAgent.AGENT.getVersion())?(e-=c,AdfAssert.assert(AdfPivotTableUtils.Ha||e==Math.max(0,A_yh(this,a,b)-(this.Ne[a][b]._width+1)-c),"expected Math.max(0, canvasWidth - (databodyWidth+1) - newPosition) \x3d\x3d (maxScrollPos - newPosition), but not equal")):e=c;var f=A_Ci(this,
a,b),g=this.Qk[a];if(d)f[g]=e;else{this.rw=A_b;try{this.Lm[a][b]=c,f[g]=e}finally{this.rw=A_c}}AdfAssert.assert(AdfPivotTableUtils.cy||f[g]==e,"setScrollPos() tried to set an out-of-bounds scrollPos, which shouldn't be possible due to the preceding bounds checks.  Perhaps maxScrollPos is set too high.");AdfAssert.assert(AdfPivotTableUtils.cy||this.aa(a,b)==c,"setScrollPos() tried to set the scroll pos, but the resulting scrollPos !\x3d newPosition");return c};
AdfPivotTableUtils.prototype.cloneArray=function(a){var b;if(Array.isArray(a)){b=a.slice(0);for(a=0;a<b.length;a++)b[a]=this.cloneArray(b[a]);return b}return a};