var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(f,u,l){f instanceof String&&(f=String(f));for(var v=f.length,r=0;r<v;r++){var a=f[r];if(u.call(l,a,r,f))return{i:r,v:a}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,u,l){f!=Array.prototype&&f!=Object.prototype&&(f[u]=l.value)};
$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(f,u,l,v){if(u){l=$jscomp.global;f=f.split(".");for(v=0;v<f.length-1;v++){var r=f[v];r in l||(l[r]={});l=l[r]}f=f[f.length-1];v=l[f];u=u(v);u!=v&&null!=u&&$jscomp.defineProperty(l,f,{configurable:!0,writable:!0,value:u})}};
$jscomp.polyfill("Array.prototype.find",function(f){return f?f:function(f,l){return $jscomp.findInternal(this,f,l).v}},"es6","es3");$jscomp.checkStringArgs=function(f,u,l){if(null==f)throw new TypeError("The 'this' value for String.prototype."+l+" must not be null or undefined");if(u instanceof RegExp)throw new TypeError("First argument to String.prototype."+l+" must not be a regular expression");return f+""};
$jscomp.polyfill("String.prototype.endsWith",function(f){return f?f:function(f,l){var v=$jscomp.checkStringArgs(this,f,"endsWith");f+="";void 0===l&&(l=v.length);l=Math.max(0,Math.min(l|0,v.length));for(var r=f.length;0<r&&0<l;)if(v[--l]!=f[--r])return!1;return 0>=r}},"es6","es3");
(function(){function f(a,b){var c=a.isSizedByContent(),d="min"==a._hflex;if(!a.head&&(d||c)){var e=zk(a.$n()).padBorderWidth(),h=l(a)+(zk(a.ebody).hasVScroll()?jq.scrollbarWidth():0)+e;e=a.ebodytbl;var g=a._minWd.wds,n=g.length;b&&d&&a.setFlexSize_({width:h},!0);if((e=e.firstChild)&&(e=e.firstChild)){b=e.firstChild;for(h=0;b&&h<n;b=b.nextSibling)b.style.width=jq.px(g[h++]);c&&!d&&(c=e.lastChild,a=a.uuid+"-bdflex",c&&c.id==a||jq(e).append('<td id="'+a+'"></td>'))}}}function u(a){if("min"==a._hflex){var b=
l(a),c=a.$n();a._hflexsz=b+zk(c).padBorderWidth();c.style.width=jq.px0(a._hflexsz)}}function l(a){a._calcMinWds();var b=a.ebdfaker,c=[],d=a._minWd.wds;if(a.head&&b){var e=0;a=a.head.firstChild;for(var h=b.firstChild,g=0;a;a=a.nextSibling)b="min"==a._hflex?c[g]=d[g]+zk(a.$n()).padBorderWidth():a._width&&0<a._width.indexOf("px")?c[g]=zk.parseInt(a._width):c[g]=zk.parseInt(h.style.width),a._origWd=jq.px0(b),e+=b,++g,h=h.nextSibling}else e=a._minWd.width;return e}function v(a){if(a=(a=a.getBodyWidgetIterator().next())?
a.$n():null){for(var b=a,c,d=b.cells.length;a;a=a.nextSibling)(c=a.cells.length)>d&&(b=a,d=c);return b}}var r;zul.mesh.MeshWidget=zk.$extends(zul.Widget,{_rows:0,_pagingPosition:"bottom",_prehgh:-1,_minWd:null,$init:function(){this.$supers("$init",arguments);this.heads=[]},_innerWidth:"100%",_currentTop:0,_currentLeft:0,$define:{rows:function(a){this._rows&&!this._rowsOnFitSize&&(zWatch.listen({onFitSize:this}),this._rowsOnFitSize=!0);if(a=this.$n())a._lastsz=null,this.onSize()},pagingPosition:_zkf=
function(){this.rerender()},sizedByContent:_zkf,span:function(a){var b=!0===a||"true"==a,c=!1===a||"false"==a;this._span=b?!0:c?!1:a;a=b?-65500:c?0:zk.parseInt(a)+1;this._nspan=0>a&&-65500!=a?0:a;this.rerender()},autopaging:_zkf,paginal:null,model:null,innerWidth:function(a){null==a&&(this._innerWidth=a="100%");this.eheadtbl&&(this.eheadtbl.style.width=a);this.ebodytbl&&(this.ebodytbl.style.width=a);this.efoottbl&&(this.efoottbl.style.width=a)}},getPageSize:function(){return(this.paging||this._paginal).getPageSize()},
setPageSize:function(a){(this.paging||this._paginal).setPageSize(a)},getPageCount:function(){return(this.paging||this._paginal).getPageCount()},getActivePage:function(){return(this.paging||this._paginal).getActivePage()},setActivePage:function(a){(this.paging||this._paginal).setActivePage(a)},inPagingMold:function(){return"paging"==this.getMold()},setHeight:function(a){this.$supers("setHeight",arguments);this.desktop&&(this._setHgh(a),this.onSize())},setWidth:function(a){this.$supers("setWidth",arguments);
this.eheadtbl&&(this.eheadtbl.style.width="");this.efoottbl&&(this.efoottbl.style.width="");if(this.desktop)this.onSize()},setStyle:function(a){if(this._style!=a&&(this.$supers("setStyle",arguments),this.desktop))this.onSize()},getHeadWidget:function(){return this.head},getFocusCell:function(a){var b;jq([this.ebodytbl,this.eheadtbl,this.efoottbl]).each(function(c){if(this&&jq.isAncestor(this,a)){var d=jq(a).parents(1==c?"th":"td");c=0;for(var e=d.length;c<e;c++)if(b=d[c],jq(b).parents("table")[0]==
this)return!1}});return b},_moveToHidingFocusCell:function(a){var b=this.ehdfaker?this.ehdfaker.childNodes[a]:null,c=this.frozen;if(b&&c&&0==zk.parseInt(b.style.width)&&0<=(a-=c.getColumns())){if(this._nativebar)c.setStart(a);else if(b=this._scrollbar)c._doScrollNow(a),b.setBarPosition(a);r=!0}},_restoreFocus:function(){r&&zk.currentFocus&&(r=!1,zk.currentFocus.focus())},bind_:function(){this.$supers(zul.mesh.MeshWidget,"bind_",arguments);this._bindDomNode();"min"!=this._hflex&&this._fixHeaders();
this.ehead&&this.domListen_(this.ehead,"onScroll","_doSyncScroll");var a=this.ebody;this._nativebar&&a&&(this.domListen_(a,"onScroll","_doScroll"),a.style.overflow="auto",this.efrozen&&jq(a).css("overflow-x","hidden"));zWatch.listen({onSize:this,onResponse:this})},unbind_:function(){this._rowsOnFitSize&&(zWatch.unlisten({onFitSize:this}),delete this._rowsOnFitSize);zWatch.unlisten({onSize:this,onResponse:this});this.ehead&&this.domUnlisten_(this.ehead,"onScroll","_doSyncScroll");var a=this.ebody;
this._nativebar&&a&&this.efrozen&&jq(a).css("overflow-x","auto");this.$supers(zul.mesh.MeshWidget,"unbind_",arguments)},clearCache:function(){this.$supers("clearCache",arguments);this.ebody=this.ehead=this.efoot=this.efrozen=this.ebodytbl=this.eheadtbl=this.efoottbl=this.ebodyrows=this.ehdfaker=this.ebdfaker=null},syncSize:function(){this.desktop&&(this.clearCachedSize_(),"min"==this._hflex?zFlex.onFitSize.apply(this):this._fixHeaders(),zWatch.fireDown("onSize",this))},onResponse:function(){this._shallSize&&
(this.syncSize(),this._shallSize=!1)},_syncSize:function(){this.desktop&&(this._shallSize=!0)},_fixHeaders:function(a){if(this.head&&this.ehead){for(var b=!0,c=!1,d="min"==this._hflex||this.isSizedByContent(),e=this.heads.length;0<e--;){for(var h=this.heads[e],g=!0,n=0,k=h.firstChild;k;k=k.nextSibling){var q=this.ehdfaker.childNodes[n++];d&&q&&!q.style.width&&!k._nhflex&&(k._hflex="min",k._nhflex=-65500,k._nhflexbak=!0);!c&&k._nhflex&&(c=!0);if(k.getLabel()||k.getImage()||k.nChildren)b=g=!1}h._visible&&
(k=h.$n())&&(k.style.display=g?"none":"")}d=this.ehead.style.display;a=a&&c&&this.isRealVisible();this.ehead.style.display=b?"none":"";for(k=this.head.firstChild;k;k=k.nextSibling)a&&k._nhflex&&k.fixFlex_(),k._nhflexbak&&(delete k._hflex,delete k._nhflex,delete k._nhflexbak);return d!=this.ehead.style.display}},_adjFlexWd:function(){var a=this.head;if(a){var b=this.ehdfaker.firstChild,c=this.ebdfaker.firstChild,d=this.eftfaker;if(d)var e=d.firstChild;this.eheadtbl.style.width="";this.ebodytbl.style.width=
"";d=0;a=a.firstChild;for(var h;a&&c;a=a.nextSibling){var g=a.$n().offsetWidth;a.isVisible()&&.1<g&&(a._origWd=jq.px0(g));a.isVisible()&&void 0!==(h=a._hflexWidth)&&(g=zk(c).revisedWidth(Math.round(h)),a._origWd=g+"px",c.style.width=g+"px",b.style.width=c.style.width,e&&(e.style.width=c.style.width),d+=g);c=c.nextSibling;b=b.nextSibling;e&&(e=e.nextSibling)}this._isAllWidths()&&(b=this.eheadtbl,c=this.ebodytbl,e=this.efoottbl,b&&(b.style.width=d+"px",c&&(c.style.width=d+"px"),e&&(e.style.width=d+
"px")));u(this);this._afterCalcSize()}},_bindDomNode:function(){this.ehead=this.$n("head");this.eheadtbl=this.$n("headtbl");this.ebody=this.$n("body");this.ebodytbl=this.$n("cave");this.efoot=this.$n("foot");this.efoottbl=this.$n("foottbl");this.efrozen=this.$n("frozen");var a=this.$n("rows");this.ebody&&a&&(this.ebodyrows=a);this.ehead&&(this.eheadrows=this.$n("headrows"),this.ehdfaker=this.head.$n("hdfaker"),this.ebdfaker=this.head.$n("bdfaker"),this.efoot&&(this.eftfaker=this.head.$n("ftfaker")));
this.efoot&&(this.efootrows=this.$n("footrows"))},replaceHTML:function(){var a=this._syncingbodyrows;this._syncingbodyrows=!0;try{this.$supers(zul.mesh.MeshWidget,"replaceHTML",arguments)}finally{this._syncingbodyrows=a}},replaceChildHTML_:function(){var a=this._syncingbodyrows;this._syncingbodyrows=!0;try{this.$supers("replaceChildHTML_",arguments)}finally{this._syncingbodyrows=a}},fireOnRender:function(a){this._pendOnRender||(this._pendOnRender=!0,setTimeout(this.proxy(this._onRender),a?a:100))},
_doScroll:function(){var a=zul.mesh.Scrollbar.getScrollPosV(this),b=zul.mesh.Scrollbar.getScrollPosH(this),c=b!=this._currentLeft,d=a!=this._currentTop||c,e=this.ebody,h=this.ehead,g=this.efoot;jq(this).data("scrollable")&&zWatch.fireDown("onScroll",this);d&&!this.fire("onScroll",e.scrollLeft).stopped&&this._nativebar&&this._currentLeft!=e.scrollLeft&&(h&&(h.scrollLeft=e.scrollLeft),g&&(g.scrollLeft=e.scrollLeft));d&&(this._currentTop=a);d&&(this._currentLeft=b);this.paging||this._paginal||this.fireOnRender(zk.gecko?
200:60);d&&this._fireOnScrollPos();this.frozen&&c&&this.frozen.syncScrollByParentBody()},_doSyncScroll:function(){var a=this.ehead,b=this.ebody,c=this.efoot;a&&zk(a).isVisible()&&this._currentLeft!=a.scrollLeft&&(b&&(b.scrollLeft=a.scrollLeft),c&&(c.scrollLeft=a.scrollLeft))},_timeoutId:null,_fireOnScrollPos:function(a){clearTimeout(this._timeoutId);this._timeoutId=setTimeout(this.proxy(this._onScrollPos),0<=a?a:300)},_onScrollPos:function(){this.ebody&&(this._currentTop=zul.mesh.Scrollbar.getScrollPosV(this),
this._currentLeft=zul.mesh.Scrollbar.getScrollPosH(this),this.fire("onScrollPos",{top:this._currentTop,left:this._currentLeft}))},_onRender:function(){if(this.$n()){this._pendOnRender=!1;if(this._syncingbodyrows||zAu.processing())return this.fireOnRender(zk.gecko?200:60),!0;var a=this.ebodyrows?this.ebodyrows.rows:null;if(this.inPagingMold()&&this._autopaging&&a&&a.length){a:{var b=this.ebody;if(b){var c=b.offsetHeight;zk(b).hasHScroll()&&(c-=jq.scrollbarWidth());if(c==this._prehgh)c=!1;else{this._prehgh=
c;b=this.ebodytbl;var d=b.offsetParent,e=b.offsetTop,h=0;b=0;for(var g=this.getBodyWidgetIterator({skipHidden:!0}),n=a.length;g.next()&&b<n;b++){var k=a[b];var q=k.offsetTop-(k.offsetParent==d?e:0);if(q>c){--b;break}h=q}if(k&&(d=this.$n("pgib"),e=0,d&&(e=d.offsetHeight),d=c+e,q<=d&&(q=(this.paging?this.paging:this.getPaginal()).getTotalSize(),k=h+k.offsetHeight,c=Math.floor(b*c/k),k=Math.floor(b*d/k),b=q>k?c:k),0==b&&(b=1),b!=this.getPageSize())){this.fire("onPageSize",{size:b});c=!0;break a}c=void 0}}else c=
void 0}if(c)return}zk.ie8&&void 0!==this._wsbak&&(this.$n().style.whiteSpace=this._wsbak,delete this._wsbak);if(this.desktop&&this._model&&a&&a.length&&(c=[],k=zul.mesh.Scrollbar.getScrollPosV(this),b=k+this.ebody.offsetHeight,0!=k||0!=b)){q=0;h=this.getBodyWidgetIterator({skipHidden:!0});for(a=a.length;(d=h.next())&&q<a;q++)if(!(d._loaded||(e=d.$n(),null==e||(e=zk(e),g=e.offsetTop(),g+e.offsetHeight()<k)))){if(g>b)break;c.push(d)}c.length&&this.fire("onRender",{items:c},{implicit:!0})}}},onSize:function(){var a=
zUtl.getDevicePixelRatio();if(this.isRealVisible()){var b=this.$n();b._lastsz&&b._lastsz.height==b.offsetHeight&&b._lastsz.width==b.offsetWidth&&this._lastDevicePixelRatio==a?this.fireOnRender(155):(this._lastDevicePixelRatio=a,this._calcSize(),this.fireOnRender(155),this._nativebar&&(a=this.ebody,a.scrollHeight>=this._currentTop&&!this._adjustScrollTopLater&&(a.scrollTop=this._currentTop),a.scrollWidth>=this._currentLeft&&(a.scrollLeft=this._currentLeft,this.ehead&&(this.ehead.scrollLeft=this._currentLeft),
this.efoot&&(this.efoot.scrollLeft=this._currentLeft))),this._shallSize=!1,this._keepScroll&&this._scrollToIndex(this._targetIndex))}},_vflexSize:function(){var a=this.$n(),b=0;if(this.paging){var c=this.$n("pgit"),d=this.$n("pgib");c&&(b+=c.offsetHeight);d&&(b+=d.offsetHeight)}a=zk(a).contentHeight()-(this.ehead?this.ehead.offsetHeight:0)-(this.efoot?this.efoot.offsetHeight:0)-b;return this.frozen&&this._nativebar?a-this.efrozen.offsetHeight:a},setFlexSize_:function(a){var b=this.$n(),c=this.$n("head");
if(void 0!==a.height)if("auto"==a.height)b.style.height="",c&&(c.style.height="");else return this.$supers("setFlexSize_",arguments);if(void 0!==a.width)if("auto"==a.width)"min"!=this._hflex&&(b.style.width=""),c&&(c.style.width="");else return this.$supers("setFlexSize_",arguments)},_setHgh:function(a){var b=this.$n(),c=this.ebody.style;this.isVflex()||a&&"auto"!=a&&0>a.indexOf("%")?zk.webkit&&c.height==jq.px(this._vflexSize())||(c.height="",a=this._vflexSize(),0>a&&(a=0),"min"!=this._vflex&&(c.height=
a+"px")):(c.height="",b.style.height=a)},_ignoreHghExt:function(){return!1},_calcSize:function(){this._beforeCalcSize();var a=this.$n(),b=zk(a).contentWidth(),c=this.isSizedByContent(),d=this.ehead,e=this.ebody,h=this.ebodyrows,g=this.efoot,n=this.efootrows;zk.ie9_&&e&&b&&(e.style.width=b+"px");if(d)b&&(d.style.width=b+"px",e&&(e.style.width=b+"px"),g&&(g.style.width=b+"px")),c&&h?this._adjHeadWd():b&&g&&(g.style.width=b+"px");else if(g&&(b&&(g.style.width=b+"px"),n&&h&&(b=this.efootrows.rows[0],
h=this.ebodyrows.rows,b&&h&&h.length&&b.cells.length))){g=b.cells.length;e=d=0;n=this.getBodyWidgetIterator({skipHidden:!0});for(var k;k=n.next();)if(!this._modal||k._loaded){k=h[e++];var q=zk(k),F=k.cells,p=q.ncols();if((q=F.length==p&&q.isVisible())&&p>=g){d=g;var w=k;break}p>d?(w=q?k:null,d=p):p==d&&!w&&q&&(w=k)}if(d){if(g=!w){w=document.createElement("TR");w.style.height="0px";for(e=0;e<d;++e)w.appendChild(document.createElement("TD"));h[0].parentNode.appendChild(w)}for(e=d;e--;)b.cells[e].style.width=
"";h=0;for(e=d;e--;)n=b.cells[e],k=w.cells[e],zk.opera?(h+=k.offsetWidth,n.style.width=zk(k).contentWidth()):(n.style.width=k.offsetWidth+"px",1<d&&(p=k.offsetWidth-n.offsetWidth,0!=p&&(p+=k.offsetWidth,0>p&&(p=0),n.style.width=p+"px")));zk.opera&&this.isSizedByContent()&&(b.parentNode.parentNode.style.width=h+"px");g&&w.parentNode.removeChild(w)}}this._adjSpanWd();f(this,!0);c&&this.getRows&&1<this.getRows()&&"function"==typeof this._calcHgh&&this.ebody.style.height&&this._calcHgh();a._lastsz={height:a.offsetHeight,
width:a.offsetWidth};this._afterCalcSize()},_beforeCalcSize:function(){var a=this.ebody;this._nativebar||!a.scrollLeft&&!a.scrollTop||(this._ebodyScrollPos={l:a.scrollLeft,t:a.scrollTop});this._calcHgh()},_afterCalcSize:function(){this._ebodyScrollPos&&(this.ebody.scrollLeft=this._ebodyScrollPos.l,this.ebody.scrollTop=this._ebodyScrollPos.t,this._ebodyScrollPos=null);var a=this._isAllWidths();var b=this.head?this.head.$n("hdfaker-bar"):null;var c=this.eftfaker?this.head.$n("ftfaker-bar"):null;var d=
jq.scrollbarWidth(),e=zk(this.ebody).hasVScroll();if(e)b&&(b.style.width=d+"px"),c&&(c.style.width=d+"px");else{var h=this.$class.WIDTH0;b&&(b.style.width=h);c&&(c.style.width=h)}if(a){if(h=this.eheadtbl,a=this.ebodytbl,c=this.efoottbl,h){for(var g=0,n=this.ehdfaker.firstChild;n;n=n.nextSibling)"none"==n.style.display||n.id.endsWith("hdfaker-bar")||(g+=zk.parseInt(n.style.width));0<g&&(h.style.width=b&&e&&zk.chrome&&!zk.edge?g+d+"px":g+"px",a&&(a.style.width=g+"px"),c&&(c.style.width=g+"px"))}}else this.frozen&&
this.ebody&&(a=this.ebodytbl,h=this.eheadtbl,c=this.efoottbl,a&&(a.style.width=this.ebody.style.width),h&&(h.style.width=this.ehead.style.width),c&&(c.style.width=this.efoot.style.width))},_isAllWidths:function(){if(this.isSizedByContent()&&this.ebodyrows&&this.ebodyrows.firstChild)return!0;if(!this.head)return!1;for(var a=!0,b=this.head.firstChild;b;b=b.nextSibling)if(a&&(void 0==b._width||0>=b._width.indexOf("px"))&&("min"!=b._hflex||void 0===b._hflexsz)&&b.isVisible()){a=!1;break}return a},domFaker_:function(a,
b){var c=this.head;a.push('<colgroup id="',c.uuid,b,'">');for(var d=c.firstChild;d;d=d.nextSibling){var e=this.$class._getWidth(d,d._hflexWidth?d._hflexWidth+"px":d.getWidth()),h=d.isVisible()?"":"visibility: collapse;";e=null!=e?"width: "+e+";":"";a.push('<col id="',d.uuid,b,'" style="',e,h,'"/>')}(0<b.indexOf("hd")||0<b.indexOf("ft"))&&a.push('<col id="',c.uuid,b,'-bar" style="width: 0px" />');a.push("</colgroup>")},onChildAdded_:function(a){this.$supers("onChildAdded_",arguments);if(a.$instanceof(this.getHeadWidgetClass()))this.head=
a,this._minWd=null;else if(!a.$instanceof(zul.mesh.Auxhead))return;var b=a.nextSibling;if(b)for(var c=this.heads,d=0,e=c.length;d<e;++d)if(c[d]==b){c.splice(d,0,a);return}this.heads.push(a)},onChildRemoved_:function(a){this.$supers("onChildRemoved_",arguments);a==this.head?(this._minWd=this.head=null,this.heads.$remove(a)):a.$instanceof(zul.mesh.Auxhead)?this.heads.$remove(a):a.$instanceof(zul.mesh.Frozen)&&(this.efrozen=null)},resetSize_:function(a){this.$supers("resetSize_",arguments);"w"==a&&(this.ehead&&
(this.ehead.style.width=""),this.ebody&&(this.ebody.style.width=""),this.efoot&&(this.efoot.style.width=""))},beforeMinFlex_:function(a){if(void 0===this._hflexsz&&"w"==a&&void 0===this._width){this.isSizedByContent()&&this._calcSize();if(this.head)for(this._fixHeaders(!0),a=this.head.firstChild;a;a=a.nextSibling)if("min"==a._hflex&&void 0===a.hflexsz)return null;f(this);return l(this)}return null},beforeParentMinFlex_:function(a){"w"==a?(this.isSizedByContent()&&this._calcSize(),this.head&&this._fixHeaders()):
this._calcSize()},clearCachedSize_:function(){this.$supers("clearCachedSize_",arguments);this._clearCachedSize();var a;if(!this.ebdfaker&&(a=v(this))){a=a.cells;for(var b=a.length;b--;)a[b].style.width=""}if(a=this.getHeadWidget())for(a=a.firstChild;a;a=a.nextSibling)delete a._hflexsz},_clearCachedSize:function(){var a;if(a=this.$n())a._lastsz=this._minWd=null},_calcMinWds:function(){if(!this._minWd){var a,b,c=this.$n(),d=c?c.style.whiteSpace:"";c&&(zk.ie8&&(this._wsbak=d),c.style.whiteSpace="nowrap");
var e=this.ehdfaker,h=this.ebdfaker,g=this.eftfaker,n=(b=this.head)?b.$n():null,k=[],q=[],f=[],p=[],w=[];if(this.eheadtbl&&n){this.ehead.style.width="";var l=this.getInnerWidth()||"";this.eheadtbl.width="";this.eheadtbl.style.width="";var r=this.eheadtbl.style.tableLayout;this.eheadtbl.style.tableLayout="";zk.chrome&&(this.ebodytbl.style.display="block");var y=e.firstChild;var t=n.firstChild;for(var m=0;y;y=y.nextSibling,m++)if(a=t.firstChild)k[m]=y.style.width,y.style.width="",p[m]=t.style.width,
t.style.width="",w[m]=a.style.width,a.style.width="",t=t.nextSibling}n&&(n.style.width="");if(this.efoottbl){this.efoot.style.width="";var u=l||this.efoottbl.width;this.efoottbl.width="";this.efoottbl.style.width="";var G=this.efoottbl.style.tableLayout;this.efoottbl.style.tableLayout="";zk.chrome&&(this.ebodytbl.style.display="block");if(g){a=g.firstChild;var x=this.efootrows;x=x?x.rows[0].cells:null;for(m=0;a;a=a.nextSibling)x&&x[m]&&(x[m].style.width=""),f[m++]=a.style.width,a.style.width=""}}if(this.ebodytbl){this.ebody.style.width=
"";var H=l||this.ebodytbl.width;this.ebodytbl.width="";this.ebodytbl.style.width="";var I=this.ebodytbl.style.tableLayout;this.ebodytbl.style.tableLayout="";zk.chrome&&(this.ebodytbl.style.display="block");if(h)for(a=h.firstChild,m=0;a;a=a.nextSibling)q[m++]=a.style.width,a.style.width=""}x=[];var A=0;a=b?b.nChildren:0;t=b?b.firstChild:null;y=this.getHeadWidget();if(h&&t){var D=this._getFirstRowCells(this.ebodyrows),C=g?this._getFirstRowCells(this.efootrows):null;for(m=0;m<a;m++){b=D&&D[m]?D[m].offsetWidth:
0;var z=zk(t.$n("cave"));z=t&&t.isVisible()?z.textSize()[0]+z.padBorderWidth()+zk(t.$n()).padBorderWidth():0;var E=C&&C[m]&&zk(C[m]).isVisible()?C[m].offsetWidth:0,B;(B=y.getChildAt(m))&&B.getWidth()&&(z=Math.max(z,E));z>b&&(b=z);E>b&&(b=E);x[m]=b;!this.frozen&&(4<zk.ff||8<zk.ie||zk.safari)&&++x[m];A+=x[m];t&&(t=t.nextSibling)}this._deleteFakeRow(this.ebodyrows);g&&this._deleteFakeRow(this.efootrows)}else if(m=v(this))for(B=m.cells,m=B.length;m--;)b=B[m].offsetWidth,x[m]=b,!this.frozen&&(4<zk.ff||
8<zk.ie)&&++x[m],A+=x[m];(m=this.$n("empty"))&&"none"!=m.style.display&&(m=m.offsetWidth,m>A&&(A=m));if(this.eheadtbl&&n)for(0>l.indexOf("%")?((m=jq(this.head.$n("hdfaker")).find("[id*=hdfaker-bar]")[0])&&(l=jq.px0(parseInt(l)+parseInt(m.style.width))),this.eheadtbl.style.width=l):this.eheadtbl.width=l||"",this.eheadtbl.style.tableLayout=r||"",zk.chrome&&(this.eheadtbl.style.display=""),y=e.firstChild,t=n.firstChild,m=0;y;y=y.nextSibling,m++)if(a=t.firstChild)y.style.width=k[m],t.style.width=p[m],
a.style.width=w[m],t=t.nextSibling;if(this.efoottbl&&(this.efoottbl.width=u||"",this.efoottbl.style.tableLayout=G||"",zk.chrome&&(this.efoottbl.style.display=""),g))for(a=g.firstChild,m=0;a;a=a.nextSibling)a.style.width=f[m++];if(this.ebodytbl&&(this.ebodytbl.width=H||"",this.ebodytbl.style.tableLayout=I||"",zk.chrome&&(this.ebodytbl.style.display=""),h))for(a=h.firstChild,m=0;a;a=a.nextSibling)a.style.width=q[m++];c&&(c.style.whiteSpace=d);this._minWd={width:A,wds:x}}return this._minWd},_adjSpanWd:function(){if(this._isAllWidths()&&
this.isSpan()){var a=this.ehdfaker,b=this.ebdfaker,c=this.eftfaker;if(a&&b&&this.head.$n()){this._calcMinWds();var d=[],e=0,h=a.firstChild,g=b.firstChild,n=this._minWd.wds,k=this.head.nChildren;var q=h;for(var f=this.head.firstChild,p=0;f;f=f.nextSibling,p++){if(zk(q).isVisible(!0)){var l=f._width;l="min"==f._hflex?d[p]=n[p]:l&&l.endsWith("px")?d[p]=zk.parseInt(l):d[p]=n[p];e+=l}q=q.nextSibling}f=c?c.firstChild:null;var r=this.ebody.clientWidth,u=r-e,v=r,t=-1;n=0;if(0>this._nspan){var m=this.frozen&&
this.frozen.getStart();for(p=0;h&&p<k;h=h.nextSibling,p++)zk(h).isVisible(!0)?(d[p]=m?0>=u?l=d[p]:h.style.width?l=zk.parseInt(h.style.width):l=Math.round(d[p]*r/e+.5||0):l=0>=u?d[p]:Math.round(d[p]*r/e+.5||0),q=jq.px0(l),v-=l,t=p,h.style.width=q,g.style.width=q,n+=l,g=g.nextSibling,f&&(f.style.width=q,f=f.nextSibling)):(g=g.nextSibling,f&&(f=f.nextSibling));0<u&&0!=v&&0<=t&&(n-=l,l=d[t]+v,q=jq.px0(l),n+=l,m||(b.childNodes[t].style.width=q,a.childNodes[t].style.width=q,c&&(c.childNodes[t].style.width=
q)))}else for(t=this._nspan-1,p=0;h&&p<k;h=h.nextSibling,p++)zk(h).isVisible(!0)?(l=t==p&&0<u?d[t]+u:d[p],q=jq.px0(l),h.style.width=q,g.style.width=q,n+=l,g=g.nextSibling,f&&(f.style.width=q,f=f.nextSibling)):(g=g.nextSibling,f&&(f=f.nextSibling));this._isAllWidths()&&(a=this.eheadtbl,b=this.ebodytbl,c=this.efoottbl,a&&(a.style.width=n+"px",b&&(b.style.width=n+"px"),c&&(c.style.width=n+"px")));zk.opera&&zk(this.$n()).redoCSS()}}},_adjHeadWd:function(){var a=this.ehdfaker,b=this.ebdfaker,c=this.eftfaker;
if(a&&b&&this.getBodyWidgetIterator().hasNext()){var d=this.eheadtbl;if(this.head.$n()){var e=this.ebodytbl,h=this._calcMinWds(),g=h.wds;h=h.width;a=a.firstChild;b=b.firstChild;for(var f=c?c.firstChild:null,k=this.head.firstChild,l=this.$class.WIDTH0,r=0;k;k=k.nextSibling,r++)if(k.isVisible())if(k._width||0==g[r])0==g[r]&&(a.style.width=l,b.style.width=l,f&&(f.style.width=l)),a=a.nextSibling,b=b.nextSibling,f&&(f=f.nextSibling);else{if(!this.frozen||!this.frozen.getStart()||""===a.style.width){var p=
jq.px(g[r]);a.style.width=b.style.width=p;a=a.nextSibling;b=b.nextSibling;f&&(f.style.width=p,f=f.nextSibling)}}else a.style.width=l,b.style.width=l,a=a.nextSibling,b=b.nextSibling,f&&(f.style.width=l,f=f.nextSibling);d.style.width=jq.px(h);e.style.width=jq.px(h);c&&(this.efoottbl.style.width=jq.px(h));u(this)}}},_getFirstRowCells:function(a){var b,c;if(a&&(c=a.rows)&&(b=c.length)){var d=c[0].cells,e=d.length,h=0;if(0<a.offsetHeight)for(var g=0;g<b;g++)if("none"!=jq(c[g]).css("display")){d=c[g].cells;
e=d.length;break}for(g=0;g<e;g++)b=d[g].colSpan,h+=1!=b?b:1;if(h==e)return d;a=""+('<tr id="'+a.id+'-fakeRow" style="visibility:hidden;height:0">');for(g=0;g<h;g++)a+="<td></td>";a+="</tr>";jq(c[0]).before(a);return c[0].cells}},_deleteFakeRow:function(a){a&&jq("#"+a.id+"-fakeRow").remove()},refreshBar_:function(a,b){var c=this._scrollbar;if(c){var d=this._currentLeft,e=this._currentTop;c.syncSize(a||this._shallShowScrollbar);delete this._shallShowScrollbar;b?c.scrollTo(0,0):c.scrollTo(d,e);a=this.frozen;
var h;a&&0!=(h=a._start)&&(a._doScrollNow(h),c.setBarPosition(h));this._afterCalcSize()}},onFitSize:function(){this._rows&&this._calcHgh()},_calcHgh:function(){var a=this.ebodyrows?this.ebodyrows.rows:[],b=this.$n(),c=b.style.height;if(c&&"auto"!=c&&0>c.indexOf("%")&&(c=zk.parseInt(c)-zk(b).padBorderHeight())){c-=this._headHgh(0);0>c&&(c=0);var d=0,e=0,h=a.length;a:for(;e<h;++d,++e){for(;;++e){if(e>=h)break a;var g=a[e];if(zk(g).isVisible())break}g=zk(g);var f=g.offsetTop()+g.offsetHeight();if(f>=
c){f>c+2&&++d;break}}d=Math.ceil(d&&f?c*d/f:c/this._headHgh(20));this._visibleRows(d);c-=this.efoot?this.efoot.offsetHeight:0;c-=this.efrozen&&this._nativebar?this.efrozen.offsetHeight:0;this.ebody.style.height=(0>c?0:c)+"px";return}f=0;var k=this.getRows(),l;e=0;for(h=a.length;e<h;++e)if(g=a[e],zk(g).isVisible()){++f;l||(l=g);if(k===f){var r=g;break}d=g}c=0;k||(this.isVflex()&&(c=this._vflexSize(b.style.height),11>zk.ie&&this._cachehgh!=c&&(this._cachehgh=--c),25>c&&(c=25),(a=l?zk(l).offsetHeight():
null)||(a=this._headHgh(20)),k=Math.round((c-2)/a)),this._visibleRows(k));k?(c||(f?k<=f?(c=zk(r),c=c.offsetTop()+c.offsetHeight()):(c=zk(d),c=c.offsetTop()+c.offsetHeight(),c=Math.ceil(k*c/f)):c=this._headHgh(20,!0)*k),this.ebody.style.height=c+"px"):(this.ebody.style.height="",c=this.$n("a"),(this.paging||this._paginal)&&c&&(c.style.top="0px"))},_visibleRows:function(a){if("number"==typeof a)this._visiRows=a;else return this.getRows()||this._visiRows||0},_headHgh:function(a,b){var c=this.getHeadWidget(),
d=this.ehead;b=b?c?c.$n().offsetHeight:0:d?d.offsetHeight:0;this.paging&&(c=this.$n("pgit"),d=this.$n("pgib"),c&&(b+=c.offsetHeight),d&&(b+=d.offsetHeight));return b?b:a},_scrollToIndex:function(a,b){var c=this._getFirstItemIndex(),d=this._getLastItemIndex(),e=this.ebody;this._targetIndex=a;this._keepScroll=!0;if(a>=c&&a<=d)for(b=this.getBodyWidgetIterator();b.hasNext();){if(c=b.next(),c._index==a){c.$n().scrollIntoView(!0);this._keepScroll=!1;this._topBoundary=this._bottomBoundary=void 0;break}}else void 0!=
b?e.scrollTop=e.scrollHeight*b:a<c?(this._bottomBoundary=e.scrollTop,this._topBoundary=void 0==this._topBoundary?0:this._topBoundary,e.scrollTop-=(e.scrollTop-this._topBoundary)/2):a>d&&(this._topBoundary=e.scrollTop,this._bottomBoundary=void 0==this._bottomBoundary?e.scrollHeight:this._bottomBoundary,e.scrollTop+=(this._bottomBoundary-e.scrollTop)/2)}},{WIDTH0:zk.webkit?"0.001px":"0",_getWidth:function(a,b){return a.isVisible()?b:this.WIDTH0}});zul.mesh.Scrollbar={init:function(a){var b=!1!==jq(a.$n()).data("embedscrollbar"),
c=a.frozen,d=0;if(c&&(c=c.getColumns(),a.eheadtbl)){var e=a._getFirstRowCells(a.eheadrows);if(e)for(var f=0;f<c;f++)d+=e[f].offsetWidth;a._deleteFakeRow(a.eheadrows)}return new zul.Scrollbar(a.ebody,a.ebodytbl,{embed:b,startPositionX:d,onSyncPosition:function(){if(!this.frozen){var b=this.getCurrentPosition(),c=a.ehead,d=a.efoot;b&&this.hasHScroll()&&(c&&(c.scrollLeft=b.x),d&&(d.scrollLeft=b.x))}},onScrollEnd:function(){a._doScroll()}})},getScrollPosV:function(a){var b=a._scrollbar;return b?b.getCurrentPosition().y:
a.ebody.scrollTop},getScrollPosH:function(a){var b=a._scrollbar;return b?b.getCurrentPosition().x:a.ebody.scrollLeft}}})();
